Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / include / uapi / linux / bits.h
blob5ee30f882736cbd1bc7b3c1e5236858db44015d7
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /* bits.h: Macros for dealing with bitmasks. */
4 #ifndef _UAPI_LINUX_BITS_H
5 #define _UAPI_LINUX_BITS_H
7 #define __GENMASK(h, l) \
8 (((~_UL(0)) - (_UL(1) << (l)) + 1) & \
9 (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
11 #define __GENMASK_ULL(h, l) \
12 (((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \
13 (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h))))
15 #define __GENMASK_U128(h, l) \
16 ((_BIT128((h)) << 1) - (_BIT128(l)))
18 #endif /* _UAPI_LINUX_BITS_H */