diff options
Diffstat (limited to 'include/asm-s390/bitops.h')
-rw-r--r-- | include/asm-s390/bitops.h | 48 |
1 files changed, 7 insertions, 41 deletions
diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h index 3628899f48bb..ca092ffb7a95 100644 --- a/include/asm-s390/bitops.h +++ b/include/asm-s390/bitops.h | |||
@@ -828,35 +828,12 @@ static inline int sched_find_first_bit(unsigned long *b) | |||
828 | return find_first_bit(b, 140); | 828 | return find_first_bit(b, 140); |
829 | } | 829 | } |
830 | 830 | ||
831 | /* | 831 | #include <asm-generic/bitops/ffs.h> |
832 | * ffs: find first bit set. This is defined the same way as | ||
833 | * the libc and compiler builtin ffs routines, therefore | ||
834 | * differs in spirit from the above ffz (man ffs). | ||
835 | */ | ||
836 | #define ffs(x) generic_ffs(x) | ||
837 | 832 | ||
838 | /* | 833 | #include <asm-generic/bitops/fls.h> |
839 | * fls: find last bit set. | 834 | #include <asm-generic/bitops/fls64.h> |
840 | */ | ||
841 | #define fls(x) generic_fls(x) | ||
842 | #define fls64(x) generic_fls64(x) | ||
843 | |||
844 | /* | ||
845 | * hweightN: returns the hamming weight (i.e. the number | ||
846 | * of bits set) of a N-bit word | ||
847 | */ | ||
848 | #define hweight64(x) \ | ||
849 | ({ \ | ||
850 | unsigned long __x = (x); \ | ||
851 | unsigned int __w; \ | ||
852 | __w = generic_hweight32((unsigned int) __x); \ | ||
853 | __w += generic_hweight32((unsigned int) (__x>>32)); \ | ||
854 | __w; \ | ||
855 | }) | ||
856 | #define hweight32(x) generic_hweight32(x) | ||
857 | #define hweight16(x) generic_hweight16(x) | ||
858 | #define hweight8(x) generic_hweight8(x) | ||
859 | 835 | ||
836 | #include <asm-generic/bitops/hweight.h> | ||
860 | 837 | ||
861 | #ifdef __KERNEL__ | 838 | #ifdef __KERNEL__ |
862 | 839 | ||
@@ -871,11 +848,11 @@ static inline int sched_find_first_bit(unsigned long *b) | |||
871 | */ | 848 | */ |
872 | 849 | ||
873 | #define ext2_set_bit(nr, addr) \ | 850 | #define ext2_set_bit(nr, addr) \ |
874 | test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) | 851 | __test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) |
875 | #define ext2_set_bit_atomic(lock, nr, addr) \ | 852 | #define ext2_set_bit_atomic(lock, nr, addr) \ |
876 | test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) | 853 | test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) |
877 | #define ext2_clear_bit(nr, addr) \ | 854 | #define ext2_clear_bit(nr, addr) \ |
878 | test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) | 855 | __test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) |
879 | #define ext2_clear_bit_atomic(lock, nr, addr) \ | 856 | #define ext2_clear_bit_atomic(lock, nr, addr) \ |
880 | test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) | 857 | test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) |
881 | #define ext2_test_bit(nr, addr) \ | 858 | #define ext2_test_bit(nr, addr) \ |
@@ -1011,18 +988,7 @@ ext2_find_next_zero_bit(void *vaddr, unsigned long size, unsigned long offset) | |||
1011 | return offset + ext2_find_first_zero_bit(p, size); | 988 | return offset + ext2_find_first_zero_bit(p, size); |
1012 | } | 989 | } |
1013 | 990 | ||
1014 | /* Bitmap functions for the minix filesystem. */ | 991 | #include <asm-generic/bitops/minix.h> |
1015 | /* FIXME !!! */ | ||
1016 | #define minix_test_and_set_bit(nr,addr) \ | ||
1017 | test_and_set_bit(nr,(unsigned long *)addr) | ||
1018 | #define minix_set_bit(nr,addr) \ | ||
1019 | set_bit(nr,(unsigned long *)addr) | ||
1020 | #define minix_test_and_clear_bit(nr,addr) \ | ||
1021 | test_and_clear_bit(nr,(unsigned long *)addr) | ||
1022 | #define minix_test_bit(nr,addr) \ | ||
1023 | test_bit(nr,(unsigned long *)addr) | ||
1024 | #define minix_find_first_zero_bit(addr,size) \ | ||
1025 | find_first_zero_bit(addr,size) | ||
1026 | 992 | ||
1027 | #endif /* __KERNEL__ */ | 993 | #endif /* __KERNEL__ */ |
1028 | 994 | ||