bits.h 447 B

123456789101112131415
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /* bits.h: Macros for dealing with bitmasks. */
  3. #ifndef _LINUX_BITS_H
  4. #define _LINUX_BITS_H
  5. #define __GENMASK(h, l) \
  6. (((~_UL(0)) - (_UL(1) << (l)) + 1) & \
  7. (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
  8. #define __GENMASK_ULL(h, l) \
  9. (((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \
  10. (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h))))
  11. #endif /* _LINUX_BITS_H */