diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-08-19 10:14:28 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-08-20 11:09:21 -0400 |
commit | b658911731d41a91b9de5458d6f38d6e1c90a453 (patch) | |
tree | f039819d7b058469315a3cfd4ada7ec9bfd81f61 | |
parent | aaa6ef8aa85f33c6dd593e139b7f7d901bbde0e2 (diff) |
tools headers: Synchronize linux/bits.h with the kernel sources
To pick up the changes in this cset:
95b980d62d52 ("linux/bits.h: make BIT(), GENMASK(), and friends available in assembly")
To address this tools/perf build warning:
Warning: Kernel ABI header at 'tools/include/linux/bits.h' differs from latest version at 'include/linux/bits.h'
diff -u tools/include/linux/bits.h include/linux/bits.h
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-1if3iga5r3di6oyddgxsr225@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/include/linux/bits.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/include/linux/bits.h b/tools/include/linux/bits.h index 2b7b532c1d51..669d69441a62 100644 --- a/tools/include/linux/bits.h +++ b/tools/include/linux/bits.h | |||
@@ -1,13 +1,15 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | #ifndef __LINUX_BITS_H | 2 | #ifndef __LINUX_BITS_H |
3 | #define __LINUX_BITS_H | 3 | #define __LINUX_BITS_H |
4 | |||
5 | #include <linux/const.h> | ||
4 | #include <asm/bitsperlong.h> | 6 | #include <asm/bitsperlong.h> |
5 | 7 | ||
6 | #define BIT(nr) (1UL << (nr)) | 8 | #define BIT(nr) (UL(1) << (nr)) |
7 | #define BIT_ULL(nr) (1ULL << (nr)) | 9 | #define BIT_ULL(nr) (ULL(1) << (nr)) |
8 | #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) | 10 | #define BIT_MASK(nr) (UL(1) << ((nr) % BITS_PER_LONG)) |
9 | #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) | 11 | #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) |
10 | #define BIT_ULL_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG)) | 12 | #define BIT_ULL_MASK(nr) (ULL(1) << ((nr) % BITS_PER_LONG_LONG)) |
11 | #define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG) | 13 | #define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG) |
12 | #define BITS_PER_BYTE 8 | 14 | #define BITS_PER_BYTE 8 |
13 | 15 | ||
@@ -17,10 +19,11 @@ | |||
17 | * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000. | 19 | * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000. |
18 | */ | 20 | */ |
19 | #define GENMASK(h, l) \ | 21 | #define GENMASK(h, l) \ |
20 | (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) | 22 | (((~UL(0)) - (UL(1) << (l)) + 1) & \ |
23 | (~UL(0) >> (BITS_PER_LONG - 1 - (h)))) | ||
21 | 24 | ||
22 | #define GENMASK_ULL(h, l) \ | 25 | #define GENMASK_ULL(h, l) \ |
23 | (((~0ULL) - (1ULL << (l)) + 1) & \ | 26 | (((~ULL(0)) - (ULL(1) << (l)) + 1) & \ |
24 | (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h)))) | 27 | (~ULL(0) >> (BITS_PER_LONG_LONG - 1 - (h)))) |
25 | 28 | ||
26 | #endif /* __LINUX_BITS_H */ | 29 | #endif /* __LINUX_BITS_H */ |