bitsperlong.h 864 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef __ASM_GENERIC_BITS_PER_LONG
  2. #define __ASM_GENERIC_BITS_PER_LONG
  3. #include <uapi/asm-generic/bitsperlong.h>
  4. /*
  5. * In the kernel, where this file comes from, we can rely on CONFIG_64BIT,
  6. * here we have to make amends with what the various compilers provides us
  7. * to figure out if we're on a 64-bit machine...
  8. */
  9. #ifdef __SIZEOF_LONG__
  10. # if __SIZEOF_LONG__ == 8
  11. # define CONFIG_64BIT
  12. # endif
  13. #else
  14. # ifdef __WORDSIZE
  15. # if __WORDSIZE == 64
  16. # define CONFIG_64BIT
  17. # endif
  18. # else
  19. # error Failed to determine BITS_PER_LONG value
  20. # endif
  21. #endif
  22. #ifdef CONFIG_64BIT
  23. #define BITS_PER_LONG 64
  24. #else
  25. #define BITS_PER_LONG 32
  26. #endif /* CONFIG_64BIT */
  27. #if BITS_PER_LONG != __BITS_PER_LONG
  28. #error Inconsistent word size. Check asm/bitsperlong.h
  29. #endif
  30. #ifndef BITS_PER_LONG_LONG
  31. #define BITS_PER_LONG_LONG 64
  32. #endif
  33. #endif /* __ASM_GENERIC_BITS_PER_LONG */