bits.h 459 B

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