Add xgetbv()/xsetbv()
This commit is contained in:
parent
8eedf4e267
commit
1f2a2bea48
@ -73,6 +73,19 @@ void wrmsr(uint msr, ulong value)
|
||||
__asm(`wrmsr`, "{ecx},{edx},{eax}", msr, value >> 32u, value);
|
||||
}
|
||||
|
||||
ulong xgetbv(uint xcr)
|
||||
{
|
||||
return __asm!ulong(`
|
||||
xgetbv
|
||||
shl $$32, %rdx
|
||||
or %rdx, %rax`, "={rax},{ecx},~{rdx}", xcr);
|
||||
}
|
||||
|
||||
void xsetbv(uint xcr, ulong value)
|
||||
{
|
||||
__asm(`xsetbv`, "{ecx},{edx},{eax}", xcr, value >> 32u, value);
|
||||
}
|
||||
|
||||
ubyte in8(ushort ioaddr)
|
||||
{
|
||||
return __asm!ubyte("inb %dx, %al", "={al},{dx}", ioaddr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user