Skip to content

Commit

Permalink
tools: Adopt fls_long and deps
Browse files Browse the repository at this point in the history
Will be used when adopting rounddown_pow_of_two.

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]>
  • Loading branch information
acmel committed Dec 17, 2014
1 parent 3967278 commit afcd4f6
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/include/asm-generic/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
*/

#include <asm-generic/bitops/__ffs.h>
#include <asm-generic/bitops/fls.h>
#include <asm-generic/bitops/__fls.h>
#include <asm-generic/bitops/fls64.h>
#include <asm-generic/bitops/find.h>

#ifndef _TOOLS_LINUX_BITOPS_H_
Expand Down
1 change: 1 addition & 0 deletions tools/include/asm-generic/bitops/__fls.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <../../../../include/asm-generic/bitops/__fls.h>
1 change: 1 addition & 0 deletions tools/include/asm-generic/bitops/fls.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <../../../../include/asm-generic/bitops/fls.h>
1 change: 1 addition & 0 deletions tools/include/asm-generic/bitops/fls64.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <../../../../include/asm-generic/bitops/fls64.h>
7 changes: 7 additions & 0 deletions tools/include/linux/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,11 @@ static inline unsigned long hweight_long(unsigned long w)
return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
}

static inline unsigned fls_long(unsigned long l)
{
if (sizeof(l) == 4)
return fls(l);
return fls64(l);
}

#endif
6 changes: 6 additions & 0 deletions tools/perf/MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@ tools/lib/util/find_next_bit.c
tools/include/asm/bug.h
tools/include/asm-generic/bitops/atomic.h
tools/include/asm-generic/bitops/__ffs.h
tools/include/asm-generic/bitops/__fls.h
tools/include/asm-generic/bitops/find.h
tools/include/asm-generic/bitops/fls64.h
tools/include/asm-generic/bitops/fls.h
tools/include/asm-generic/bitops.h
tools/include/linux/bitops.h
tools/include/linux/compiler.h
tools/include/linux/export.h
tools/include/linux/hash.h
tools/include/linux/log2.h
tools/include/linux/types.h
include/asm-generic/bitops/fls64.h
include/asm-generic/bitops/__fls.h
include/asm-generic/bitops/fls.h
include/linux/const.h
include/linux/perf_event.h
include/linux/rbtree.h
Expand Down
3 changes: 3 additions & 0 deletions tools/perf/Makefile.perf
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ LIB_H += util/include/linux/bitmap.h
LIB_H += ../include/linux/bitops.h
LIB_H += ../include/asm-generic/bitops/atomic.h
LIB_H += ../include/asm-generic/bitops/find.h
LIB_H += ../include/asm-generic/bitops/fls64.h
LIB_H += ../include/asm-generic/bitops/fls.h
LIB_H += ../include/asm-generic/bitops/__ffs.h
LIB_H += ../include/asm-generic/bitops/__fls.h
LIB_H += ../include/asm-generic/bitops.h
LIB_H += ../include/linux/compiler.h
LIB_H += ../include/linux/log2.h
Expand Down

0 comments on commit afcd4f6

Please sign in to comment.