Arnaldo Carvalho de Melo | bb97070 | 2016-07-12 11:12:18 -0300 | [diff] [blame] | 1 | #ifndef __ASM_GENERIC_BITS_PER_LONG |
| 2 | #define __ASM_GENERIC_BITS_PER_LONG |
| 3 | |
| 4 | #include <uapi/asm-generic/bitsperlong.h> |
| 5 | |
Arnaldo Carvalho de Melo | 2a00f02 | 2016-07-13 15:04:04 -0300 | [diff] [blame] | 6 | #ifdef __SIZEOF_LONG__ |
Peter Zijlstra | e81fcd4 | 2016-07-15 12:38:18 -0300 | [diff] [blame] | 7 | #define BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__) |
Arnaldo Carvalho de Melo | 2a00f02 | 2016-07-13 15:04:04 -0300 | [diff] [blame] | 8 | #else |
Peter Zijlstra | e81fcd4 | 2016-07-15 12:38:18 -0300 | [diff] [blame] | 9 | #define BITS_PER_LONG __WORDSIZE |
Arnaldo Carvalho de Melo | 2a00f02 | 2016-07-13 15:04:04 -0300 | [diff] [blame] | 10 | #endif |
Arnaldo Carvalho de Melo | bb97070 | 2016-07-12 11:12:18 -0300 | [diff] [blame] | 11 | |
Arnaldo Carvalho de Melo | 2a00f02 | 2016-07-13 15:04:04 -0300 | [diff] [blame] | 12 | #if BITS_PER_LONG != __BITS_PER_LONG |
Arnaldo Carvalho de Melo | bb97070 | 2016-07-12 11:12:18 -0300 | [diff] [blame] | 13 | #error Inconsistent word size. Check asm/bitsperlong.h |
| 14 | #endif |
| 15 | |
| 16 | #ifndef BITS_PER_LONG_LONG |
| 17 | #define BITS_PER_LONG_LONG 64 |
| 18 | #endif |
| 19 | |
| 20 | #endif /* __ASM_GENERIC_BITS_PER_LONG */ |