From: Akinobu Mita Date: Wed, 23 Mar 2011 23:42:02 +0000 (-0700) Subject: bitops: introduce little-endian bitops for most architectures X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=861b5ae7cde96ca081914e21dedfa7e8a38da622;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git bitops: introduce little-endian bitops for most architectures Introduce little-endian bit operations to the big-endian architectures which do not have native little-endian bit operations and the little-endian architectures. (alpha, avr32, blackfin, cris, frv, h8300, ia64, m32r, mips, mn10300, parisc, sh, sparc, tile, x86, xtensa) These architectures can just include generic implementation (asm-generic/bitops/le.h). Signed-off-by: Akinobu Mita Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Mikael Starvik Cc: David Howells Cc: Yoshinori Sato Cc: "Luck, Tony" Cc: Ralf Baechle Cc: Kyle McMartin Cc: Matthew Wilcox Cc: Grant Grundler Cc: Paul Mundt Cc: Kazumoto Kojima Cc: Hirokazu Takata Cc: "David S. Miller" Cc: Chris Zankel Cc: Ingo Molnar Cc: Thomas Gleixner Acked-by: Hans-Christian Egtvedt Acked-by: "H. Peter Anvin" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h index adfab8a21df..955fec7cfeb 100644 --- a/arch/alpha/include/asm/bitops.h +++ b/arch/alpha/include/asm/bitops.h @@ -454,6 +454,7 @@ sched_find_first_bit(const unsigned long b[2]) return __ffs(tmp) + ofs; } +#include #include #define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a) diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h index f7dd5f71edf..1c482fc9da7 100644 --- a/arch/avr32/include/asm/bitops.h +++ b/arch/avr32/include/asm/bitops.h @@ -299,6 +299,7 @@ static inline int ffs(unsigned long word) #include #include +#include #include #include #include diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h index 29f4fd88617..fe257cfec97 100644 --- a/arch/blackfin/include/asm/bitops.h +++ b/arch/blackfin/include/asm/bitops.h @@ -25,6 +25,7 @@ #include #include +#include #include #include #include diff --git a/arch/cris/include/asm/bitops.h b/arch/cris/include/asm/bitops.h index 9e69cfb7f13..599ae6730bc 100644 --- a/arch/cris/include/asm/bitops.h +++ b/arch/cris/include/asm/bitops.h @@ -154,6 +154,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr) #include #include +#include #include #define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a) diff --git a/arch/frv/include/asm/bitops.h b/arch/frv/include/asm/bitops.h index 50ae91b2967..2631917c2be 100644 --- a/arch/frv/include/asm/bitops.h +++ b/arch/frv/include/asm/bitops.h @@ -401,6 +401,7 @@ int __ilog2_u64(u64 n) #include #include +#include #include #define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit ((nr) ^ 0x18, (addr)) diff --git a/arch/h8300/include/asm/bitops.h b/arch/h8300/include/asm/bitops.h index cb9ddf5fc54..763094fdd7c 100644 --- a/arch/h8300/include/asm/bitops.h +++ b/arch/h8300/include/asm/bitops.h @@ -200,6 +200,7 @@ static __inline__ unsigned long __ffs(unsigned long word) #include #include #include +#include #include #include #include diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h index 9da3df6f1a5..2cde4f0f1aa 100644 --- a/arch/ia64/include/asm/bitops.h +++ b/arch/ia64/include/asm/bitops.h @@ -456,6 +456,7 @@ static __inline__ unsigned long __arch_hweight64(unsigned long x) #ifdef __KERNEL__ +#include #include #define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a) diff --git a/arch/m32r/include/asm/bitops.h b/arch/m32r/include/asm/bitops.h index aaddf0d5760..681f7e8e458 100644 --- a/arch/m32r/include/asm/bitops.h +++ b/arch/m32r/include/asm/bitops.h @@ -266,6 +266,7 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr) #ifdef __KERNEL__ +#include #include #include #include diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h index 50b4ef288c5..ef420eb1222 100644 --- a/arch/mips/include/asm/bitops.h +++ b/arch/mips/include/asm/bitops.h @@ -676,6 +676,7 @@ static inline int ffs(int word) #include #include +#include #include #include #include diff --git a/arch/mn10300/include/asm/bitops.h b/arch/mn10300/include/asm/bitops.h index 3b8a868188f..42b54539c38 100644 --- a/arch/mn10300/include/asm/bitops.h +++ b/arch/mn10300/include/asm/bitops.h @@ -233,6 +233,7 @@ int ffs(int x) #define ext2_clear_bit_atomic(lock, nr, addr) \ test_and_clear_bit((nr), (addr)) +#include #include #include diff --git a/arch/parisc/include/asm/bitops.h b/arch/parisc/include/asm/bitops.h index 7a6ea10bd23..4b9e58debb1 100644 --- a/arch/parisc/include/asm/bitops.h +++ b/arch/parisc/include/asm/bitops.h @@ -222,6 +222,7 @@ static __inline__ int fls(int x) #ifdef __KERNEL__ +#include #include /* '3' is bits per byte */ diff --git a/arch/sh/include/asm/bitops.h b/arch/sh/include/asm/bitops.h index 98511e4d28c..9167810c57b 100644 --- a/arch/sh/include/asm/bitops.h +++ b/arch/sh/include/asm/bitops.h @@ -94,6 +94,7 @@ static inline unsigned long ffz(unsigned long word) #include #include #include +#include #include #include #include diff --git a/arch/sparc/include/asm/bitops_32.h b/arch/sparc/include/asm/bitops_32.h index 9cf4ae0cd7b..5b3ab064658 100644 --- a/arch/sparc/include/asm/bitops_32.h +++ b/arch/sparc/include/asm/bitops_32.h @@ -103,6 +103,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr) #include #include #include +#include #include #include #include diff --git a/arch/sparc/include/asm/bitops_64.h b/arch/sparc/include/asm/bitops_64.h index 766121a67a2..9097862faaa 100644 --- a/arch/sparc/include/asm/bitops_64.h +++ b/arch/sparc/include/asm/bitops_64.h @@ -89,6 +89,7 @@ static inline unsigned int __arch_hweight8(unsigned int w) #ifdef __KERNEL__ +#include #include #define ext2_set_bit_atomic(lock,nr,addr) \ diff --git a/arch/tile/include/asm/bitops.h b/arch/tile/include/asm/bitops.h index 6d4f0ff2c68..56b03553ad0 100644 --- a/arch/tile/include/asm/bitops.h +++ b/arch/tile/include/asm/bitops.h @@ -122,6 +122,7 @@ static inline unsigned long __arch_hweight64(__u64 w) #include #include #include +#include #include #include diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h index 903683b07e4..c68bc101441 100644 --- a/arch/x86/include/asm/bitops.h +++ b/arch/x86/include/asm/bitops.h @@ -456,6 +456,7 @@ static inline int fls(int x) #ifdef __KERNEL__ +#include #include #define ext2_set_bit_atomic(lock, nr, addr) \ diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h index 6c3930397bd..0475c11bfde 100644 --- a/arch/xtensa/include/asm/bitops.h +++ b/arch/xtensa/include/asm/bitops.h @@ -106,6 +106,7 @@ static inline unsigned long __fls(unsigned long word) #include #include +#include #include #ifdef __XTENSA_EL__ diff --git a/include/asm-generic/bitops.h b/include/asm-generic/bitops.h index a54f4421a24..933710b06e8 100644 --- a/include/asm-generic/bitops.h +++ b/include/asm-generic/bitops.h @@ -38,6 +38,7 @@ #include #include +#include #include #include #include diff --git a/include/asm-generic/bitops/ext2-non-atomic.h b/include/asm-generic/bitops/ext2-non-atomic.h index ba27bbe755a..ad0a244787f 100644 --- a/include/asm-generic/bitops/ext2-non-atomic.h +++ b/include/asm-generic/bitops/ext2-non-atomic.h @@ -1,8 +1,6 @@ #ifndef _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_ #define _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_ -#include - #define ext2_set_bit(nr,addr) \ __test_and_set_bit_le((nr), (unsigned long *)(addr)) #define ext2_clear_bit(nr,addr) \ diff --git a/include/asm-generic/bitops/minix-le.h b/include/asm-generic/bitops/minix-le.h index 854e9489f62..70f95eef416 100644 --- a/include/asm-generic/bitops/minix-le.h +++ b/include/asm-generic/bitops/minix-le.h @@ -1,8 +1,6 @@ #ifndef _ASM_GENERIC_BITOPS_MINIX_LE_H_ #define _ASM_GENERIC_BITOPS_MINIX_LE_H_ -#include - #define minix_test_and_set_bit(nr,addr) \ __test_and_set_bit_le((nr), (unsigned long *)(addr)) #define minix_set_bit(nr,addr) \