|
Lines 8-27
Link Here
|
| 8 |
|
8 |
|
| 9 |
#define BITOP_LE_SWIZZLE 0 |
9 |
#define BITOP_LE_SWIZZLE 0 |
| 10 |
|
10 |
|
| 11 |
static inline unsigned long find_next_zero_bit_le(const void *addr, |
11 |
static inline unsigned long find_next_zero_bit_le(const unsigned long *addr, |
| 12 |
unsigned long size, unsigned long offset) |
12 |
unsigned long size, |
|
|
13 |
unsigned long offset) |
| 13 |
{ |
14 |
{ |
| 14 |
return find_next_zero_bit(addr, size, offset); |
15 |
return find_next_zero_bit(addr, size, offset); |
| 15 |
} |
16 |
} |
| 16 |
|
17 |
|
| 17 |
static inline unsigned long find_next_bit_le(const void *addr, |
18 |
static inline unsigned long find_next_bit_le(const unsigned long *addr, |
| 18 |
unsigned long size, unsigned long offset) |
19 |
unsigned long size, |
|
|
20 |
unsigned long offset) |
| 19 |
{ |
21 |
{ |
| 20 |
return find_next_bit(addr, size, offset); |
22 |
return find_next_bit(addr, size, offset); |
| 21 |
} |
23 |
} |
| 22 |
|
24 |
|
| 23 |
static inline unsigned long find_first_zero_bit_le(const void *addr, |
25 |
static inline unsigned long find_first_zero_bit_le(const unsigned long *addr, |
| 24 |
unsigned long size) |
26 |
unsigned long size) |
| 25 |
{ |
27 |
{ |
| 26 |
return find_first_zero_bit(addr, size); |
28 |
return find_first_zero_bit(addr, size); |
| 27 |
} |
29 |
} |
|
Lines 31-43
static inline unsigned long find_first_zero_bit_le(const void *addr,
Link Here
|
| 31 |
#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) |
33 |
#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) |
| 32 |
|
34 |
|
| 33 |
#ifndef find_next_zero_bit_le |
35 |
#ifndef find_next_zero_bit_le |
| 34 |
extern unsigned long find_next_zero_bit_le(const void *addr, |
36 |
extern unsigned long find_next_zero_bit_le(const unsigned long *addr, |
| 35 |
unsigned long size, unsigned long offset); |
37 |
unsigned long size, |
|
|
38 |
unsigned long offset); |
| 36 |
#endif |
39 |
#endif |
| 37 |
|
40 |
|
| 38 |
#ifndef find_next_bit_le |
41 |
#ifndef find_next_bit_le |
| 39 |
extern unsigned long find_next_bit_le(const void *addr, |
42 |
extern unsigned long find_next_bit_le(const unsigned long *addr, |
| 40 |
unsigned long size, unsigned long offset); |
43 |
unsigned long size, |
|
|
44 |
unsigned long offset); |
| 41 |
#endif |
45 |
#endif |
| 42 |
|
46 |
|
| 43 |
#ifndef find_first_zero_bit_le |
47 |
#ifndef find_first_zero_bit_le |
|
Lines 49-95
extern unsigned long find_next_bit_le(const void *addr,
Link Here
|
| 49 |
#error "Please fix <asm/byteorder.h>" |
53 |
#error "Please fix <asm/byteorder.h>" |
| 50 |
#endif |
54 |
#endif |
| 51 |
|
55 |
|
| 52 |
static inline int test_bit_le(int nr, const void *addr) |
56 |
static inline int test_bit_le(int nr, const unsigned long *addr) |
| 53 |
{ |
57 |
{ |
| 54 |
return test_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
58 |
return test_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
| 55 |
} |
59 |
} |
| 56 |
|
60 |
|
| 57 |
static inline void set_bit_le(int nr, void *addr) |
61 |
static inline void set_bit_le(int nr, unsigned long *addr) |
| 58 |
{ |
62 |
{ |
| 59 |
set_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
63 |
set_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
| 60 |
} |
64 |
} |
| 61 |
|
65 |
|
| 62 |
static inline void clear_bit_le(int nr, void *addr) |
66 |
static inline void clear_bit_le(int nr, unsigned long *addr) |
| 63 |
{ |
67 |
{ |
| 64 |
clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
68 |
clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
| 65 |
} |
69 |
} |
| 66 |
|
70 |
|
| 67 |
static inline void __set_bit_le(int nr, void *addr) |
71 |
static inline void __set_bit_le(int nr, unsigned long *addr) |
| 68 |
{ |
72 |
{ |
| 69 |
__set_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
73 |
__set_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
| 70 |
} |
74 |
} |
| 71 |
|
75 |
|
| 72 |
static inline void __clear_bit_le(int nr, void *addr) |
76 |
static inline void __clear_bit_le(int nr, unsigned long *addr) |
| 73 |
{ |
77 |
{ |
| 74 |
__clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
78 |
__clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
| 75 |
} |
79 |
} |
| 76 |
|
80 |
|
| 77 |
static inline int test_and_set_bit_le(int nr, void *addr) |
81 |
static inline int test_and_set_bit_le(int nr, unsigned long *addr) |
| 78 |
{ |
82 |
{ |
| 79 |
return test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
83 |
return test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
| 80 |
} |
84 |
} |
| 81 |
|
85 |
|
| 82 |
static inline int test_and_clear_bit_le(int nr, void *addr) |
86 |
static inline int test_and_clear_bit_le(int nr, unsigned long *addr) |
| 83 |
{ |
87 |
{ |
| 84 |
return test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
88 |
return test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
| 85 |
} |
89 |
} |
| 86 |
|
90 |
|
| 87 |
static inline int __test_and_set_bit_le(int nr, void *addr) |
91 |
static inline int __test_and_set_bit_le(int nr, unsigned long *addr) |
| 88 |
{ |
92 |
{ |
| 89 |
return __test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
93 |
return __test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
| 90 |
} |
94 |
} |
| 91 |
|
95 |
|
| 92 |
static inline int __test_and_clear_bit_le(int nr, void *addr) |
96 |
static inline int __test_and_clear_bit_le(int nr, unsigned long *addr) |
| 93 |
{ |
97 |
{ |
| 94 |
return __test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
98 |
return __test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); |
| 95 |
} |
99 |
} |
| 96 |
- |
|
|