aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-03 12:54:51 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-03 12:54:51 -0500
commite465b535ce5b2318798c68e1454917204494bfe3 (patch)
tree7cd7af9813a1fe2bfb04f9edd149e0f152b6cb1d /include
parent7eb19553369c46cc1fa64caf120cbcab1b597f7c (diff)
parent5ece5c5192d065c229da01e7b347c1d3877b59fa (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-cpumask into cpus4096-v2
Diffstat (limited to 'include')
-rw-r--r--include/asm-frv/bitops.h13
-rw-r--r--include/asm-m32r/bitops.h1
-rw-r--r--include/asm-mn10300/bitops.h11
-rw-r--r--include/asm-xtensa/bitops.h11
4 files changed, 36 insertions, 0 deletions
diff --git a/include/asm-frv/bitops.h b/include/asm-frv/bitops.h
index 39456ba0ec1..287f6f697ce 100644
--- a/include/asm-frv/bitops.h
+++ b/include/asm-frv/bitops.h
@@ -339,6 +339,19 @@ int __ffs(unsigned long x)
339 return 31 - bit; 339 return 31 - bit;
340} 340}
341 341
342/**
343 * __fls - find last (most-significant) set bit in a long word
344 * @word: the word to search
345 *
346 * Undefined if no set bit exists, so code should check against 0 first.
347 */
348static inline unsigned long __fls(unsigned long word)
349{
350 unsigned long bit;
351 asm("scan %1,gr0,%0" : "=r"(bit) : "r"(word));
352 return bit;
353}
354
342/* 355/*
343 * special slimline version of fls() for calculating ilog2_u32() 356 * special slimline version of fls() for calculating ilog2_u32()
344 * - note: no protection against n == 0 357 * - note: no protection against n == 0
diff --git a/include/asm-m32r/bitops.h b/include/asm-m32r/bitops.h
index 6dc9b81bf9f..aaddf0d5760 100644
--- a/include/asm-m32r/bitops.h
+++ b/include/asm-m32r/bitops.h
@@ -251,6 +251,7 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr)
251#include <asm-generic/bitops/ffz.h> 251#include <asm-generic/bitops/ffz.h>
252#include <asm-generic/bitops/__ffs.h> 252#include <asm-generic/bitops/__ffs.h>
253#include <asm-generic/bitops/fls.h> 253#include <asm-generic/bitops/fls.h>
254#include <asm-generic/bitops/__fls.h>
254#include <asm-generic/bitops/fls64.h> 255#include <asm-generic/bitops/fls64.h>
255 256
256#ifdef __KERNEL__ 257#ifdef __KERNEL__
diff --git a/include/asm-mn10300/bitops.h b/include/asm-mn10300/bitops.h
index cc6d40c05cf..0b610f482ab 100644
--- a/include/asm-mn10300/bitops.h
+++ b/include/asm-mn10300/bitops.h
@@ -196,6 +196,17 @@ int fls(int x)
196} 196}
197 197
198/** 198/**
199 * __fls - find last (most-significant) set bit in a long word
200 * @word: the word to search
201 *
202 * Undefined if no set bit exists, so code should check against 0 first.
203 */
204static inline unsigned long __fls(unsigned long word)
205{
206 return __ilog2_u32(word);
207}
208
209/**
199 * ffs - find first bit set 210 * ffs - find first bit set
200 * @x: the word to search 211 * @x: the word to search
201 * 212 *
diff --git a/include/asm-xtensa/bitops.h b/include/asm-xtensa/bitops.h
index 23261e8f2e5..6c3930397bd 100644
--- a/include/asm-xtensa/bitops.h
+++ b/include/asm-xtensa/bitops.h
@@ -82,6 +82,16 @@ static inline int fls (unsigned int x)
82 return 32 - __cntlz(x); 82 return 32 - __cntlz(x);
83} 83}
84 84
85/**
86 * __fls - find last (most-significant) set bit in a long word
87 * @word: the word to search
88 *
89 * Undefined if no set bit exists, so code should check against 0 first.
90 */
91static inline unsigned long __fls(unsigned long word)
92{
93 return 31 - __cntlz(word);
94}
85#else 95#else
86 96
87/* Use the generic implementation if we don't have the nsa/nsau instructions. */ 97/* Use the generic implementation if we don't have the nsa/nsau instructions. */
@@ -90,6 +100,7 @@ static inline int fls (unsigned int x)
90# include <asm-generic/bitops/__ffs.h> 100# include <asm-generic/bitops/__ffs.h>
91# include <asm-generic/bitops/ffz.h> 101# include <asm-generic/bitops/ffz.h>
92# include <asm-generic/bitops/fls.h> 102# include <asm-generic/bitops/fls.h>
103# include <asm-generic/bitops/__fls.h>
93 104
94#endif 105#endif
95 106