Add write_cr0()

This commit is contained in:
Josh Holtrop 2022-11-05 19:58:10 -04:00
parent 59e084c234
commit 11f922da33

View File

@ -155,6 +155,11 @@ ulong read_cr0()
return __asm!ulong("mov %cr0, %rax", "={rax}"); return __asm!ulong("mov %cr0, %rax", "={rax}");
} }
void write_cr0(ulong v)
{
__asm("mov $0, %cr0", "r", v);
}
ulong read_cr2() ulong read_cr2()
{ {
return __asm!ulong("mov %cr2, %rax", "={rax}"); return __asm!ulong("mov %cr2, %rax", "={rax}");