Skip to content

Commit 21a3a3d

Browse files
committed
tools headers: Synchronize {uapi/}linux/bits.h with the kernel sources
To pick up the changes in this cset: 947697c ("uapi: Define GENMASK_U128") This addresses these perf build warnings: Warning: Kernel ABI header differences: diff -u tools/include/uapi/linux/bits.h include/uapi/linux/bits.h diff -u tools/include/linux/bits.h include/linux/bits.h Please see tools/include/uapi/README for further details. Acked-by: Yury Norov <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Anshuman Khandual <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/lkml/Zx-ZVH7bHqtFn8Dv@x1 Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 08a7d25 commit 21a3a3d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tools/include/linux/bits.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,19 @@
3636
#define GENMASK_ULL(h, l) \
3737
(GENMASK_INPUT_CHECK(h, l) + __GENMASK_ULL(h, l))
3838

39+
#if !defined(__ASSEMBLY__)
40+
/*
41+
* Missing asm support
42+
*
43+
* __GENMASK_U128() depends on _BIT128() which would not work
44+
* in the asm code, as it shifts an 'unsigned __init128' data
45+
* type instead of direct representation of 128 bit constants
46+
* such as long and unsigned long. The fundamental problem is
47+
* that a 128 bit constant will get silently truncated by the
48+
* gcc compiler.
49+
*/
50+
#define GENMASK_U128(h, l) \
51+
(GENMASK_INPUT_CHECK(h, l) + __GENMASK_U128(h, l))
52+
#endif
53+
3954
#endif /* __LINUX_BITS_H */

tools/include/uapi/linux/bits.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@
1212
(((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \
1313
(~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h))))
1414

15+
#define __GENMASK_U128(h, l) \
16+
((_BIT128((h)) << 1) - (_BIT128(l)))
17+
1518
#endif /* _UAPI_LINUX_BITS_H */

0 commit comments

Comments
 (0)