Index: bic-2.6/include/linux/bitops.h
===================================================================
--- bic-2.6.orig/include/linux/bitops.h
+++ bic-2.6/include/linux/bitops.h
@@ -76,6 +76,15 @@ static __inline__ int generic_fls(int x)
  */
 #include <asm/bitops.h>
 
+
+static inline int generic_fls64(__u64 x)
+{
+       __u32 h = x >> 32;
+       if (h)
+               return fls(x) + 32;
+       return fls(x);
+}
+
 static __inline__ int get_bitmask_order(unsigned int count)
 {
        int order;
Index: bic-2.6/include/asm-alpha/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-alpha/bitops.h
+++ bic-2.6/include/asm-alpha/bitops.h
@@ -321,6 +321,7 @@ static inline int fls(int word)
 #else
 #define fls    generic_fls
 #endif
+#define fls64   generic_fls64
 
 /* Compute powers of two for the given integer.  */
 static inline long floor_log2(unsigned long word)
Index: bic-2.6/include/asm-arm/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-arm/bitops.h
+++ bic-2.6/include/asm-arm/bitops.h
@@ -332,6 +332,7 @@ static inline unsigned long __ffs(unsign
  */
 
 #define fls(x) generic_fls(x)
+#define fls64(x)   generic_fls64(x)
 
 /*
  * ffs: find first bit set. This is defined the same way as
@@ -351,6 +352,7 @@ static inline unsigned long __ffs(unsign
 #define fls(x) \
        ( __builtin_constant_p(x) ? generic_fls(x) : \
          ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; 
}) )
+#define fls64(x)   generic_fls64(x)
 #define ffs(x) ({ unsigned long __t = (x); fls(__t & -__t); })
 #define __ffs(x) (ffs(x) - 1)
 #define ffz(x) __ffs( ~(x) )
Index: bic-2.6/include/asm-arm26/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-arm26/bitops.h
+++ bic-2.6/include/asm-arm26/bitops.h
@@ -259,6 +259,7 @@ static inline unsigned long __ffs(unsign
  */
 
 #define fls(x) generic_fls(x)
+#define fls64(x)   generic_fls64(x)
 
 /*
  * ffs: find first bit set. This is defined the same way as
Index: bic-2.6/include/asm-cris/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-cris/bitops.h
+++ bic-2.6/include/asm-cris/bitops.h
@@ -240,6 +240,7 @@ static inline int test_bit(int nr, const
  */
 
 #define fls(x) generic_fls(x)
+#define fls64(x)   generic_fls64(x)
 
 /*
  * hweightN - returns the hamming weight of a N-bit word
Index: bic-2.6/include/asm-frv/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-frv/bitops.h
+++ bic-2.6/include/asm-frv/bitops.h
@@ -228,6 +228,7 @@ found_middle:
                                                        \
        bit ? 33 - bit : bit;                           \
 })
+#define fls64(x)   generic_fls64(x)
 
 /*
  * Every architecture must define this function. It's the fastest
Index: bic-2.6/include/asm-generic/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-generic/bitops.h
+++ bic-2.6/include/asm-generic/bitops.h
@@ -56,6 +56,7 @@ extern __inline__ int test_bit(int nr, c
  */
 
 #define fls(x) generic_fls(x)
+#define fls64(x)   generic_fls64(x)
 
 #ifdef __KERNEL__
 
Index: bic-2.6/include/asm-h8300/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-h8300/bitops.h
+++ bic-2.6/include/asm-h8300/bitops.h
@@ -406,5 +406,6 @@ found_middle:
 #endif /* __KERNEL__ */
 
 #define fls(x) generic_fls(x)
+#define fls64(x)   generic_fls64(x)
 
 #endif /* _H8300_BITOPS_H */
Index: bic-2.6/include/asm-i386/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-i386/bitops.h
+++ bic-2.6/include/asm-i386/bitops.h
@@ -372,6 +372,7 @@ static inline unsigned long ffz(unsigned
  */
 
 #define fls(x) generic_fls(x)
+#define fls64(x)   generic_fls64(x)
 
 #ifdef __KERNEL__
 
Index: bic-2.6/include/asm-ia64/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-ia64/bitops.h
+++ bic-2.6/include/asm-ia64/bitops.h
@@ -345,6 +345,7 @@ fls (int t)
        x |= x >> 16;
        return ia64_popcnt(x);
 }
+#define fls64(x)   generic_fls64(x)
 
 /*
  * ffs: find first bit set. This is defined the same way as the libc and 
compiler builtin
Index: bic-2.6/include/asm-m32r/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-m32r/bitops.h
+++ bic-2.6/include/asm-m32r/bitops.h
@@ -465,6 +465,7 @@ static __inline__ unsigned long __ffs(un
  * fls: find last bit set.
  */
 #define fls(x) generic_fls(x)
+#define fls64(x)   generic_fls64(x)
 
 #ifdef __KERNEL__
 
Index: bic-2.6/include/asm-m68k/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-m68k/bitops.h
+++ bic-2.6/include/asm-m68k/bitops.h
@@ -310,6 +310,7 @@ static inline int fls(int x)
 
        return 32 - cnt;
 }
+#define fls64(x)   generic_fls64(x)
 
 /*
  * Every architecture must define this function. It's the fastest
Index: bic-2.6/include/asm-m68knommu/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-m68knommu/bitops.h
+++ bic-2.6/include/asm-m68knommu/bitops.h
@@ -499,5 +499,6 @@ found_middle:
  * fls: find last bit set.
  */
 #define fls(x) generic_fls(x)
+#define fls64(x)   generic_fls64(x)
 
 #endif /* _M68KNOMMU_BITOPS_H */
Index: bic-2.6/include/asm-mips/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-mips/bitops.h
+++ bic-2.6/include/asm-mips/bitops.h
@@ -695,7 +695,7 @@ static inline unsigned long fls(unsigned
 
        return flz(~word) + 1;
 }
-
+#define fls64(x)   generic_fls64(x)
 
 /*
  * find_next_zero_bit - find the first zero bit in a memory region
Index: bic-2.6/include/asm-parisc/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-parisc/bitops.h
+++ bic-2.6/include/asm-parisc/bitops.h
@@ -263,6 +263,7 @@ static __inline__ int fls(int x)
 
        return ret;
 }
+#define fls64(x)   generic_fls64(x)
 
 /*
  * hweightN: returns the hamming weight (i.e. the number
Index: bic-2.6/include/asm-powerpc/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-powerpc/bitops.h
+++ bic-2.6/include/asm-powerpc/bitops.h
@@ -310,6 +310,7 @@ static __inline__ int fls(unsigned int x
        asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x));
        return 32 - lz;
 }
+#define fls64(x)   generic_fls64(x)
 
 /*
  * hweightN: returns the hamming weight (i.e. the number
Index: bic-2.6/include/asm-s390/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-s390/bitops.h
+++ bic-2.6/include/asm-s390/bitops.h
@@ -839,6 +839,7 @@ static inline int sched_find_first_bit(u
  * fls: find last bit set.
  */
 #define fls(x) generic_fls(x)
+#define fls64(x)   generic_fls64(x)
 
 /*
  * hweightN: returns the hamming weight (i.e. the number
Index: bic-2.6/include/asm-sh/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-sh/bitops.h
+++ bic-2.6/include/asm-sh/bitops.h
@@ -470,6 +470,7 @@ found_middle:
  */
 
 #define fls(x) generic_fls(x)
+#define fls64(x)   generic_fls64(x)
 
 #endif /* __KERNEL__ */
 
Index: bic-2.6/include/asm-sh64/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-sh64/bitops.h
+++ bic-2.6/include/asm-sh64/bitops.h
@@ -510,6 +510,7 @@ found_middle:
 
 #define ffs(x) generic_ffs(x)
 #define fls(x) generic_fls(x)
+#define fls64(x)   generic_fls64(x)
 
 #endif /* __KERNEL__ */
 
Index: bic-2.6/include/asm-sparc/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-sparc/bitops.h
+++ bic-2.6/include/asm-sparc/bitops.h
@@ -298,6 +298,7 @@ static inline int ffs(int x)
  * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
  */
 #define fls(x) generic_fls(x)
+#define fls64(x)   generic_fls64(x)
 
 /*
  * hweightN: returns the hamming weight (i.e. the number
Index: bic-2.6/include/asm-sparc64/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-sparc64/bitops.h
+++ bic-2.6/include/asm-sparc64/bitops.h
@@ -119,6 +119,7 @@ static inline unsigned long __ffs(unsign
  */
 
 #define fls(x) generic_fls(x)
+#define fls64(x)   generic_fls64(x)
 
 #ifdef __KERNEL__
 
Index: bic-2.6/include/asm-v850/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-v850/bitops.h
+++ bic-2.6/include/asm-v850/bitops.h
@@ -276,6 +276,7 @@ found_middle:
 
 #define ffs(x) generic_ffs (x)
 #define fls(x) generic_fls (x)
+#define fls64(x) generic_fls64(x)
 #define __ffs(x) ffs(x)
 
 
Index: bic-2.6/include/asm-x86_64/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-x86_64/bitops.h
+++ bic-2.6/include/asm-x86_64/bitops.h
@@ -409,6 +409,7 @@ static __inline__ int ffs(int x)
 
 /* find last set bit */
 #define fls(x) generic_fls(x)
+#define fls64(x) generic_fls64(x)
 
 #endif /* __KERNEL__ */
 
Index: bic-2.6/include/asm-xtensa/bitops.h
===================================================================
--- bic-2.6.orig/include/asm-xtensa/bitops.h
+++ bic-2.6/include/asm-xtensa/bitops.h
@@ -245,6 +245,7 @@ static __inline__ int fls (unsigned int 
 {
        return __cntlz(x);
 }
+#define fls64(x)   generic_fls64(x)
 
 static __inline__ int
 find_next_bit(const unsigned long *addr, int size, int offset)

--
Stephen Hemminger <[EMAIL PROTECTED]>
OSDL http://developer.osdl.org/~shemminger

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to