Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288663
b: refs/heads/master
c: 850f812
h: refs/heads/master
i:
  288661: 5413efc
  288659: 9f181eb
  288655: 2ba79f1
v: v3
  • Loading branch information
Jiri Olsa authored and Arnaldo Carvalho de Melo committed Feb 14, 2012
1 parent d5e90cc commit 9880970
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e90fda0635401225ca7c2343bea2f6d279347d10
refs/heads/master: 850f8127fa3666737881aecb3b16e8ede85e58f4
10 changes: 10 additions & 0 deletions trunk/tools/perf/util/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ int __bitmap_weight(const unsigned long *bitmap, int bits)

return w;
}

void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
const unsigned long *bitmap2, int bits)
{
int k;
int nr = BITS_TO_LONGS(bits);

for (k = 0; k < nr; k++)
dst[k] = bitmap1[k] | bitmap2[k];
}
11 changes: 11 additions & 0 deletions trunk/tools/perf/util/include/linux/bitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <linux/bitops.h>

int __bitmap_weight(const unsigned long *bitmap, int bits);
void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
const unsigned long *bitmap2, int bits);

#define BITMAP_LAST_WORD_MASK(nbits) \
( \
Expand Down Expand Up @@ -32,4 +34,13 @@ static inline int bitmap_weight(const unsigned long *src, int nbits)
return __bitmap_weight(src, nbits);
}

static inline void bitmap_or(unsigned long *dst, const unsigned long *src1,
const unsigned long *src2, int nbits)
{
if (small_const_nbits(nbits))
*dst = *src1 | *src2;
else
__bitmap_or(dst, src1, src2, nbits);
}

#endif /* _PERF_BITOPS_H */

0 comments on commit 9880970

Please sign in to comment.