Merge branch 'perf/fast' into perf/core
[deliverable/linux.git] / include / asm-generic / bitops / le.h
CommitLineData
930ae745
AM
1#ifndef _ASM_GENERIC_BITOPS_LE_H_
2#define _ASM_GENERIC_BITOPS_LE_H_
3
4#include <asm/types.h>
5#include <asm/byteorder.h>
6
930ae745
AM
7#if defined(__LITTLE_ENDIAN)
8
63ab595f 9#define BITOP_LE_SWIZZLE 0
930ae745 10
a56560b3
AM
11static inline unsigned long find_next_zero_bit_le(const void *addr,
12 unsigned long size, unsigned long offset)
13{
14 return find_next_zero_bit(addr, size, offset);
15}
16
17static inline unsigned long find_next_bit_le(const void *addr,
18 unsigned long size, unsigned long offset)
19{
20 return find_next_bit(addr, size, offset);
21}
22
23static inline unsigned long find_first_zero_bit_le(const void *addr,
24 unsigned long size)
25{
26 return find_first_zero_bit(addr, size);
27}
930ae745
AM
28
29#elif defined(__BIG_ENDIAN)
30
63ab595f
AM
31#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
32
19de85ef 33#ifndef find_next_zero_bit_le
a56560b3 34extern unsigned long find_next_zero_bit_le(const void *addr,
63ab595f 35 unsigned long size, unsigned long offset);
19de85ef
AM
36#endif
37
38#ifndef find_next_bit_le
a56560b3 39extern unsigned long find_next_bit_le(const void *addr,
63ab595f 40 unsigned long size, unsigned long offset);
19de85ef 41#endif
63ab595f 42
19de85ef 43#ifndef find_first_zero_bit_le
c4945b9e
AM
44#define find_first_zero_bit_le(addr, size) \
45 find_next_zero_bit_le((addr), (size), 0)
19de85ef 46#endif
63ab595f
AM
47
48#else
49#error "Please fix <asm/byteorder.h>"
50#endif
51
a56560b3
AM
52static inline int test_bit_le(int nr, const void *addr)
53{
54 return test_bit(nr ^ BITOP_LE_SWIZZLE, addr);
55}
56
57static inline void __set_bit_le(int nr, void *addr)
58{
59 __set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
60}
61
62static inline void __clear_bit_le(int nr, void *addr)
63{
64 __clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
65}
66
67static inline int test_and_set_bit_le(int nr, void *addr)
68{
69 return test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
70}
71
72static inline int test_and_clear_bit_le(int nr, void *addr)
73{
74 return test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
75}
76
77static inline int __test_and_set_bit_le(int nr, void *addr)
78{
79 return __test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
80}
81
82static inline int __test_and_clear_bit_le(int nr, void *addr)
83{
84 return __test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
85}
930ae745 86
930ae745 87#endif /* _ASM_GENERIC_BITOPS_LE_H_ */
This page took 0.521092 seconds and 5 git commands to generate.