aboutsummaryrefslogtreecommitdiffstats
path: root/com32/gplinclude
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-11-14 13:09:48 -0800
committerH. Peter Anvin <hpa@zytor.com>2010-11-14 13:09:48 -0800
commitdb74cf6c4182f40ecf7fad1f04799d09d82f896d (patch)
tree489451b230b21ffd410107dab91b7037a2e5af4f /com32/gplinclude
parentdd0a971cb6315a5f30c8d378a92f8db9f7ed4eb0 (diff)
downloadsyslinux-db74cf6c4182f40ecf7fad1f04799d09d82f896d.tar.gz
syslinux-db74cf6c4182f40ecf7fad1f04799d09d82f896d.tar.xz
syslinux-db74cf6c4182f40ecf7fad1f04799d09d82f896d.zip
com32: add a centralized bitops header
Add a centralized bitops header <sys/bitops.h> which uses x86 bitops instructions. This is necessary to keep gcc 4.5 from aborting compilation due to the inlined code being larger than the non-inlined version, and well, we should really use the bitops. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/gplinclude')
-rw-r--r--com32/gplinclude/cpuid.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/com32/gplinclude/cpuid.h b/com32/gplinclude/cpuid.h
index bc9df171..53a08085 100644
--- a/com32/gplinclude/cpuid.h
+++ b/com32/gplinclude/cpuid.h
@@ -19,6 +19,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <cpufeature.h>
+#include <sys/bitops.h>
#include <sys/cpu.h>
#include <klibc/compiler.h>
@@ -173,11 +174,6 @@ typedef struct {
#define X86_VENDOR_NUM 9
#define X86_VENDOR_UNKNOWN 0xff
-static inline __purefunc bool test_bit(int nr, const uint32_t * addr)
-{
- return ((1UL << (nr & 31)) & (addr[nr >> 5])) != 0;
-}
-
#define cpu_has(c, bit) test_bit(bit, (c)->x86_capability)
/*