Add read_rflags()
This commit is contained in:
parent
35e5aa2ee5
commit
d100ab53a8
@ -216,6 +216,14 @@ void write_cr4(ulong v)
|
|||||||
__asm("mov $0, %cr4", "r", 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)
|
ulong rdmsr(uint msr)
|
||||||
{
|
{
|
||||||
return __asm!ulong(`
|
return __asm!ulong(`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user