diff options
author | Renaud Barbier <renaud.barbier@ge.com> | 2014-01-29 11:06:50 +0000 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-01-30 08:42:53 +0100 |
commit | b99e853aff4dc6f442e62a8187de04877877c4b1 (patch) | |
tree | e7fe7cd3c053e55e9096b8806c5c72d8f0a4fab7 /arch/ppc/include | |
parent | 278850a4421ab7cdfd271a6b8e774c77e154e9d0 (diff) | |
download | barebox-b99e853aff4dc6f442e62a8187de04877877c4b1.tar.gz barebox-b99e853aff4dc6f442e62a8187de04877877c4b1.tar.xz |
ppc: remove bit operation headers file conflict
Removed the ppc bit operation functions and definitions in the ppc
file asm/bitops.h since these are already defined in the asm-generic header
files. Moved ffs64 definition to the mpc85xx header files because
the function requires the inclusion of linux/log2.h which also includes
asm/bitops.h.
The conflict was noted when UBIFS was enabled in barebox.
Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/ppc/include')
-rw-r--r-- | arch/ppc/include/asm/bitops.h | 46 |
1 files changed, 2 insertions, 44 deletions
diff --git a/arch/ppc/include/asm/bitops.h b/arch/ppc/include/asm/bitops.h index 3b31d5420e..eea9e0c430 100644 --- a/arch/ppc/include/asm/bitops.h +++ b/arch/ppc/include/asm/bitops.h @@ -6,13 +6,7 @@ #define _PPC_BITOPS_H #include <asm/byteorder.h> - -extern void set_bit(int nr, volatile void *addr); -extern void clear_bit(int nr, volatile void *addr); -extern void change_bit(int nr, volatile void *addr); -extern int test_and_set_bit(int nr, volatile void *addr); -extern int test_and_clear_bit(int nr, volatile void *addr); -extern int test_and_change_bit(int nr, volatile void *addr); +#include <asm-generic/bitops/ops.h> /* * Arguably these bit operations don't imply any memory barrier or @@ -143,13 +137,6 @@ extern __inline__ int test_and_change_bit(int nr, volatile void *addr) } #endif /* __INLINE_BITOPS */ -extern __inline__ int test_bit(int nr, __const__ volatile void *addr) -{ - __const__ unsigned int *p = (__const__ unsigned int *) addr; - - return ((p[nr >> 5] >> (nr & 0x1f)) & 1) != 0; -} - /* Return the bit position of the most significant 1 bit in a word */ extern __inline__ int __ilog2(unsigned int x) { @@ -178,36 +165,6 @@ static inline int fls(unsigned int x) return 32 - lz; } -/* - * fls64 - find last set bit in a 64-bit word - * @x: the word to search - * - * This is defined in a similar way as the libc and compiler builtin - * ffsll, but returns the position of the most significant set bit. - * - * fls64(value) returns 0 if value is 0 or the position of the last - * set bit if value is nonzero. The last (most significant) bit is - * at position 64. - */ - -static inline int fls64(__u64 x) -{ - __u32 h = x >> 32; - if (h) - return fls(h) + 32; - return fls(x); -} - -static inline int __ilog2_u64(u64 n) -{ - return fls64(n) - 1; -} - -static inline int ffs64(u64 x) -{ - return __ilog2_u64(x & -x) + 1ull; -} - #ifdef __KERNEL__ /* @@ -220,6 +177,7 @@ extern __inline__ int ffs(int x) return __ilog2(x & -x) + 1; } +#include <asm-generic/bitops/fls64.h> #include <asm-generic/bitops/hweight.h> #endif /* __KERNEL__ */ |