diff --git a/[refs] b/[refs] index f2914b0f1cf0..d3fcb16588a7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0999769e6cad9b0e5abb7c513c0c3f16821f0884 +refs/heads/master: ee38e5140bafbf40e1bd25ab917ac8db54a27799 diff --git a/trunk/include/asm-frv/bitops.h b/trunk/include/asm-frv/bitops.h index 39456ba0ec17..287f6f697ce2 100644 --- a/trunk/include/asm-frv/bitops.h +++ b/trunk/include/asm-frv/bitops.h @@ -339,6 +339,19 @@ int __ffs(unsigned long x) 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() * - note: no protection against n == 0