From: Kenn H. <ke...@us...> - 2002-06-06 00:06:16
|
Update of /cvsroot/linux-vax/kernel-2.5/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv17366 Modified Files: bitops.h Log Message: Added __ffs() (works like ffz() in that result is undefined if no bit is set in argument - contrast with ffs() which returns -1 if nothing set) Index: bitops.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/include/asm-vax/bitops.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- bitops.h 5 Jun 2002 21:55:04 -0000 1.4 +++ bitops.h 6 Jun 2002 00:06:11 -0000 1.5 @@ -341,6 +341,20 @@ return word; } +/** + * __ffs - find first bit in word. + * @word: The word to search + * + * Undefined if no bit exists, so code should check against 0 first. + */ +static __inline__ unsigned long __ffs(unsigned long word) +{ + __asm__("ffs $0, $32, %1 , %0\n" + :"=ir" (word) + :"ir" (word)); + return word; +} + #ifdef __KERNEL__ /** * ffs - find first bit set |