History

Merge tag 'bitmap-for-6.12' of https://github.com/norov/linux

Pull bitmap updates from Yury Norov: - switch all bitmamp APIs from inline to __always_inline (Brian Norris) The __always_inline series improves on code generation, and now with the latest compiler versions is required to avoid compilation warnings. It spent enough in my backlog, and I'm thankful to Brian Norris for taking over and moving it forward. - introduce GENMASK_U128() macro (Anshuman Khandual) GENMASK_U128() is a prerequisite needed for arm64 development * tag 'bitmap-for-6.12' of https://github.com/norov/linux: lib/test_bits.c: Add tests for GENMASK_U128() uapi: Define GENMASK_U128 nodemask: Switch from inline to __always_inline cpumask: Switch from inline to __always_inline bitmap: Switch from inline to __always_inline find: Switch from inline to __always_inline

Linus Torvalds committed 2 years ago

Commit 9c445752 parents ba33a49 d7bcc378 files · +325 −232Browse files

Showing the changes to include/uapi/linux (2 of 8 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/bits.h +3 −0
  2. include/uapi/linux/const.h +17 −0
include/uapi/linux/bits.h+3−0
@@ -12,4 +12,7 @@ · 11 unmodified lines
12 (((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \12 (((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \
13 (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h))))13 (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h))))
14 14
15#define __GENMASK_U128(h, l) \
16 ((_BIT128((h)) << 1) - (_BIT128(l)))
17
15#endif /* _UAPI_LINUX_BITS_H */18#endif /* _UAPI_LINUX_BITS_H */
include/uapi/linux/const.h+17−0
@@ -28,6 +28,23 @@ · 27 unmodified lines
28#define _BITUL(x) (_UL(1) << (x))28#define _BITUL(x) (_UL(1) << (x))
29#define _BITULL(x) (_ULL(1) << (x))29#define _BITULL(x) (_ULL(1) << (x))
30 30
31#if !defined(__ASSEMBLY__)
32/*
33 * Missing asm support
34 *
35 * __BIT128() would not work in the asm code, as it shifts an
36 * 'unsigned __init128' data type as direct representation of
37 * 128 bit constants is not supported in the gcc compiler, as
38 * they get silently truncated.
39 *
40 * TODO: Please revisit this implementation when gcc compiler
41 * starts representing 128 bit constants directly like long
42 * and unsigned long etc. Subsequently drop the comment for
43 * GENMASK_U128() which would then start supporting asm code.
44 */
45#define _BIT128(x) ((unsigned __int128)(1) << (x))
46#endif
47
31#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1)48#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1)
32#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))49#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
33 50