1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:27:35 +00:00

Kernel: Add helpers for manipulating x86 control registers

Use read_cr{0,2,3,4} and write_cr{0,3,4} helpers instead of inline asm.
This commit is contained in:
Andreas Kling 2021-02-19 15:19:10 +01:00
parent 8d0b744ebb
commit da100f12a6
2 changed files with 37 additions and 60 deletions

View file

@ -526,10 +526,14 @@ inline FlatPtr offset_in_page(const void* address)
}
u32 read_cr0();
u32 read_cr2();
u32 read_cr3();
void write_cr3(u32);
u32 read_cr4();
void write_cr0(u32);
void write_cr3(u32);
void write_cr4(u32);
u32 read_dr6();
static inline bool is_kernel_mode()