Add write_cr3()

This commit is contained in:
josh committed 2022-03-18 16:40:46 -04:00
1 parent ef01239468
commit 9e3d9b18ea
1 file changed
+5
+5
View File
@@ -15,6 +15,11 @@ ulong read_cr3()
return __asm!ulong("mov %cr3, %rax", "={rax}");
}
void write_cr3(ulong v)
{
__asm("mov $0, %cr3", "r", v);
}
ulong read_cr4()
{
return __asm!ulong("mov %cr4, %rax", "={rax}");