diff options
Diffstat (limited to 'sys/include/arch/amd64/asm.h')
-rw-r--r-- | sys/include/arch/amd64/asm.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/include/arch/amd64/asm.h b/sys/include/arch/amd64/asm.h index d7334fe..e85dd87 100644 --- a/sys/include/arch/amd64/asm.h +++ b/sys/include/arch/amd64/asm.h @@ -85,6 +85,20 @@ amd64_write_cr0(uint64_t val) } static inline uint64_t +amd64_read_cr8(void) +{ + uint64_t cr8; + __ASMV("mov %%cr8, %0" : "=r" (cr8) :: "memory"); + return cr8; +} + +static inline void +amd64_write_cr8(uint64_t val) +{ + __ASMV("mov %0, %%cr8" :: "r" (val) : "memory"); +} + +static inline uint64_t amd64_read_cr4(void) { uint64_t cr4; |