Commit e465b535 authored by Ingo Molnar's avatar Ingo Molnar

Merge branch 'master' of...

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-cpumask into cpus4096-v2
parents 7eb19553 5ece5c51
...@@ -148,6 +148,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr) ...@@ -148,6 +148,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
#define ffs kernel_ffs #define ffs kernel_ffs
#include <asm-generic/bitops/fls.h> #include <asm-generic/bitops/fls.h>
#include <asm-generic/bitops/__fls.h>
#include <asm-generic/bitops/fls64.h> #include <asm-generic/bitops/fls64.h>
#include <asm-generic/bitops/hweight.h> #include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/find.h> #include <asm-generic/bitops/find.h>
......
...@@ -207,6 +207,7 @@ static __inline__ unsigned long __ffs(unsigned long word) ...@@ -207,6 +207,7 @@ static __inline__ unsigned long __ffs(unsigned long word)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#include <asm-generic/bitops/fls.h> #include <asm-generic/bitops/fls.h>
#include <asm-generic/bitops/__fls.h>
#include <asm-generic/bitops/fls64.h> #include <asm-generic/bitops/fls64.h>
#endif /* _H8300_BITOPS_H */ #endif /* _H8300_BITOPS_H */
...@@ -339,6 +339,19 @@ int __ffs(unsigned long x) ...@@ -339,6 +339,19 @@ int __ffs(unsigned long x)
return 31 - bit; return 31 - bit;
} }
/**
* __fls - find last (most-significant) set bit in a long word
* @word: the word to search
*
* Undefined if no set bit exists, so code should check against 0 first.
*/
static inline unsigned long __fls(unsigned long word)
{
unsigned long bit;
asm("scan %1,gr0,%0" : "=r"(bit) : "r"(word));
return bit;
}
/* /*
* special slimline version of fls() for calculating ilog2_u32() * special slimline version of fls() for calculating ilog2_u32()
* - note: no protection against n == 0 * - note: no protection against n == 0
......
...@@ -251,6 +251,7 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr) ...@@ -251,6 +251,7 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr)
#include <asm-generic/bitops/ffz.h> #include <asm-generic/bitops/ffz.h>
#include <asm-generic/bitops/__ffs.h> #include <asm-generic/bitops/__ffs.h>
#include <asm-generic/bitops/fls.h> #include <asm-generic/bitops/fls.h>
#include <asm-generic/bitops/__fls.h>
#include <asm-generic/bitops/fls64.h> #include <asm-generic/bitops/fls64.h>
#ifdef __KERNEL__ #ifdef __KERNEL__
......
...@@ -195,6 +195,17 @@ int fls(int x) ...@@ -195,6 +195,17 @@ int fls(int x)
return (x != 0) ? __ilog2_u32(x) + 1 : 0; return (x != 0) ? __ilog2_u32(x) + 1 : 0;
} }
/**
* __fls - find last (most-significant) set bit in a long word
* @word: the word to search
*
* Undefined if no set bit exists, so code should check against 0 first.
*/
static inline unsigned long __fls(unsigned long word)
{
return __ilog2_u32(word);
}
/** /**
* ffs - find first bit set * ffs - find first bit set
* @x: the word to search * @x: the word to search
......
...@@ -82,6 +82,16 @@ static inline int fls (unsigned int x) ...@@ -82,6 +82,16 @@ static inline int fls (unsigned int x)
return 32 - __cntlz(x); return 32 - __cntlz(x);
} }
/**
* __fls - find last (most-significant) set bit in a long word
* @word: the word to search
*
* Undefined if no set bit exists, so code should check against 0 first.
*/
static inline unsigned long __fls(unsigned long word)
{
return 31 - __cntlz(word);
}
#else #else
/* Use the generic implementation if we don't have the nsa/nsau instructions. */ /* 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,6 +100,7 @@ static inline int fls (unsigned int x)
# include <asm-generic/bitops/__ffs.h> # include <asm-generic/bitops/__ffs.h>
# include <asm-generic/bitops/ffz.h> # include <asm-generic/bitops/ffz.h>
# include <asm-generic/bitops/fls.h> # include <asm-generic/bitops/fls.h>
# include <asm-generic/bitops/__fls.h>
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment