diff options
| author | Arnaldo Carvalho de Melo <[email protected]> | 2014-12-15 16:44:26 -0300 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2014-12-17 11:11:52 -0300 |
| commit | cae68d4f6a0a1f8fb7c979f356e994a3c17543c1 (patch) | |
| tree | d262e5c33ff842c4e61a226c9024d9bdd382acb0 /tools/perf/util/include/linux | |
| parent | 0389cd1f5fda34c14941c37a39547d16af5d56e2 (diff) | |
tools: Move code originally from asm-generic/atomic.h into tools/include/asm-generic/
To match the Linux kernel source code structure from where this code came from.
Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/include/linux')
| -rw-r--r-- | tools/perf/util/include/linux/bitops.h | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/tools/perf/util/include/linux/bitops.h b/tools/perf/util/include/linux/bitops.h index 762bb83333c0..71f017dc6230 100644 --- a/tools/perf/util/include/linux/bitops.h +++ b/tools/perf/util/include/linux/bitops.h @@ -29,21 +29,7 @@ (bit) < (size); \ (bit) = find_next_bit((addr), (size), (bit) + 1)) -static inline void set_bit(int nr, unsigned long *addr) -{ - addr[nr / BITS_PER_LONG] |= 1UL << (nr % BITS_PER_LONG); -} - -static inline void clear_bit(int nr, unsigned long *addr) -{ - addr[nr / BITS_PER_LONG] &= ~(1UL << (nr % BITS_PER_LONG)); -} - -static __always_inline int test_bit(unsigned int nr, const unsigned long *addr) -{ - return ((1UL << (nr % BITS_PER_LONG)) & - (((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0; -} +#include <asm-generic/bitops/atomic.h> static inline unsigned long hweight_long(unsigned long w) { |