Add write_cr4()

This commit is contained in:
Josh Holtrop 2022-11-03 23:31:55 -04:00
parent 1f2a2bea48
commit 2a7c783bba

View File

@ -60,6 +60,11 @@ ulong read_cr4()
return __asm!ulong("mov %cr4, %rax", "={rax}"); return __asm!ulong("mov %cr4, %rax", "={rax}");
} }
void write_cr4(ulong v)
{
__asm("mov $0, %cr4", "r", v);
}
ulong rdmsr(uint msr) ulong rdmsr(uint msr)
{ {
return __asm!ulong(` return __asm!ulong(`