visor/include/x86/cr.h

31 lines
395 B
C
Raw Normal View History

2025-03-10 19:19:53 +01:00
#ifndef _VISOR_CR_H_
#define _VISOR_CR_H_
#include <stdint.h>
static inline uint64_t
readcr0(void)
{
uint64_t v;
__asm__ ("mov %%cr0, %0\n\t" : "=a"(v));
return v;
}
static inline uint64_t
readcr3(void)
{
uint64_t v;
__asm__ ("mov %%cr3, %0\n\t" : "=a"(v));
return v;
}
static inline uint64_t
readcr4(void)
{
uint64_t v;
__asm__ ("mov %%cr4, %0\n\t" : "=a"(v));
return v;
}
#endif