summaryrefslogtreecommitdiffstats
path: root/src/cpuid.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpuid.h')
-rw-r--r--src/cpuid.h7
1 files 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 <cpuid.h>
#include <stdint.h>
-
#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;
}