Skip to content

Commit

Permalink
bitops: introduce little-endian bitops for most architectures
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Ivan Kokshaysky <[email protected]>
Cc: Mikael Starvik <[email protected]>
Cc: David Howells <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Cc: "Luck, Tony" <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Kyle McMartin <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Grant Grundler <[email protected]>
Cc: Paul Mundt <[email protected]>
Cc: Kazumoto Kojima <[email protected]>
Cc: Hirokazu Takata <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Chris Zankel <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Acked-by: Hans-Christian Egtvedt <[email protected]>
Acked-by: "H. Peter Anvin" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
mita authored and torvalds committed Mar 24, 2011
1 parent c1e6ca7 commit 861b5ae
Show file tree
Hide file tree
Showing 20 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions arch/alpha/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions arch/avr32/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions arch/blackfin/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions arch/cris/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions arch/frv/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions arch/h8300/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions arch/ia64/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions arch/m32r/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions arch/mips/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions arch/mn10300/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
1 change: 1 addition & 0 deletions arch/parisc/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 1 addition & 0 deletions arch/sh/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions arch/sparc/include/asm/bitops_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions arch/sparc/include/asm/bitops_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
1 change: 1 addition & 0 deletions arch/tile/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
1 change: 1 addition & 0 deletions arch/x86/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
1 change: 1 addition & 0 deletions arch/xtensa/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
1 change: 1 addition & 0 deletions include/asm-generic/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 0 additions & 2 deletions include/asm-generic/bitops/ext2-non-atomic.h
Original file line number Diff line number Diff line change
@@ -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) \
Expand Down
2 changes: 0 additions & 2 deletions include/asm-generic/bitops/minix-le.h
Original file line number Diff line number Diff line change
@@ -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) \
Expand Down

0 comments on commit 861b5ae

Please sign in to comment.