const.h 673 B

123456789101112131415161718192021222324252627
  1. /* const.h: Macros for dealing with constants. */
  2. #ifndef _LINUX_CONST_H
  3. #define _LINUX_CONST_H
  4. /* Some constant macros are used in both assembler and
  5. * C code. Therefore we cannot annotate them always with
  6. * 'UL' and other type specifiers unilaterally. We
  7. * use the following macros to deal with this.
  8. *
  9. * Similarly, _AT() will cast an expression with a type in C, but
  10. * leave it unchanged in asm.
  11. */
  12. #ifdef __ASSEMBLY__
  13. #define _AC(X,Y) X
  14. #define _AT(T,X) X
  15. #else
  16. #define __AC(X,Y) (X##Y)
  17. #define _AC(X,Y) __AC(X,Y)
  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) */