From 0fd0401fb0df4e05db2451870592eef2b147fb6d Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Wed, 2 May 2007 19:27:20 +0200 Subject: [PATCH] --- yaml --- r: 53931 b: refs/heads/master c: 3671df8572a299acff9c9cac2bf7279ee614d154 h: refs/heads/master i: 53929: f09b37de96664a5d82f3820631218f70fca21972 53927: 8c9a1e0d951d40c9fa510f708bfbda5555dca207 v: v3 --- [refs] | 2 +- trunk/include/asm-i386/cpufeature.h | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 6eef2563aa35..2b4a0e09df50 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c7f81c9453375d6416658995eafd3397cb9bba1d +refs/heads/master: 3671df8572a299acff9c9cac2bf7279ee614d154 diff --git a/trunk/include/asm-i386/cpufeature.h b/trunk/include/asm-i386/cpufeature.h index e66d004aa651..20e849ae6ddc 100644 --- a/trunk/include/asm-i386/cpufeature.h +++ b/trunk/include/asm-i386/cpufeature.h @@ -106,8 +106,12 @@ #define X86_FEATURE_LAHF_LM (6*32+ 0) /* LAHF/SAHF in long mode */ #define X86_FEATURE_CMP_LEGACY (6*32+ 1) /* If yes HyperThreading not valid */ -#define cpu_has(c, bit) test_bit(bit, (c)->x86_capability) -#define boot_cpu_has(bit) test_bit(bit, boot_cpu_data.x86_capability) +#define cpu_has(c, bit) \ + ((__builtin_constant_p(bit) && (bit) < 32 && \ + (1UL << (bit)) & REQUIRED_MASK1) ? \ + 1 : \ + test_bit(bit, (c)->x86_capability)) +#define boot_cpu_has(bit) cpu_has(&boot_cpu_data, bit) #define cpu_has_fpu boot_cpu_has(X86_FEATURE_FPU) #define cpu_has_vme boot_cpu_has(X86_FEATURE_VME)