Commit e465b535ce5b2318798c68e1454917204494bfe3

Authored by Ingo Molnar

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/lin…

…ux-2.6-cpumask into cpus4096-v2

Showing 6 changed files Side-by-side Diff

arch/cris/include/asm/bitops.h
... ... @@ -148,6 +148,7 @@
148 148 #define ffs kernel_ffs
149 149  
150 150 #include <asm-generic/bitops/fls.h>
  151 +#include <asm-generic/bitops/__fls.h>
151 152 #include <asm-generic/bitops/fls64.h>
152 153 #include <asm-generic/bitops/hweight.h>
153 154 #include <asm-generic/bitops/find.h>
arch/h8300/include/asm/bitops.h
... ... @@ -207,6 +207,7 @@
207 207 #endif /* __KERNEL__ */
208 208  
209 209 #include <asm-generic/bitops/fls.h>
  210 +#include <asm-generic/bitops/__fls.h>
210 211 #include <asm-generic/bitops/fls64.h>
211 212  
212 213 #endif /* _H8300_BITOPS_H */
include/asm-frv/bitops.h
... ... @@ -339,6 +339,19 @@
339 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 + */
  348 +static 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 356 * special slimline version of fls() for calculating ilog2_u32()
344 357 * - note: no protection against n == 0
include/asm-m32r/bitops.h
... ... @@ -251,6 +251,7 @@
251 251 #include <asm-generic/bitops/ffz.h>
252 252 #include <asm-generic/bitops/__ffs.h>
253 253 #include <asm-generic/bitops/fls.h>
  254 +#include <asm-generic/bitops/__fls.h>
254 255 #include <asm-generic/bitops/fls64.h>
255 256  
256 257 #ifdef __KERNEL__
include/asm-mn10300/bitops.h
... ... @@ -196,6 +196,17 @@
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 + */
  204 +static inline unsigned long __fls(unsigned long word)
  205 +{
  206 + return __ilog2_u32(word);
  207 +}
  208 +
  209 +/**
199 210 * ffs - find first bit set
200 211 * @x: the word to search
201 212 *
include/asm-xtensa/bitops.h
... ... @@ -82,6 +82,16 @@
82 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 + */
  91 +static inline unsigned long __fls(unsigned long word)
  92 +{
  93 + return 31 - __cntlz(word);
  94 +}
85 95 #else
86 96  
87 97 /* Use the generic implementation if we don't have the nsa/nsau instructions. */
... ... @@ -90,6 +100,7 @@
90 100 # include <asm-generic/bitops/__ffs.h>
91 101 # include <asm-generic/bitops/ffz.h>
92 102 # include <asm-generic/bitops/fls.h>
  103 +# include <asm-generic/bitops/__fls.h>
93 104  
94 105 #endif
95 106