diff options
| author | Robert Richter <robert.richter@amd.com> | 2010-06-04 05:33:10 -0400 |
|---|---|---|
| committer | Robert Richter <robert.richter@amd.com> | 2010-06-04 05:33:10 -0400 |
| commit | d8a382d2662822248a97ce9d670b90e68aefbd3a (patch) | |
| tree | 4f5bbd5d0a5881ed42de611402ea4ac2c6d6ff48 /tools/perf/util/include/linux/bitops.h | |
| parent | 45c34e05c4e3d36e7c44e790241ea11a1d90d54e (diff) | |
| parent | c6df8d5ab87a246942d138321e1721edbb69f6e1 (diff) | |
Merge remote branch 'tip/perf/urgent' into oprofile/urgent
Diffstat (limited to 'tools/perf/util/include/linux/bitops.h')
| -rw-r--r-- | tools/perf/util/include/linux/bitops.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/tools/perf/util/include/linux/bitops.h b/tools/perf/util/include/linux/bitops.h index 8d63116e9435..bb4ac2e05385 100644 --- a/tools/perf/util/include/linux/bitops.h +++ b/tools/perf/util/include/linux/bitops.h | |||
| @@ -1,13 +1,12 @@ | |||
| 1 | #ifndef _PERF_LINUX_BITOPS_H_ | 1 | #ifndef _PERF_LINUX_BITOPS_H_ |
| 2 | #define _PERF_LINUX_BITOPS_H_ | 2 | #define _PERF_LINUX_BITOPS_H_ |
| 3 | 3 | ||
| 4 | #define __KERNEL__ | 4 | #include <linux/kernel.h> |
| 5 | #include <asm/hweight.h> | ||
| 5 | 6 | ||
| 6 | #define CONFIG_GENERIC_FIND_NEXT_BIT | 7 | #define BITS_PER_LONG __WORDSIZE |
| 7 | #define CONFIG_GENERIC_FIND_FIRST_BIT | 8 | #define BITS_PER_BYTE 8 |
| 8 | #include "../../../../include/linux/bitops.h" | 9 | #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) |
| 9 | |||
| 10 | #undef __KERNEL__ | ||
| 11 | 10 | ||
| 12 | static inline void set_bit(int nr, unsigned long *addr) | 11 | static inline void set_bit(int nr, unsigned long *addr) |
| 13 | { | 12 | { |
| @@ -20,10 +19,9 @@ static __always_inline int test_bit(unsigned int nr, const unsigned long *addr) | |||
| 20 | (((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0; | 19 | (((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0; |
| 21 | } | 20 | } |
| 22 | 21 | ||
| 23 | unsigned long generic_find_next_zero_le_bit(const unsigned long *addr, unsigned | 22 | static inline unsigned long hweight_long(unsigned long w) |
| 24 | long size, unsigned long offset); | 23 | { |
| 25 | 24 | return sizeof(w) == 4 ? hweight32(w) : hweight64(w); | |
| 26 | unsigned long generic_find_next_le_bit(const unsigned long *addr, unsigned | 25 | } |
| 27 | long size, unsigned long offset); | ||
| 28 | 26 | ||
| 29 | #endif | 27 | #endif |
