aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bitops.h
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-12-21 22:30:53 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-01-03 16:11:06 -0500
commit3821af2fe13700cab6fd67367128fa180e43f8b8 (patch)
treea70f63c24bd7d2ac8b25e3e4ee0ef6a50847aa67 /include/linux/bitops.h
parentc865e5d99e25a171e8262fc0f7ba608568633c64 (diff)
[FLS64]: generic version
Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/bitops.h')
-rw-r--r--include/linux/bitops.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 38c2fb7ebe09..6a2a19f14bb2 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -76,6 +76,15 @@ static __inline__ int generic_fls(int x)
76 */ 76 */
77#include <asm/bitops.h> 77#include <asm/bitops.h>
78 78
79
80static inline int generic_fls64(__u64 x)
81{
82 __u32 h = x >> 32;
83 if (h)
84 return fls(x) + 32;
85 return fls(x);
86}
87
79static __inline__ int get_bitmask_order(unsigned int count) 88static __inline__ int get_bitmask_order(unsigned int count)
80{ 89{
81 int order; 90 int order;