summaryrefslogtreecommitdiffstats
path: root/xorg/server/module/x86/cpuid_x86.asm
diff options
context:
space:
mode:
Diffstat (limited to 'xorg/server/module/x86/cpuid_x86.asm')
-rw-r--r--xorg/server/module/x86/cpuid_x86.asm39
1 files changed, 39 insertions, 0 deletions
diff --git a/xorg/server/module/x86/cpuid_x86.asm b/xorg/server/module/x86/cpuid_x86.asm
new file mode 100644
index 00000000..6f9e8c2d
--- /dev/null
+++ b/xorg/server/module/x86/cpuid_x86.asm
@@ -0,0 +1,39 @@
+
+SECTION .text
+
+%macro PROC 1
+ align 16
+ global %1
+ %1:
+%endmacro
+
+;int
+;cpuid_x86(int eax_in, int ecx_in, int *eax, int *ebx, int *ecx, int *edx)
+
+PROC cpuid_x86
+ ; save registers
+ push ebx
+ push ecx
+ push edx
+ push edi
+ ; cpuid
+ mov eax, [esp + 20]
+ mov ecx, [esp + 24]
+ cpuid
+ mov edi, [esp + 28]
+ mov [edi], eax
+ mov edi, [esp + 32]
+ mov [edi], ebx
+ mov edi, [esp + 36]
+ mov [edi], ecx
+ mov edi, [esp + 40]
+ mov [edi], edx
+ mov eax, 0
+ ; restore registers
+ pop edi
+ pop edx
+ pop ecx
+ pop ebx
+ ret;
+ align 16
+