const.h 644 B

123456789101112131415161718192021222324252627
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * const.h: Macros for dealing with constants.
  4. */
  5. #ifndef _LINUX_CONST_H
  6. #define _LINUX_CONST_H
  7. /* Some constant macros are used in both assembler and
  8. * C code. Therefore we cannot annotate them always with
  9. * 'UL' and other type specifiers unilaterally. We
  10. * use the following macros to deal with this.
  11. *
  12. * Similarly, _AT() will cast an expression with a type in C, but
  13. * leave it unchanged in asm.
  14. */
  15. #ifdef __ASSEMBLY__
  16. #define _AT(T,X) X
  17. #else
  18. #define _AT(T,X) ((T)(X))
  19. #endif
  20. #define _BITUL(x) (_AC(1,UL) << (x))
  21. #define _BITULL(x) (_AC(1,ULL) << (x))
  22. #endif /* !(_LINUX_CONST_H) */