bitsperlong.h 1023 B

123456789101112131415161718192021222324252627
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef __ASM_GENERIC_BITS_PER_LONG
  3. #define __ASM_GENERIC_BITS_PER_LONG
  4. #ifndef __BITS_PER_LONG
  5. /*
  6. * In order to keep safe and avoid regression, only unify uapi
  7. * bitsperlong.h for some archs which are using newer toolchains
  8. * that have the definitions of __CHAR_BIT__ and __SIZEOF_LONG__.
  9. * See the following link for more info:
  10. * https://lore.kernel.org/linux-arch/b9624545-2c80-49a1-ac3c-39264a591f7b@app.fastmail.com/
  11. */
  12. #if defined(__CHAR_BIT__) && defined(__SIZEOF_LONG__)
  13. #define __BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__)
  14. #else
  15. /*
  16. * There seems to be no way of detecting this automatically from user
  17. * space, so 64 bit architectures should override this in their
  18. * bitsperlong.h. In particular, an architecture that supports
  19. * both 32 and 64 bit user space must not rely on CONFIG_64BIT
  20. * to decide it, but rather check a compiler provided macro.
  21. */
  22. #define __BITS_PER_LONG 32
  23. #endif
  24. #endif
  25. #endif /* __ASM_GENERIC_BITS_PER_LONG */