1*c31ae4bbSArnd Bergmann #ifndef __ASM_GENERIC_BITS_PER_LONG
2*c31ae4bbSArnd Bergmann #define __ASM_GENERIC_BITS_PER_LONG
3*c31ae4bbSArnd Bergmann 
4*c31ae4bbSArnd Bergmann /*
5*c31ae4bbSArnd Bergmann  * There seems to be no way of detecting this automatically from user
6*c31ae4bbSArnd Bergmann  * space, so 64 bit architectures should override this in their
7*c31ae4bbSArnd Bergmann  * bitsperlong.h. In particular, an architecture that supports
8*c31ae4bbSArnd Bergmann  * both 32 and 64 bit user space must not rely on CONFIG_64BIT
9*c31ae4bbSArnd Bergmann  * to decide it, but rather check a compiler provided macro.
10*c31ae4bbSArnd Bergmann  */
11*c31ae4bbSArnd Bergmann #ifndef __BITS_PER_LONG
12*c31ae4bbSArnd Bergmann #define __BITS_PER_LONG 32
13*c31ae4bbSArnd Bergmann #endif
14*c31ae4bbSArnd Bergmann 
15*c31ae4bbSArnd Bergmann #ifdef __KERNEL__
16*c31ae4bbSArnd Bergmann 
17*c31ae4bbSArnd Bergmann #ifdef CONFIG_64BIT
18*c31ae4bbSArnd Bergmann #define BITS_PER_LONG 64
19*c31ae4bbSArnd Bergmann #else
20*c31ae4bbSArnd Bergmann #define BITS_PER_LONG 32
21*c31ae4bbSArnd Bergmann #endif /* CONFIG_64BIT */
22*c31ae4bbSArnd Bergmann 
23*c31ae4bbSArnd Bergmann /*
24*c31ae4bbSArnd Bergmann  * FIXME: The check currently breaks x86-64 build, so it's
25*c31ae4bbSArnd Bergmann  * temporarily disabled. Please fix x86-64 and reenable
26*c31ae4bbSArnd Bergmann  */
27*c31ae4bbSArnd Bergmann #if 0 && BITS_PER_LONG != __BITS_PER_LONG
28*c31ae4bbSArnd Bergmann #error Inconsistent word size. Check asm/bitsperlong.h
29*c31ae4bbSArnd Bergmann #endif
30*c31ae4bbSArnd Bergmann 
31*c31ae4bbSArnd Bergmann #endif /* __KERNEL__ */
32*c31ae4bbSArnd Bergmann #endif /* __ASM_GENERIC_BITS_PER_LONG */
33