Add read_rflags()

This commit is contained in:
Josh Holtrop 2023-11-25 13:02:27 -05:00
parent 35e5aa2ee5
commit d100ab53a8

View File

@ -216,6 +216,14 @@ void write_cr4(ulong v)
__asm("mov $0, %cr4", "r", v);
}
ulong read_rflags()
{
return __asm!ulong(`
pushf
mov (%rsp), %rax
add $$8, %rsp`, "={rax}");
}
ulong rdmsr(uint msr)
{
return __asm!ulong(`