X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/45e1f8b055043e54be35462852ab6649d634da7c..04ee277abd77fc51c5ab02ee58790a859607ea24:/lunaix-os/includes/hal/cpu.h diff --git a/lunaix-os/includes/hal/cpu.h b/lunaix-os/includes/hal/cpu.h index 93805d8..3b77c7e 100644 --- a/lunaix-os/includes/hal/cpu.h +++ b/lunaix-os/includes/hal/cpu.h @@ -60,6 +60,14 @@ cpu_rcr3() return val; } +static inline reg32 +cpu_rcr4() +{ + ptr_t val; + asm volatile("movl %%cr4,%0" : "=r"(val)); + return val; +} + static inline reg32 cpu_reflags() { @@ -129,4 +137,10 @@ cpu_rdmsr(u32_t msr_idx, u32_t* reg_high, u32_t* reg_low); void cpu_wrmsr(u32_t msr_idx, u32_t reg_high, u32_t reg_low); +static inline void +cpu_ldvmspace(ptr_t vms) +{ + cpu_lcr3(vms); +} + #endif \ No newline at end of file