diff options
Diffstat (limited to 'src/DSUtil/cpuid64.asm')
-rw-r--r-- | src/DSUtil/cpuid64.asm | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/DSUtil/cpuid64.asm b/src/DSUtil/cpuid64.asm new file mode 100644 index 000000000..4c3d4c35b --- /dev/null +++ b/src/DSUtil/cpuid64.asm @@ -0,0 +1,35 @@ +; ml64 /c /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath)"
+; call cpuid with args in eax, ecx
+; store eax, ebx, ecx, edx to p
+
+ _TEXT64 segment page 'CODE'
+
+ align 8
+
+ PUBLIC cpuid64
+
+ cpuid64 PROC FRAME
+ ; void cpuid64(CPUID_ARGS* p);
+ ; rcx <= p
+ sub rsp, 32
+ .allocstack 32
+ push rbx
+ .pushreg rbx
+ .endprolog
+ mov r8, rcx
+ mov eax, DWORD PTR [r8+0]
+ mov ecx, DWORD PTR [r8+8]
+ cpuid
+ mov DWORD PTR [r8+0], eax
+ mov DWORD PTR [r8+4], ebx
+ mov DWORD PTR [r8+8], ecx
+ mov DWORD PTR [r8+12], edx
+ pop rbx
+ add rsp, 32
+ ret
+
+ ALIGN 8
+ cpuid64 ENDP
+_TEXT64 ENDS
+
+END
\ No newline at end of file |