Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools headers: Sync linux/bits.h with the kernel source

To pick up the changes in this cset:

104ea1c84b91c9f4 bits: unify the non-asm GENMASK*()
6d4471252ccc1722 bits: split the definition of the asm and non-asm GENMASK*()

This addresses these perf build warnings:

Warning: Kernel ABI header differences:
diff -u tools/include/linux/bits.h include/linux/bits.h

Please see tools/include/uapi/README for further details.

Cc: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

+6 -23
+6 -23
tools/include/linux/bits.h
··· 2 2 #ifndef __LINUX_BITS_H 3 3 #define __LINUX_BITS_H 4 4 5 - #include <linux/const.h> 6 5 #include <vdso/bits.h> 7 6 #include <uapi/linux/bits.h> 8 - #include <asm/bitsperlong.h> 9 7 10 8 #define BIT_MASK(nr) (UL(1) << ((nr) % BITS_PER_LONG)) 11 9 #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) ··· 48 50 (type_max(t) << (l) & \ 49 51 type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h))))) 50 52 53 + #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l) 54 + #define GENMASK_ULL(h, l) GENMASK_TYPE(unsigned long long, h, l) 55 + 51 56 #define GENMASK_U8(h, l) GENMASK_TYPE(u8, h, l) 52 57 #define GENMASK_U16(h, l) GENMASK_TYPE(u16, h, l) 53 58 #define GENMASK_U32(h, l) GENMASK_TYPE(u32, h, l) 54 59 #define GENMASK_U64(h, l) GENMASK_TYPE(u64, h, l) 60 + #define GENMASK_U128(h, l) GENMASK_TYPE(u128, h, l) 55 61 56 62 /* 57 63 * Fixed-type variants of BIT(), with additional checks like GENMASK_TYPE(). The ··· 81 79 * BUILD_BUG_ON_ZERO is not available in h files included from asm files, 82 80 * disable the input check if that is the case. 83 81 */ 84 - #define GENMASK_INPUT_CHECK(h, l) 0 82 + #define GENMASK(h, l) __GENMASK(h, l) 83 + #define GENMASK_ULL(h, l) __GENMASK_ULL(h, l) 85 84 86 85 #endif /* !defined(__ASSEMBLY__) */ 87 - 88 - #define GENMASK(h, l) \ 89 - (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l)) 90 - #define GENMASK_ULL(h, l) \ 91 - (GENMASK_INPUT_CHECK(h, l) + __GENMASK_ULL(h, l)) 92 - 93 - #if !defined(__ASSEMBLY__) 94 - /* 95 - * Missing asm support 96 - * 97 - * __GENMASK_U128() depends on _BIT128() which would not work 98 - * in the asm code, as it shifts an 'unsigned __int128' data 99 - * type instead of direct representation of 128 bit constants 100 - * such as long and unsigned long. The fundamental problem is 101 - * that a 128 bit constant will get silently truncated by the 102 - * gcc compiler. 103 - */ 104 - #define GENMASK_U128(h, l) \ 105 - (GENMASK_INPUT_CHECK(h, l) + __GENMASK_U128(h, l)) 106 - #endif 107 86 108 87 #endif /* __LINUX_BITS_H */