aboutsummaryrefslogtreecommitdiffstats
path: root/com32/sysdump/cpuid.c
diff options
context:
space:
mode:
Diffstat (limited to 'com32/sysdump/cpuid.c')
-rw-r--r--com32/sysdump/cpuid.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/com32/sysdump/cpuid.c b/com32/sysdump/cpuid.c
index e7fc5767..846b5408 100644
--- a/com32/sysdump/cpuid.c
+++ b/com32/sysdump/cpuid.c
@@ -20,10 +20,21 @@ struct cpuid_info {
static void get_cpuid(uint32_t eax, uint32_t ecx, struct cpuid_data *data)
{
+#if __SIZEOF_POINTER__ == 4
asm("pushl %%ebx ; cpuid ; movl %%ebx,%1 ; popl %%ebx"
: "=a" (data->eax), "=r" (data->ebx),
"=c" (data->ecx), "=d" (data->edx)
: "a" (eax), "c" (ecx));
+#elif __SIZEOF_POINTER__ == 8
+ asm volatile("push %%rbx; cpuid; movl %%ebx, %1; pop %%rbx"
+ : "=a" (data->eax),
+ "=b" (data->ebx),
+ "=c" (data->ecx),
+ "=d" (data->edx)
+ : "a" (eax), "c" (ecx));
+#else
+#error "unsupported architecture"
+#endif
}
#define CPUID_CHUNK 128