From e8be15197f32d93787baa7ec58adcf54bcf75e84 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Sun, 26 Mar 2006 01:39:42 -0800 Subject: [PATCH] --- yaml --- r: 24193 b: refs/heads/master c: f33e2fbacce8008984db99c45120db31081577c5 h: refs/heads/master i: 24191: ab7fad164301b72b9de80dd006fedf96d3e7df5c v: v3 --- [refs] | 2 +- trunk/arch/x86_64/Kconfig | 4 +++ trunk/include/asm-x86_64/bitops.h | 42 +++++-------------------------- 3 files changed, 11 insertions(+), 37 deletions(-) diff --git a/[refs] b/[refs] index c2368a2bf226..acf442c08b5d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a58259cddf9f824af27abf8960ed604bee53f7c1 +refs/heads/master: f33e2fbacce8008984db99c45120db31081577c5 diff --git a/trunk/arch/x86_64/Kconfig b/trunk/arch/x86_64/Kconfig index 6420baeb8c1f..45efe0ca88f8 100644 --- a/trunk/arch/x86_64/Kconfig +++ b/trunk/arch/x86_64/Kconfig @@ -45,6 +45,10 @@ config RWSEM_GENERIC_SPINLOCK config RWSEM_XCHGADD_ALGORITHM bool +config GENERIC_HWEIGHT + bool + default y + config GENERIC_CALIBRATE_DELAY bool default y diff --git a/trunk/include/asm-x86_64/bitops.h b/trunk/include/asm-x86_64/bitops.h index eb4df23e1e41..79212128d0f7 100644 --- a/trunk/include/asm-x86_64/bitops.h +++ b/trunk/include/asm-x86_64/bitops.h @@ -356,14 +356,7 @@ static __inline__ unsigned long __fls(unsigned long word) #ifdef __KERNEL__ -static inline int sched_find_first_bit(const unsigned long *b) -{ - if (b[0]) - return __ffs(b[0]); - if (b[1]) - return __ffs(b[1]) + 64; - return __ffs(b[2]) + 128; -} +#include /** * ffs - find first bit set @@ -412,43 +405,20 @@ static __inline__ int fls(int x) return r+1; } -/** - * hweightN - returns the hamming weight of a N-bit word - * @x: the word to weigh - * - * The Hamming Weight of a number is the total number of bits set in it. - */ - -#define hweight64(x) generic_hweight64(x) -#define hweight32(x) generic_hweight32(x) -#define hweight16(x) generic_hweight16(x) -#define hweight8(x) generic_hweight8(x) +#include #endif /* __KERNEL__ */ #ifdef __KERNEL__ -#define ext2_set_bit(nr,addr) \ - __test_and_set_bit((nr),(unsigned long*)addr) +#include + #define ext2_set_bit_atomic(lock,nr,addr) \ test_and_set_bit((nr),(unsigned long*)addr) -#define ext2_clear_bit(nr, addr) \ - __test_and_clear_bit((nr),(unsigned long*)addr) #define ext2_clear_bit_atomic(lock,nr,addr) \ test_and_clear_bit((nr),(unsigned long*)addr) -#define ext2_test_bit(nr, addr) test_bit((nr),(unsigned long*)addr) -#define ext2_find_first_zero_bit(addr, size) \ - find_first_zero_bit((unsigned long*)addr, size) -#define ext2_find_next_zero_bit(addr, size, off) \ - find_next_zero_bit((unsigned long*)addr, size, off) - -/* Bitmap functions for the minix filesystem. */ -#define minix_test_and_set_bit(nr,addr) __test_and_set_bit(nr,(void*)addr) -#define minix_set_bit(nr,addr) __set_bit(nr,(void*)addr) -#define minix_test_and_clear_bit(nr,addr) __test_and_clear_bit(nr,(void*)addr) -#define minix_test_bit(nr,addr) test_bit(nr,(void*)addr) -#define minix_find_first_zero_bit(addr,size) \ - find_first_zero_bit((void*)addr,size) + +#include #endif /* __KERNEL__ */