git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: Optimize the signal context overhead
[lunaix-os.git]
/
lunaix-os
/
includes
/
hal
/
cpu.h
diff --git
a/lunaix-os/includes/hal/cpu.h
b/lunaix-os/includes/hal/cpu.h
index 93805d8b981d4220feba2d1d9d6269ff2428de00..3b77c7eb12aeca27205d8406f738ae5c8a17f0c2 100644
(file)
--- a/
lunaix-os/includes/hal/cpu.h
+++ b/
lunaix-os/includes/hal/cpu.h
@@
-60,6
+60,14
@@
cpu_rcr3()
return val;
}
return val;
}
+static inline reg32
+cpu_rcr4()
+{
+ ptr_t val;
+ asm volatile("movl %%cr4,%0" : "=r"(val));
+ return val;
+}
+
static inline reg32
cpu_reflags()
{
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);
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
#endif
\ No newline at end of file