aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2011-03-23 19:42:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-23 22:46:15 -0400
commit861b5ae7cde96ca081914e21dedfa7e8a38da622 (patch)
tree376cae55475cce2bb45b96213b1f91b330db0448 /arch
parentc1e6ca7a501f0139e5ec2a01f8420eeb21c97a52 (diff)
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 <akinobu.mita@gmail.com> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Mikael Starvik <starvik@axis.com> Cc: David Howells <dhowells@redhat.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Matthew Wilcox <willy@debian.org> Cc: Grant Grundler <grundler@parisc-linux.org> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp> Cc: Hirokazu Takata <takata@linux-m32r.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Chris Zankel <chris@zankel.net> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Acked-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> Acked-by: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/include/asm/bitops.h1
-rw-r--r--arch/avr32/include/asm/bitops.h1
-rw-r--r--arch/blackfin/include/asm/bitops.h1
-rw-r--r--arch/cris/include/asm/bitops.h1
-rw-r--r--arch/frv/include/asm/bitops.h1
-rw-r--r--arch/h8300/include/asm/bitops.h1
-rw-r--r--arch/ia64/include/asm/bitops.h1
-rw-r--r--arch/m32r/include/asm/bitops.h1
-rw-r--r--arch/mips/include/asm/bitops.h1
-rw-r--r--arch/mn10300/include/asm/bitops.h1
-rw-r--r--arch/parisc/include/asm/bitops.h1
-rw-r--r--arch/sh/include/asm/bitops.h1
-rw-r--r--arch/sparc/include/asm/bitops_32.h1
-rw-r--r--arch/sparc/include/asm/bitops_64.h1
-rw-r--r--arch/tile/include/asm/bitops.h1
-rw-r--r--arch/x86/include/asm/bitops.h1
-rw-r--r--arch/xtensa/include/asm/bitops.h1
17 files changed, 17 insertions, 0 deletions
diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h
index adfab8a21dfe..955fec7cfeb8 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])
454 return __ffs(tmp) + ofs; 454 return __ffs(tmp) + ofs;
455} 455}
456 456
457#include <asm-generic/bitops/le.h>
457#include <asm-generic/bitops/ext2-non-atomic.h> 458#include <asm-generic/bitops/ext2-non-atomic.h>
458 459
459#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a) 460#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 f7dd5f71edf7..1c482fc9da78 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)
299#include <asm-generic/bitops/hweight.h> 299#include <asm-generic/bitops/hweight.h>
300#include <asm-generic/bitops/lock.h> 300#include <asm-generic/bitops/lock.h>
301 301
302#include <asm-generic/bitops/le.h>
302#include <asm-generic/bitops/ext2-non-atomic.h> 303#include <asm-generic/bitops/ext2-non-atomic.h>
303#include <asm-generic/bitops/ext2-atomic.h> 304#include <asm-generic/bitops/ext2-atomic.h>
304#include <asm-generic/bitops/minix-le.h> 305#include <asm-generic/bitops/minix-le.h>
diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h
index 29f4fd886174..fe257cfec978 100644
--- a/arch/blackfin/include/asm/bitops.h
+++ b/arch/blackfin/include/asm/bitops.h
@@ -25,6 +25,7 @@
25#include <asm-generic/bitops/const_hweight.h> 25#include <asm-generic/bitops/const_hweight.h>
26#include <asm-generic/bitops/lock.h> 26#include <asm-generic/bitops/lock.h>
27 27
28#include <asm-generic/bitops/le.h>
28#include <asm-generic/bitops/ext2-non-atomic.h> 29#include <asm-generic/bitops/ext2-non-atomic.h>
29#include <asm-generic/bitops/ext2-atomic.h> 30#include <asm-generic/bitops/ext2-atomic.h>
30#include <asm-generic/bitops/minix.h> 31#include <asm-generic/bitops/minix.h>
diff --git a/arch/cris/include/asm/bitops.h b/arch/cris/include/asm/bitops.h
index 9e69cfb7f134..599ae6730bc8 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)
154#include <asm-generic/bitops/find.h> 154#include <asm-generic/bitops/find.h>
155#include <asm-generic/bitops/lock.h> 155#include <asm-generic/bitops/lock.h>
156 156
157#include <asm-generic/bitops/le.h>
157#include <asm-generic/bitops/ext2-non-atomic.h> 158#include <asm-generic/bitops/ext2-non-atomic.h>
158 159
159#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a) 160#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 50ae91b29674..2631917c2be4 100644
--- a/arch/frv/include/asm/bitops.h
+++ b/arch/frv/include/asm/bitops.h
@@ -401,6 +401,7 @@ int __ilog2_u64(u64 n)
401#include <asm-generic/bitops/hweight.h> 401#include <asm-generic/bitops/hweight.h>
402#include <asm-generic/bitops/lock.h> 402#include <asm-generic/bitops/lock.h>
403 403
404#include <asm-generic/bitops/le.h>
404#include <asm-generic/bitops/ext2-non-atomic.h> 405#include <asm-generic/bitops/ext2-non-atomic.h>
405 406
406#define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit ((nr) ^ 0x18, (addr)) 407#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 cb9ddf5fc54f..763094fdd7c2 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)
200#include <asm-generic/bitops/sched.h> 200#include <asm-generic/bitops/sched.h>
201#include <asm-generic/bitops/hweight.h> 201#include <asm-generic/bitops/hweight.h>
202#include <asm-generic/bitops/lock.h> 202#include <asm-generic/bitops/lock.h>
203#include <asm-generic/bitops/le.h>
203#include <asm-generic/bitops/ext2-non-atomic.h> 204#include <asm-generic/bitops/ext2-non-atomic.h>
204#include <asm-generic/bitops/ext2-atomic.h> 205#include <asm-generic/bitops/ext2-atomic.h>
205#include <asm-generic/bitops/minix.h> 206#include <asm-generic/bitops/minix.h>
diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h
index 9da3df6f1a52..2cde4f0f1aab 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)
456 456
457#ifdef __KERNEL__ 457#ifdef __KERNEL__
458 458
459#include <asm-generic/bitops/le.h>
459#include <asm-generic/bitops/ext2-non-atomic.h> 460#include <asm-generic/bitops/ext2-non-atomic.h>
460 461
461#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a) 462#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 aaddf0d57603..681f7e8e458e 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)
266 266
267#ifdef __KERNEL__ 267#ifdef __KERNEL__
268 268
269#include <asm-generic/bitops/le.h>
269#include <asm-generic/bitops/ext2-non-atomic.h> 270#include <asm-generic/bitops/ext2-non-atomic.h>
270#include <asm-generic/bitops/ext2-atomic.h> 271#include <asm-generic/bitops/ext2-atomic.h>
271#include <asm-generic/bitops/minix.h> 272#include <asm-generic/bitops/minix.h>
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h
index 50b4ef288c53..ef420eb12222 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)
676#include <asm/arch_hweight.h> 676#include <asm/arch_hweight.h>
677#include <asm-generic/bitops/const_hweight.h> 677#include <asm-generic/bitops/const_hweight.h>
678 678
679#include <asm-generic/bitops/le.h>
679#include <asm-generic/bitops/ext2-non-atomic.h> 680#include <asm-generic/bitops/ext2-non-atomic.h>
680#include <asm-generic/bitops/ext2-atomic.h> 681#include <asm-generic/bitops/ext2-atomic.h>
681#include <asm-generic/bitops/minix.h> 682#include <asm-generic/bitops/minix.h>
diff --git a/arch/mn10300/include/asm/bitops.h b/arch/mn10300/include/asm/bitops.h
index 3b8a868188f5..42b54539c388 100644
--- a/arch/mn10300/include/asm/bitops.h
+++ b/arch/mn10300/include/asm/bitops.h
@@ -233,6 +233,7 @@ int ffs(int x)
233#define ext2_clear_bit_atomic(lock, nr, addr) \ 233#define ext2_clear_bit_atomic(lock, nr, addr) \
234 test_and_clear_bit((nr), (addr)) 234 test_and_clear_bit((nr), (addr))
235 235
236#include <asm-generic/bitops/le.h>
236#include <asm-generic/bitops/ext2-non-atomic.h> 237#include <asm-generic/bitops/ext2-non-atomic.h>
237#include <asm-generic/bitops/minix-le.h> 238#include <asm-generic/bitops/minix-le.h>
238 239
diff --git a/arch/parisc/include/asm/bitops.h b/arch/parisc/include/asm/bitops.h
index 7a6ea10bd231..4b9e58debb18 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)
222 222
223#ifdef __KERNEL__ 223#ifdef __KERNEL__
224 224
225#include <asm-generic/bitops/le.h>
225#include <asm-generic/bitops/ext2-non-atomic.h> 226#include <asm-generic/bitops/ext2-non-atomic.h>
226 227
227/* '3' is bits per byte */ 228/* '3' is bits per byte */
diff --git a/arch/sh/include/asm/bitops.h b/arch/sh/include/asm/bitops.h
index 98511e4d28cb..9167810c57bd 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)
94#include <asm-generic/bitops/hweight.h> 94#include <asm-generic/bitops/hweight.h>
95#include <asm-generic/bitops/lock.h> 95#include <asm-generic/bitops/lock.h>
96#include <asm-generic/bitops/sched.h> 96#include <asm-generic/bitops/sched.h>
97#include <asm-generic/bitops/le.h>
97#include <asm-generic/bitops/ext2-non-atomic.h> 98#include <asm-generic/bitops/ext2-non-atomic.h>
98#include <asm-generic/bitops/ext2-atomic.h> 99#include <asm-generic/bitops/ext2-atomic.h>
99#include <asm-generic/bitops/minix.h> 100#include <asm-generic/bitops/minix.h>
diff --git a/arch/sparc/include/asm/bitops_32.h b/arch/sparc/include/asm/bitops_32.h
index 9cf4ae0cd7ba..5b3ab0646587 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)
103#include <asm-generic/bitops/hweight.h> 103#include <asm-generic/bitops/hweight.h>
104#include <asm-generic/bitops/lock.h> 104#include <asm-generic/bitops/lock.h>
105#include <asm-generic/bitops/find.h> 105#include <asm-generic/bitops/find.h>
106#include <asm-generic/bitops/le.h>
106#include <asm-generic/bitops/ext2-non-atomic.h> 107#include <asm-generic/bitops/ext2-non-atomic.h>
107#include <asm-generic/bitops/ext2-atomic.h> 108#include <asm-generic/bitops/ext2-atomic.h>
108#include <asm-generic/bitops/minix.h> 109#include <asm-generic/bitops/minix.h>
diff --git a/arch/sparc/include/asm/bitops_64.h b/arch/sparc/include/asm/bitops_64.h
index 766121a67a24..9097862faaad 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)
89 89
90#ifdef __KERNEL__ 90#ifdef __KERNEL__
91 91
92#include <asm-generic/bitops/le.h>
92#include <asm-generic/bitops/ext2-non-atomic.h> 93#include <asm-generic/bitops/ext2-non-atomic.h>
93 94
94#define ext2_set_bit_atomic(lock,nr,addr) \ 95#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 6d4f0ff2c68c..56b03553ad06 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)
122#include <asm-generic/bitops/lock.h> 122#include <asm-generic/bitops/lock.h>
123#include <asm-generic/bitops/find.h> 123#include <asm-generic/bitops/find.h>
124#include <asm-generic/bitops/sched.h> 124#include <asm-generic/bitops/sched.h>
125#include <asm-generic/bitops/le.h>
125#include <asm-generic/bitops/ext2-non-atomic.h> 126#include <asm-generic/bitops/ext2-non-atomic.h>
126#include <asm-generic/bitops/minix.h> 127#include <asm-generic/bitops/minix.h>
127 128
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index 903683b07e42..c68bc101441d 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)
456 456
457#ifdef __KERNEL__ 457#ifdef __KERNEL__
458 458
459#include <asm-generic/bitops/le.h>
459#include <asm-generic/bitops/ext2-non-atomic.h> 460#include <asm-generic/bitops/ext2-non-atomic.h>
460 461
461#define ext2_set_bit_atomic(lock, nr, addr) \ 462#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 6c3930397bd3..0475c11bfde2 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)
106 106
107#include <asm-generic/bitops/fls64.h> 107#include <asm-generic/bitops/fls64.h>
108#include <asm-generic/bitops/find.h> 108#include <asm-generic/bitops/find.h>
109#include <asm-generic/bitops/le.h>
109#include <asm-generic/bitops/ext2-non-atomic.h> 110#include <asm-generic/bitops/ext2-non-atomic.h>
110 111
111#ifdef __XTENSA_EL__ 112#ifdef __XTENSA_EL__