diff options
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/bitops.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h index c7a38f237a5..5c68c5f30fa 100644 --- a/arch/x86/include/asm/bitops.h +++ b/arch/x86/include/asm/bitops.h @@ -315,6 +315,13 @@ static __inline__ int find_next_zero_bit (void * addr, int size, int offset) return (offset + set + res); } +extern __inline__ int __ilog2(unsigned int x) +{ + int lz; + __asm__("bsr %1, %0" : "=r" (lz) : "r" (x) : "cc"); + return lz; +} + /** * ffz - find first zero in word. * @word: The word to search |