diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /tools/perf/util/include/linux/bitops.h | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'tools/perf/util/include/linux/bitops.h')
-rw-r--r-- | tools/perf/util/include/linux/bitops.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/perf/util/include/linux/bitops.h b/tools/perf/util/include/linux/bitops.h new file mode 100644 index 000000000000..8d63116e9435 --- /dev/null +++ b/tools/perf/util/include/linux/bitops.h | |||
@@ -0,0 +1,29 @@ | |||
1 | #ifndef _PERF_LINUX_BITOPS_H_ | ||
2 | #define _PERF_LINUX_BITOPS_H_ | ||
3 | |||
4 | #define __KERNEL__ | ||
5 | |||
6 | #define CONFIG_GENERIC_FIND_NEXT_BIT | ||
7 | #define CONFIG_GENERIC_FIND_FIRST_BIT | ||
8 | #include "../../../../include/linux/bitops.h" | ||
9 | |||
10 | #undef __KERNEL__ | ||
11 | |||
12 | static inline void set_bit(int nr, unsigned long *addr) | ||
13 | { | ||
14 | addr[nr / BITS_PER_LONG] |= 1UL << (nr % BITS_PER_LONG); | ||
15 | } | ||
16 | |||
17 | static __always_inline int test_bit(unsigned int nr, const unsigned long *addr) | ||
18 | { | ||
19 | return ((1UL << (nr % BITS_PER_LONG)) & | ||
20 | (((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0; | ||
21 | } | ||
22 | |||
23 | unsigned long generic_find_next_zero_le_bit(const unsigned long *addr, unsigned | ||
24 | long size, unsigned long offset); | ||
25 | |||
26 | unsigned long generic_find_next_le_bit(const unsigned long *addr, unsigned | ||
27 | long size, unsigned long offset); | ||
28 | |||
29 | #endif | ||