Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15557
b: refs/heads/master
c: 3821af2
h: refs/heads/master
i:
  15555: cdaa27e
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Jan 3, 2006
1 parent 77fb98c commit 7f0d9c1
Show file tree
Hide file tree
Showing 25 changed files with 34 additions and 2 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: c865e5d99e25a171e8262fc0f7ba608568633c64
refs/heads/master: 3821af2fe13700cab6fd67367128fa180e43f8b8
1 change: 1 addition & 0 deletions trunk/include/asm-alpha/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-arm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ static inline unsigned long __ffs(unsigned long word)
*/

#define fls(x) generic_fls(x)
#define fls64(x) generic_fls64(x)

/*
* ffs: find first bit set. This is defined the same way as
Expand All @@ -351,6 +352,7 @@ static inline unsigned long __ffs(unsigned long word)
#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) )
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-arm26/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ static inline unsigned long __ffs(unsigned long word)
*/

#define fls(x) generic_fls(x)
#define fls64(x) generic_fls64(x)

/*
* ffs: find first bit set. This is defined the same way as
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-cris/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ static inline int test_bit(int nr, const volatile unsigned long *addr)
*/

#define fls(x) generic_fls(x)
#define fls64(x) generic_fls64(x)

/*
* hweightN - returns the hamming weight of a N-bit word
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-frv/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ static inline int find_next_zero_bit(const void *addr, int size, int offset)
\
bit ? 33 - bit : bit; \
})
#define fls64(x) generic_fls64(x)

/*
* Every architecture must define this function. It's the fastest
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-generic/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ extern __inline__ int test_bit(int nr, const unsigned long * addr)
*/

#define fls(x) generic_fls(x)
#define fls64(x) generic_fls64(x)

#ifdef __KERNEL__

Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-h8300/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,5 +406,6 @@ static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned lon
#endif /* __KERNEL__ */

#define fls(x) generic_fls(x)
#define fls64(x) generic_fls64(x)

#endif /* _H8300_BITOPS_H */
1 change: 1 addition & 0 deletions trunk/include/asm-i386/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ static inline unsigned long ffz(unsigned long word)
*/

#define fls(x) generic_fls(x)
#define fls64(x) generic_fls64(x)

#ifdef __KERNEL__

Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-ia64/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-m32r/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ static __inline__ unsigned long __ffs(unsigned long word)
* fls: find last bit set.
*/
#define fls(x) generic_fls(x)
#define fls64(x) generic_fls64(x)

#ifdef __KERNEL__

Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-m68k/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-m68knommu/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -499,5 +499,6 @@ static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned lon
* fls: find last bit set.
*/
#define fls(x) generic_fls(x)
#define fls64(x) generic_fls64(x)

#endif /* _M68KNOMMU_BITOPS_H */
2 changes: 1 addition & 1 deletion trunk/include/asm-mips/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ static inline unsigned long fls(unsigned long word)

return flz(~word) + 1;
}

#define fls64(x) generic_fls64(x)

/*
* find_next_zero_bit - find the first zero bit in a memory region
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-parisc/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-powerpc/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-s390/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ static inline int sched_find_first_bit(unsigned long *b)
* 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
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-sh/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned lon
*/

#define fls(x) generic_fls(x)
#define fls64(x) generic_fls64(x)

#endif /* __KERNEL__ */

Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-sh64/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned lon

#define ffs(x) generic_ffs(x)
#define fls(x) generic_fls(x)
#define fls64(x) generic_fls64(x)

#endif /* __KERNEL__ */

Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-sparc/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-sparc64/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ static inline unsigned long __ffs(unsigned long word)
*/

#define fls(x) generic_fls(x)
#define fls64(x) generic_fls64(x)

#ifdef __KERNEL__

Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-v850/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ static __inline__ unsigned long find_next_bit(const unsigned long *addr,

#define ffs(x) generic_ffs (x)
#define fls(x) generic_fls (x)
#define fls64(x) generic_fls64(x)
#define __ffs(x) ffs(x)


Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-x86_64/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */

Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-xtensa/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ static __inline__ int fls (unsigned int x)
{
return __cntlz(x);
}
#define fls64(x) generic_fls64(x)

static __inline__ int
find_next_bit(const unsigned long *addr, int size, int offset)
Expand Down
9 changes: 9 additions & 0 deletions trunk/include/linux/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7f0d9c1

Please sign in to comment.