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>
This commit is contained in:
parent
c1e6ca7a50
commit
861b5ae7cd
|
@ -454,6 +454,7 @@ sched_find_first_bit(const unsigned long b[2])
|
|||
return __ffs(tmp) + ofs;
|
||||
}
|
||||
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
|
||||
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
|
||||
|
|
|
@ -299,6 +299,7 @@ static inline int ffs(unsigned long word)
|
|||
#include <asm-generic/bitops/hweight.h>
|
||||
#include <asm-generic/bitops/lock.h>
|
||||
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
#include <asm-generic/bitops/ext2-atomic.h>
|
||||
#include <asm-generic/bitops/minix-le.h>
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <asm-generic/bitops/const_hweight.h>
|
||||
#include <asm-generic/bitops/lock.h>
|
||||
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
#include <asm-generic/bitops/ext2-atomic.h>
|
||||
#include <asm-generic/bitops/minix.h>
|
||||
|
|
|
@ -154,6 +154,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
|
|||
#include <asm-generic/bitops/find.h>
|
||||
#include <asm-generic/bitops/lock.h>
|
||||
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
|
||||
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
|
||||
|
|
|
@ -401,6 +401,7 @@ int __ilog2_u64(u64 n)
|
|||
#include <asm-generic/bitops/hweight.h>
|
||||
#include <asm-generic/bitops/lock.h>
|
||||
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
|
||||
#define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit ((nr) ^ 0x18, (addr))
|
||||
|
|
|
@ -200,6 +200,7 @@ static __inline__ unsigned long __ffs(unsigned long word)
|
|||
#include <asm-generic/bitops/sched.h>
|
||||
#include <asm-generic/bitops/hweight.h>
|
||||
#include <asm-generic/bitops/lock.h>
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
#include <asm-generic/bitops/ext2-atomic.h>
|
||||
#include <asm-generic/bitops/minix.h>
|
||||
|
|
|
@ -456,6 +456,7 @@ static __inline__ unsigned long __arch_hweight64(unsigned long x)
|
|||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
|
||||
#define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a)
|
||||
|
|
|
@ -266,6 +266,7 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr)
|
|||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
#include <asm-generic/bitops/ext2-atomic.h>
|
||||
#include <asm-generic/bitops/minix.h>
|
||||
|
|
|
@ -676,6 +676,7 @@ static inline int ffs(int word)
|
|||
#include <asm/arch_hweight.h>
|
||||
#include <asm-generic/bitops/const_hweight.h>
|
||||
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
#include <asm-generic/bitops/ext2-atomic.h>
|
||||
#include <asm-generic/bitops/minix.h>
|
||||
|
|
|
@ -233,6 +233,7 @@ int ffs(int x)
|
|||
#define ext2_clear_bit_atomic(lock, nr, addr) \
|
||||
test_and_clear_bit((nr), (addr))
|
||||
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
#include <asm-generic/bitops/minix-le.h>
|
||||
|
||||
|
|
|
@ -222,6 +222,7 @@ static __inline__ int fls(int x)
|
|||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
|
||||
/* '3' is bits per byte */
|
||||
|
|
|
@ -94,6 +94,7 @@ static inline unsigned long ffz(unsigned long word)
|
|||
#include <asm-generic/bitops/hweight.h>
|
||||
#include <asm-generic/bitops/lock.h>
|
||||
#include <asm-generic/bitops/sched.h>
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
#include <asm-generic/bitops/ext2-atomic.h>
|
||||
#include <asm-generic/bitops/minix.h>
|
||||
|
|
|
@ -103,6 +103,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
|
|||
#include <asm-generic/bitops/hweight.h>
|
||||
#include <asm-generic/bitops/lock.h>
|
||||
#include <asm-generic/bitops/find.h>
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
#include <asm-generic/bitops/ext2-atomic.h>
|
||||
#include <asm-generic/bitops/minix.h>
|
||||
|
|
|
@ -89,6 +89,7 @@ static inline unsigned int __arch_hweight8(unsigned int w)
|
|||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
|
||||
#define ext2_set_bit_atomic(lock,nr,addr) \
|
||||
|
|
|
@ -122,6 +122,7 @@ static inline unsigned long __arch_hweight64(__u64 w)
|
|||
#include <asm-generic/bitops/lock.h>
|
||||
#include <asm-generic/bitops/find.h>
|
||||
#include <asm-generic/bitops/sched.h>
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
#include <asm-generic/bitops/minix.h>
|
||||
|
||||
|
|
|
@ -456,6 +456,7 @@ static inline int fls(int x)
|
|||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
|
||||
#define ext2_set_bit_atomic(lock, nr, addr) \
|
||||
|
|
|
@ -106,6 +106,7 @@ static inline unsigned long __fls(unsigned long word)
|
|||
|
||||
#include <asm-generic/bitops/fls64.h>
|
||||
#include <asm-generic/bitops/find.h>
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
|
||||
#ifdef __XTENSA_EL__
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
#include <asm-generic/bitops/atomic.h>
|
||||
#include <asm-generic/bitops/non-atomic.h>
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
#include <asm-generic/bitops/ext2-atomic.h>
|
||||
#include <asm-generic/bitops/minix.h>
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#ifndef _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_
|
||||
#define _ASM_GENERIC_BITOPS_EXT2_NON_ATOMIC_H_
|
||||
|
||||
#include <asm-generic/bitops/le.h>
|
||||
|
||||
#define ext2_set_bit(nr,addr) \
|
||||
__test_and_set_bit_le((nr), (unsigned long *)(addr))
|
||||
#define ext2_clear_bit(nr,addr) \
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#ifndef _ASM_GENERIC_BITOPS_MINIX_LE_H_
|
||||
#define _ASM_GENERIC_BITOPS_MINIX_LE_H_
|
||||
|
||||
#include <asm-generic/bitops/le.h>
|
||||
|
||||
#define minix_test_and_set_bit(nr,addr) \
|
||||
__test_and_set_bit_le((nr), (unsigned long *)(addr))
|
||||
#define minix_set_bit(nr,addr) \
|
||||
|
|
Loading…
Reference in New Issue