Lines Matching refs:nr

10  * this assumption by directly testing bits with (val & (1<<nr)).
45 __bitops_word(unsigned long nr, volatile unsigned long *ptr)
49 addr = (unsigned long)ptr + ((nr ^ (nr & (BITS_PER_LONG - 1))) >> 3);
54 __bitops_byte(unsigned long nr, volatile unsigned long *ptr)
56 return ((unsigned char *)ptr) + ((nr ^ (BITS_PER_LONG - 8)) >> 3);
59 static __always_inline void arch_set_bit(unsigned long nr, volatile unsigned long *ptr)
61 unsigned long *addr = __bitops_word(nr, ptr);
65 if (__builtin_constant_p(nr)) {
66 unsigned char *caddr = __bitops_byte(nr, ptr);
71 : "i" (1 << (nr & 7))
76 mask = 1UL << (nr & (BITS_PER_LONG - 1));
80 static __always_inline void arch_clear_bit(unsigned long nr, volatile unsigned long *ptr)
82 unsigned long *addr = __bitops_word(nr, ptr);
86 if (__builtin_constant_p(nr)) {
87 unsigned char *caddr = __bitops_byte(nr, ptr);
92 : "i" (~(1 << (nr & 7)))
97 mask = ~(1UL << (nr & (BITS_PER_LONG - 1)));
101 static __always_inline void arch_change_bit(unsigned long nr,
104 unsigned long *addr = __bitops_word(nr, ptr);
108 if (__builtin_constant_p(nr)) {
109 unsigned char *caddr = __bitops_byte(nr, ptr);
114 : "i" (1 << (nr & 7))
119 mask = 1UL << (nr & (BITS_PER_LONG - 1));
123 static inline bool arch_test_and_set_bit(unsigned long nr,
126 unsigned long *addr = __bitops_word(nr, ptr);
129 mask = 1UL << (nr & (BITS_PER_LONG - 1));
134 static inline bool arch_test_and_clear_bit(unsigned long nr,
137 unsigned long *addr = __bitops_word(nr, ptr);
140 mask = ~(1UL << (nr & (BITS_PER_LONG - 1)));
145 static inline bool arch_test_and_change_bit(unsigned long nr,
148 unsigned long *addr = __bitops_word(nr, ptr);
151 mask = 1UL << (nr & (BITS_PER_LONG - 1));
156 static inline void arch___set_bit(unsigned long nr, volatile unsigned long *ptr)
158 unsigned char *addr = __bitops_byte(nr, ptr);
160 *addr |= 1 << (nr & 7);
163 static inline void arch___clear_bit(unsigned long nr,
166 unsigned char *addr = __bitops_byte(nr, ptr);
168 *addr &= ~(1 << (nr & 7));
171 static inline void arch___change_bit(unsigned long nr,
174 unsigned char *addr = __bitops_byte(nr, ptr);
176 *addr ^= 1 << (nr & 7);
179 static inline bool arch___test_and_set_bit(unsigned long nr,
182 unsigned char *addr = __bitops_byte(nr, ptr);
186 *addr |= 1 << (nr & 7);
187 return (ch >> (nr & 7)) & 1;
190 static inline bool arch___test_and_clear_bit(unsigned long nr,
193 unsigned char *addr = __bitops_byte(nr, ptr);
197 *addr &= ~(1 << (nr & 7));
198 return (ch >> (nr & 7)) & 1;
201 static inline bool arch___test_and_change_bit(unsigned long nr,
204 unsigned char *addr = __bitops_byte(nr, ptr);
208 *addr ^= 1 << (nr & 7);
209 return (ch >> (nr & 7)) & 1;
212 static inline bool arch_test_bit(unsigned long nr,
218 addr += (nr ^ (BITS_PER_LONG - 8)) >> 3;
219 return (*addr >> (nr & 7)) & 1;
222 static inline bool arch_test_and_set_bit_lock(unsigned long nr,
225 if (arch_test_bit(nr, ptr))
227 return arch_test_and_set_bit(nr, ptr);
230 static inline void arch_clear_bit_unlock(unsigned long nr,
234 arch_clear_bit(nr, ptr);
237 static inline void arch___clear_bit_unlock(unsigned long nr,
241 arch___clear_bit(nr, ptr);
262 static inline void set_bit_inv(unsigned long nr, volatile unsigned long *ptr)
264 return set_bit(nr ^ (BITS_PER_LONG - 1), ptr);
267 static inline void clear_bit_inv(unsigned long nr, volatile unsigned long *ptr)
269 return clear_bit(nr ^ (BITS_PER_LONG - 1), ptr);
272 static inline bool test_and_clear_bit_inv(unsigned long nr,
275 return test_and_clear_bit(nr ^ (BITS_PER_LONG - 1), ptr);
278 static inline void __set_bit_inv(unsigned long nr, volatile unsigned long *ptr)
280 return __set_bit(nr ^ (BITS_PER_LONG - 1), ptr);
283 static inline void __clear_bit_inv(unsigned long nr, volatile unsigned long *ptr)
285 return __clear_bit(nr ^ (BITS_PER_LONG - 1), ptr);
288 static inline bool test_bit_inv(unsigned long nr,
291 return test_bit(nr ^ (BITS_PER_LONG - 1), ptr);