Add src/common/hos/cpu.d
This commit is contained in:
1 parent
1bc8722098
commit
372b7265f1
1 file changed
+21
@@ -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}");
|
||||
}
|
||||
Reference in new issue
Block a user