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