Add src/common/hos/cpu.d
This commit is contained in:
parent
1bc8722098
commit
372b7265f1
21
src/common/hos/cpu.d
Normal file
21
src/common/hos/cpu.d
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import ldc.llvmasm;
|
||||||
|
|
||||||
|
ulong read_cr0()
|
||||||
|
{
|
||||||
|
return __asm!ulong("mov %cr0, %rax", "={rax}");
|
||||||
|
}
|
||||||
|
|
||||||
|
ulong read_cr2()
|
||||||
|
{
|
||||||
|
return __asm!ulong("mov %cr2, %rax", "={rax}");
|
||||||
|
}
|
||||||
|
|
||||||
|
ulong read_cr3()
|
||||||
|
{
|
||||||
|
return __asm!ulong("mov %cr3, %rax", "={rax}");
|
||||||
|
}
|
||||||
|
|
||||||
|
ulong read_cr4()
|
||||||
|
{
|
||||||
|
return __asm!ulong("mov %cr4, %rax", "={rax}");
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user