Add write_cr3()

This commit is contained in:
Josh Holtrop 2022-03-18 16:40:46 -04:00
parent ef01239468
commit 9e3d9b18ea

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}");