From 7755b22419438356dcf62b54d7cce539bb4c7ce7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 26 Dec 2013 00:47:12 +0100 Subject: Change fastd_cpuid back to use inline assembly to support non-Linux systems again --- src/cpuid.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/cpuid.h b/src/cpuid.h index d909ad9..e4c6d95 100644 --- a/src/cpuid.h +++ b/src/cpuid.h @@ -27,10 +27,8 @@ #ifndef _FASTD_CPUID_H_ #define _FASTD_CPUID_H_ -#include #include - #define CPUID_FXSR ((uint64_t)1 << 24) #define CPUID_SSE2 ((uint64_t)1 << 26) #define CPUID_PCLMULQDQ ((uint64_t)1 << 33) @@ -38,10 +36,9 @@ static inline uint64_t fastd_cpuid(void) { - unsigned eax, ebc, ecx, edx; + unsigned eax, ebx, ecx, edx; - if (!__get_cpuid(1, &eax, &ebc, &ecx, &edx)) - return 0; + __asm__("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (1)); return ((uint64_t)ecx) << 32 | edx; } -- cgit v1.2.3