From db19fce8d61f7ccbb756fd1affeeb6923cf1fe69 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 16 Mar 2015 17:27:10 +0100 Subject: fastd_cpuid: compile on GCC again --- src/cpuid.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cpuid.h b/src/cpuid.h index 78f87e5..bd165f2 100644 --- a/src/cpuid.h +++ b/src/cpuid.h @@ -48,7 +48,7 @@ /** Returns the ECX and EDX return values of CPUID function 1 as a single uint64 */ static inline uint64_t fastd_cpuid(void) { - uint32_t ecx, edx; + unsigned long cx, dx; #if defined (__i386__) #define REG_PFX "e" @@ -56,12 +56,13 @@ static inline uint64_t fastd_cpuid(void) { #define REG_PFX "r" #endif - __asm__ __volatile__ ("mov %%"REG_PFX"bx, %%"REG_PFX"di \n\t" + __asm__ __volatile__ ("mov $1, %%eax \n\t" + "mov %%"REG_PFX"bx, %%"REG_PFX"di \n\t" "cpuid \n\t" "mov %%"REG_PFX"di, %%"REG_PFX"bx \n\t" - : "=c" (ecx), "=d" (edx) : "a" (1) : REG_PFX"ax", REG_PFX"di"); + : "=c" (cx), "=d" (dx) : : REG_PFX"ax", REG_PFX"di"); - return ((uint64_t)ecx) << 32 | edx; + return ((uint64_t)cx) << 32 | (uint32_t)dx; } #undef REG_PFX -- cgit v1.2.3