diff options
Diffstat (limited to 'arch/s390/include')
-rw-r--r-- | arch/s390/include/asm/bitops.h | 73 |
1 files changed, 54 insertions, 19 deletions
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h index 2e05972c5085..f48f9644e4b5 100644 --- a/arch/s390/include/asm/bitops.h +++ b/arch/s390/include/asm/bitops.h | |||
@@ -742,18 +742,42 @@ static inline int sched_find_first_bit(unsigned long *b) | |||
742 | * 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24 | 742 | * 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24 |
743 | */ | 743 | */ |
744 | 744 | ||
745 | #define ext2_set_bit(nr, addr) \ | 745 | static inline void __set_bit_le(unsigned long nr, void *addr) |
746 | __test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) | 746 | { |
747 | #define ext2_set_bit_atomic(lock, nr, addr) \ | 747 | __set_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr); |
748 | test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) | 748 | } |
749 | #define ext2_clear_bit(nr, addr) \ | 749 | |
750 | __test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) | 750 | static inline void __clear_bit_le(unsigned long nr, void *addr) |
751 | #define ext2_clear_bit_atomic(lock, nr, addr) \ | 751 | { |
752 | test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) | 752 | __clear_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr); |
753 | #define ext2_test_bit(nr, addr) \ | 753 | } |
754 | test_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) | 754 | |
755 | 755 | static inline int __test_and_set_bit_le(unsigned long nr, void *addr) | |
756 | static inline int ext2_find_first_zero_bit(void *vaddr, unsigned int size) | 756 | { |
757 | return __test_and_set_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr); | ||
758 | } | ||
759 | |||
760 | static inline int test_and_set_bit_le(unsigned long nr, void *addr) | ||
761 | { | ||
762 | return test_and_set_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr); | ||
763 | } | ||
764 | |||
765 | static inline int __test_and_clear_bit_le(unsigned long nr, void *addr) | ||
766 | { | ||
767 | return __test_and_clear_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr); | ||
768 | } | ||
769 | |||
770 | static inline int test_and_clear_bit_le(unsigned long nr, void *addr) | ||
771 | { | ||
772 | return test_and_clear_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr); | ||
773 | } | ||
774 | |||
775 | static inline int test_bit_le(unsigned long nr, const void *addr) | ||
776 | { | ||
777 | return test_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr); | ||
778 | } | ||
779 | |||
780 | static inline int find_first_zero_bit_le(void *vaddr, unsigned int size) | ||
757 | { | 781 | { |
758 | unsigned long bytes, bits; | 782 | unsigned long bytes, bits; |
759 | 783 | ||
@@ -764,7 +788,7 @@ static inline int ext2_find_first_zero_bit(void *vaddr, unsigned int size) | |||
764 | return (bits < size) ? bits : size; | 788 | return (bits < size) ? bits : size; |
765 | } | 789 | } |
766 | 790 | ||
767 | static inline int ext2_find_next_zero_bit(void *vaddr, unsigned long size, | 791 | static inline int find_next_zero_bit_le(void *vaddr, unsigned long size, |
768 | unsigned long offset) | 792 | unsigned long offset) |
769 | { | 793 | { |
770 | unsigned long *addr = vaddr, *p; | 794 | unsigned long *addr = vaddr, *p; |
@@ -790,11 +814,10 @@ static inline int ext2_find_next_zero_bit(void *vaddr, unsigned long size, | |||
790 | size -= __BITOPS_WORDSIZE; | 814 | size -= __BITOPS_WORDSIZE; |
791 | p++; | 815 | p++; |
792 | } | 816 | } |
793 | return offset + ext2_find_first_zero_bit(p, size); | 817 | return offset + find_first_zero_bit_le(p, size); |
794 | } | 818 | } |
795 | 819 | ||
796 | static inline unsigned long ext2_find_first_bit(void *vaddr, | 820 | static inline unsigned long find_first_bit_le(void *vaddr, unsigned long size) |
797 | unsigned long size) | ||
798 | { | 821 | { |
799 | unsigned long bytes, bits; | 822 | unsigned long bytes, bits; |
800 | 823 | ||
@@ -805,7 +828,7 @@ static inline unsigned long ext2_find_first_bit(void *vaddr, | |||
805 | return (bits < size) ? bits : size; | 828 | return (bits < size) ? bits : size; |
806 | } | 829 | } |
807 | 830 | ||
808 | static inline int ext2_find_next_bit(void *vaddr, unsigned long size, | 831 | static inline int find_next_bit_le(void *vaddr, unsigned long size, |
809 | unsigned long offset) | 832 | unsigned long offset) |
810 | { | 833 | { |
811 | unsigned long *addr = vaddr, *p; | 834 | unsigned long *addr = vaddr, *p; |
@@ -831,8 +854,20 @@ static inline int ext2_find_next_bit(void *vaddr, unsigned long size, | |||
831 | size -= __BITOPS_WORDSIZE; | 854 | size -= __BITOPS_WORDSIZE; |
832 | p++; | 855 | p++; |
833 | } | 856 | } |
834 | return offset + ext2_find_first_bit(p, size); | 857 | return offset + find_first_bit_le(p, size); |
835 | } | 858 | } |
859 | |||
860 | #define ext2_set_bit __test_and_set_bit_le | ||
861 | #define ext2_set_bit_atomic(lock, nr, addr) \ | ||
862 | test_and_set_bit_le(nr, addr) | ||
863 | #define ext2_clear_bit __test_and_clear_bit_le | ||
864 | #define ext2_clear_bit_atomic(lock, nr, addr) \ | ||
865 | test_and_clear_bit_le(nr, addr) | ||
866 | #define ext2_test_bit test_bit_le | ||
867 | #define ext2_find_first_zero_bit find_first_zero_bit_le | ||
868 | #define ext2_find_next_zero_bit find_next_zero_bit_le | ||
869 | #define ext2_find_first_bit find_first_bit_le | ||
870 | #define ext2_find_next_bit find_next_bit_le | ||
836 | 871 | ||
837 | #include <asm-generic/bitops/minix.h> | 872 | #include <asm-generic/bitops/minix.h> |
838 | 873 | ||