Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 17946
b: refs/heads/master
c: 636dd2b
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and Linus Torvalds committed Jan 12, 2006
1 parent c66e230 commit 44d6f3d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bd9cb64df1d99c07ea9672661ede6ca3ba5c6579
refs/heads/master: 636dd2b7def5c9c72551b51d4d516a65c269de08
19 changes: 16 additions & 3 deletions trunk/include/asm-x86_64/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,22 @@ static __inline__ int fls64(__u64 x)
return __fls(x) + 1;
}

/**
* fls - find last bit set
* @x: the word to search
*
* This is defined the same way as ffs.
*/
static __inline__ int fls(int x)
{
int r;

__asm__("bsrl %1,%0\n\t"
"cmovzl %2,%0"
: "=&r" (r) : "rm" (x), "rm" (-1));
return r+1;
}

/**
* hweightN - returns the hamming weight of a N-bit word
* @x: the word to weigh
Expand Down Expand Up @@ -434,9 +450,6 @@ static __inline__ int fls64(__u64 x)
#define minix_find_first_zero_bit(addr,size) \
find_first_zero_bit((void*)addr,size)

/* find last set bit */
#define fls(x) generic_fls(x)

#endif /* __KERNEL__ */

#endif /* _X86_64_BITOPS_H */

0 comments on commit 44d6f3d

Please sign in to comment.