diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2012-11-03 22:03:45 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-11-14 21:01:10 -0500 |
commit | 79597be99ac96b1409eb7ae41c336696d7c4f4d9 (patch) | |
tree | 5d4568262e08e2caf065e4ed4e5e7e9f708a6730 /arch/powerpc | |
parent | 2237f4f40af9ab57d5427b35d1514d3e65d31d1a (diff) |
powerpc: Use asm-generic/bitops/le.h
The only difference between powerpc and asm-generic le-bitops is
test_bit_le(). Usually all bitops require a long aligned bitmap.
But powerpc test_bit_le() can take an unaligned address.
There is no special callsite of test_bit_le() that needs unaligned
access in powerpc as far as I can see. So convert to use
asm-generic/bitops/le.h for powerpc.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/bitops.h | 55 |
1 files changed, 1 insertions, 54 deletions
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h index 920596f3b2af..ef918a2328bb 100644 --- a/arch/powerpc/include/asm/bitops.h +++ b/arch/powerpc/include/asm/bitops.h | |||
@@ -278,61 +278,8 @@ unsigned long __arch_hweight64(__u64 w); | |||
278 | #include <asm-generic/bitops/find.h> | 278 | #include <asm-generic/bitops/find.h> |
279 | 279 | ||
280 | /* Little-endian versions */ | 280 | /* Little-endian versions */ |
281 | #include <asm-generic/bitops/le.h> | ||
281 | 282 | ||
282 | static __inline__ int test_bit_le(unsigned long nr, | ||
283 | __const__ void *addr) | ||
284 | { | ||
285 | __const__ unsigned char *tmp = (__const__ unsigned char *) addr; | ||
286 | return (tmp[nr >> 3] >> (nr & 7)) & 1; | ||
287 | } | ||
288 | |||
289 | static inline void set_bit_le(int nr, void *addr) | ||
290 | { | ||
291 | set_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
292 | } | ||
293 | |||
294 | static inline void clear_bit_le(int nr, void *addr) | ||
295 | { | ||
296 | clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
297 | } | ||
298 | |||
299 | static inline void __set_bit_le(int nr, void *addr) | ||
300 | { | ||
301 | __set_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
302 | } | ||
303 | |||
304 | static inline void __clear_bit_le(int nr, void *addr) | ||
305 | { | ||
306 | __clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
307 | } | ||
308 | |||
309 | static inline int test_and_set_bit_le(int nr, void *addr) | ||
310 | { | ||
311 | return test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
312 | } | ||
313 | |||
314 | static inline int test_and_clear_bit_le(int nr, void *addr) | ||
315 | { | ||
316 | return test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
317 | } | ||
318 | |||
319 | static inline int __test_and_set_bit_le(int nr, void *addr) | ||
320 | { | ||
321 | return __test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
322 | } | ||
323 | |||
324 | static inline int __test_and_clear_bit_le(int nr, void *addr) | ||
325 | { | ||
326 | return __test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
327 | } | ||
328 | |||
329 | #define find_first_zero_bit_le(addr, size) \ | ||
330 | find_next_zero_bit_le((addr), (size), 0) | ||
331 | unsigned long find_next_zero_bit_le(const void *addr, | ||
332 | unsigned long size, unsigned long offset); | ||
333 | |||
334 | unsigned long find_next_bit_le(const void *addr, | ||
335 | unsigned long size, unsigned long offset); | ||
336 | /* Bitmap functions for the ext2 filesystem */ | 283 | /* Bitmap functions for the ext2 filesystem */ |
337 | 284 | ||
338 | #include <asm-generic/bitops/ext2-atomic-setbit.h> | 285 | #include <asm-generic/bitops/ext2-atomic-setbit.h> |