diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-01-13 08:19:12 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-01-16 15:49:29 -0500 |
commit | 25cd480e447eba47b8bdad1c9f95cadc074abc75 (patch) | |
tree | 36e2194788f9f907eaf7a7afeedf45ae3177d0e0 /tools/include | |
parent | 260d819e3abdbdaa2b88fb983d1314f1b263f9e2 (diff) |
tools: Remove bitops/hweight usage of bits in tools/perf
We need to use lib/hweight.c for that, just like we do for lib/rbtree.c,
so tools need to link hweight.o. For now do it directly, but we need to
have a tools/lib/lk.a or .so that collects these goodies...
Reported-by: Jan Beulich <JBeulich@suse.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-a1e91dx3apzqw5kbdt7ut21s@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/include')
-rw-r--r-- | tools/include/asm-generic/bitops.h | 2 | ||||
-rw-r--r-- | tools/include/asm-generic/bitops/arch_hweight.h | 1 | ||||
-rw-r--r-- | tools/include/asm-generic/bitops/const_hweight.h | 1 | ||||
-rw-r--r-- | tools/include/asm-generic/bitops/hweight.h | 7 | ||||
-rw-r--r-- | tools/include/linux/bitops.h | 7 |
5 files changed, 17 insertions, 1 deletions
diff --git a/tools/include/asm-generic/bitops.h b/tools/include/asm-generic/bitops.h index 6eedba1f7732..653d1bad77de 100644 --- a/tools/include/asm-generic/bitops.h +++ b/tools/include/asm-generic/bitops.h | |||
@@ -22,6 +22,8 @@ | |||
22 | #error only <linux/bitops.h> can be included directly | 22 | #error only <linux/bitops.h> can be included directly |
23 | #endif | 23 | #endif |
24 | 24 | ||
25 | #include <asm-generic/bitops/hweight.h> | ||
26 | |||
25 | #include <asm-generic/bitops/atomic.h> | 27 | #include <asm-generic/bitops/atomic.h> |
26 | 28 | ||
27 | #endif /* __TOOLS_ASM_GENERIC_BITOPS_H */ | 29 | #endif /* __TOOLS_ASM_GENERIC_BITOPS_H */ |
diff --git a/tools/include/asm-generic/bitops/arch_hweight.h b/tools/include/asm-generic/bitops/arch_hweight.h new file mode 100644 index 000000000000..318bb2b202b0 --- /dev/null +++ b/tools/include/asm-generic/bitops/arch_hweight.h | |||
@@ -0,0 +1 @@ | |||
#include "../../../../include/asm-generic/bitops/arch_hweight.h" | |||
diff --git a/tools/include/asm-generic/bitops/const_hweight.h b/tools/include/asm-generic/bitops/const_hweight.h new file mode 100644 index 000000000000..0afd644aff83 --- /dev/null +++ b/tools/include/asm-generic/bitops/const_hweight.h | |||
@@ -0,0 +1 @@ | |||
#include "../../../../include/asm-generic/bitops/const_hweight.h" | |||
diff --git a/tools/include/asm-generic/bitops/hweight.h b/tools/include/asm-generic/bitops/hweight.h new file mode 100644 index 000000000000..290120c01a8e --- /dev/null +++ b/tools/include/asm-generic/bitops/hweight.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #ifndef _TOOLS_LINUX_ASM_GENERIC_BITOPS_HWEIGHT_H_ | ||
2 | #define _TOOLS_LINUX_ASM_GENERIC_BITOPS_HWEIGHT_H_ | ||
3 | |||
4 | #include <asm-generic/bitops/arch_hweight.h> | ||
5 | #include <asm-generic/bitops/const_hweight.h> | ||
6 | |||
7 | #endif /* _TOOLS_LINUX_ASM_GENERIC_BITOPS_HWEIGHT_H_ */ | ||
diff --git a/tools/include/linux/bitops.h b/tools/include/linux/bitops.h index 26005a15e7e2..5ad9ee1dd7f6 100644 --- a/tools/include/linux/bitops.h +++ b/tools/include/linux/bitops.h | |||
@@ -1,9 +1,9 @@ | |||
1 | #ifndef _TOOLS_LINUX_BITOPS_H_ | 1 | #ifndef _TOOLS_LINUX_BITOPS_H_ |
2 | #define _TOOLS_LINUX_BITOPS_H_ | 2 | #define _TOOLS_LINUX_BITOPS_H_ |
3 | 3 | ||
4 | #include <asm/types.h> | ||
4 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
5 | #include <linux/compiler.h> | 6 | #include <linux/compiler.h> |
6 | #include <asm/hweight.h> | ||
7 | 7 | ||
8 | #ifndef __WORDSIZE | 8 | #ifndef __WORDSIZE |
9 | #define __WORDSIZE (__SIZEOF_LONG__ * 8) | 9 | #define __WORDSIZE (__SIZEOF_LONG__ * 8) |
@@ -19,6 +19,11 @@ | |||
19 | #define BITS_TO_U32(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u32)) | 19 | #define BITS_TO_U32(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u32)) |
20 | #define BITS_TO_BYTES(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE) | 20 | #define BITS_TO_BYTES(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE) |
21 | 21 | ||
22 | extern unsigned int __sw_hweight8(unsigned int w); | ||
23 | extern unsigned int __sw_hweight16(unsigned int w); | ||
24 | extern unsigned int __sw_hweight32(unsigned int w); | ||
25 | extern unsigned long __sw_hweight64(__u64 w); | ||
26 | |||
22 | /* | 27 | /* |
23 | * Include this here because some architectures need generic_ffs/fls in | 28 | * Include this here because some architectures need generic_ffs/fls in |
24 | * scope | 29 | * scope |