diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-07-17 20:58:33 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-07-17 21:02:02 +0100 |
commit | 6c8b15d321044d4a81cb187cc5e1ac094eb82367 (patch) | |
tree | 111530b131ae9ec6fa87d96a1a0deb241bf6b583 /src/sna/sna_cpu.c | |
parent | 08cacc265da8c1213d8bf1107168e37d38a3641d (diff) |
sna: Wrap cpuid.h
More our ifdef out of line from the main code into a header file, where
we can also apply a little bit of synatic sugar.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_cpu.c')
-rw-r--r-- | src/sna/sna_cpu.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/sna/sna_cpu.c b/src/sna/sna_cpu.c index c96b21f0..23e6bcc0 100644 --- a/src/sna/sna_cpu.c +++ b/src/sna/sna_cpu.c @@ -30,14 +30,7 @@ #endif #include "sna.h" - -#if HAS_GCC(4, 4) - -#include <cpuid.h> - -#ifndef bit_AVX2 -#define bit_AVX2 (1<<5) -#endif +#include "sna_cpuid.h" #define xgetbv(index,eax,edx) \ __asm__ ("xgetbv" : "=a"(eax), "=d"(edx) : "c" (index)) @@ -46,7 +39,7 @@ unsigned sna_cpu_detect(void) { - unsigned max = __get_cpuid_max(false, 0); + unsigned max = __get_cpuid_max(BASIC_CPUID, NULL); unsigned int eax, ebx, ecx, edx; unsigned features = 0; unsigned extra = 0; @@ -94,15 +87,6 @@ unsigned sna_cpu_detect(void) return features; } -#else - -unsigned sna_cpu_detect(void) -{ - return 0; -} - -#endif - char *sna_cpu_features_to_string(unsigned features, char *line) { char *ret = line; |