diff options
-rw-r--r-- | tools/include/asm-generic/bitsperlong.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/tools/include/asm-generic/bitsperlong.h b/tools/include/asm-generic/bitsperlong.h index d1d70aa19021..cfd661c6fc17 100644 --- a/tools/include/asm-generic/bitsperlong.h +++ b/tools/include/asm-generic/bitsperlong.h | |||
@@ -3,6 +3,24 @@ | |||
3 | 3 | ||
4 | #include <uapi/asm-generic/bitsperlong.h> | 4 | #include <uapi/asm-generic/bitsperlong.h> |
5 | 5 | ||
6 | /* | ||
7 | * In the kernel, where this file comes from, we can rely on CONFIG_64BIT, | ||
8 | * here we have to make amends with what the various compilers provides us | ||
9 | * to figure out if we're on a 64-bit machine... | ||
10 | */ | ||
11 | #ifdef __SIZEOF_LONG__ | ||
12 | # if __SIZEOF_LONG__ == 8 | ||
13 | # define CONFIG_64BIT | ||
14 | # endif | ||
15 | #else | ||
16 | # ifdef __WORDSIZE | ||
17 | # if __WORDSIZE == 64 | ||
18 | # define CONFIG_64BIT | ||
19 | # endif | ||
20 | # else | ||
21 | # error Failed to determine BITS_PER_LONG value | ||
22 | # endif | ||
23 | #endif | ||
6 | 24 | ||
7 | #ifdef CONFIG_64BIT | 25 | #ifdef CONFIG_64BIT |
8 | #define BITS_PER_LONG 64 | 26 | #define BITS_PER_LONG 64 |
@@ -10,11 +28,7 @@ | |||
10 | #define BITS_PER_LONG 32 | 28 | #define BITS_PER_LONG 32 |
11 | #endif /* CONFIG_64BIT */ | 29 | #endif /* CONFIG_64BIT */ |
12 | 30 | ||
13 | /* | 31 | #if BITS_PER_LONG != __BITS_PER_LONG |
14 | * FIXME: The check currently breaks x86-64 build, so it's | ||
15 | * temporarily disabled. Please fix x86-64 and reenable | ||
16 | */ | ||
17 | #if 0 && BITS_PER_LONG != __BITS_PER_LONG | ||
18 | #error Inconsistent word size. Check asm/bitsperlong.h | 32 | #error Inconsistent word size. Check asm/bitsperlong.h |
19 | #endif | 33 | #endif |
20 | 34 | ||