tools: Adopt fls_long and deps
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 16 Dec 2014 14:26:35 +0000 (11:26 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 17 Dec 2014 14:58:08 +0000 (11:58 -0300)
Will be used when adopting rounddown_pow_of_two.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-9m0tt5300q1ygv51hejjas82@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/include/asm-generic/bitops.h
tools/include/asm-generic/bitops/__fls.h [new file with mode: 0644]
tools/include/asm-generic/bitops/fls.h [new file with mode: 0644]
tools/include/asm-generic/bitops/fls64.h [new file with mode: 0644]
tools/include/linux/bitops.h
tools/perf/MANIFEST
tools/perf/Makefile.perf

index 6dfd9d5fd8283ed2abc6e53b868cb6fb85f5848c..6eedba1f773227d5df93bae06d7f3a0fcc1bd648 100644 (file)
@@ -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_
diff --git a/tools/include/asm-generic/bitops/__fls.h b/tools/include/asm-generic/bitops/__fls.h
new file mode 100644 (file)
index 0000000..2218b9a
--- /dev/null
@@ -0,0 +1 @@
+#include <../../../../include/asm-generic/bitops/__fls.h>
diff --git a/tools/include/asm-generic/bitops/fls.h b/tools/include/asm-generic/bitops/fls.h
new file mode 100644 (file)
index 0000000..dbf711a
--- /dev/null
@@ -0,0 +1 @@
+#include <../../../../include/asm-generic/bitops/fls.h>
diff --git a/tools/include/asm-generic/bitops/fls64.h b/tools/include/asm-generic/bitops/fls64.h
new file mode 100644 (file)
index 0000000..980b1f6
--- /dev/null
@@ -0,0 +1 @@
+#include <../../../../include/asm-generic/bitops/fls64.h>
index 5237bc9f6266848c33780f97d3a00175f065264a..26005a15e7e29d34332b88e68a49fe223953913b 100644 (file)
@@ -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
index 7729af9f417a6daacc930a4adf949664a46db254..83e2887f91a39200612290bd0b2b2fbd824e660a 100644 (file)
@@ -8,7 +8,10 @@ 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
@@ -16,6 +19,9 @@ 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
index 28e590eae560b22da22624b978c544abd65d7d4f..67a03a825b3c94bb894f0f557dac3bb520943e65 100644 (file)
@@ -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