Lines Matching refs:PTR
154 __test_and_set_bit(unsigned int bit, volatile unsigned long *ptr)
156 const unsigned int units = (sizeof(*ptr) * CHAR_BIT);
157 volatile unsigned long *const p = &ptr[bit / units];
168 __test_and_clear_bit(unsigned int bit, volatile unsigned long *ptr)
170 const unsigned int units = (sizeof(*ptr) * CHAR_BIT);
171 volatile unsigned long *const p = &ptr[bit / units];
182 __test_and_change_bit(unsigned int bit, volatile unsigned long *ptr)
184 const unsigned int units = (sizeof(*ptr) * CHAR_BIT);
185 volatile unsigned long *const p = &ptr[bit / units];
196 __find_next_bit(const unsigned long *ptr, unsigned long nbits,
199 const size_t bpl = (CHAR_BIT * sizeof(*ptr));
200 const unsigned long *p = ptr + startbit/bpl;
244 result = bpl*(p - ptr);
254 find_next_bit(const unsigned long *ptr, unsigned long nbits,
257 return __find_next_bit(ptr, nbits, startbit, 0);
261 find_first_bit(const unsigned long *ptr, unsigned long nbits)
263 return find_next_bit(ptr, nbits, 0);
267 find_next_zero_bit(const unsigned long *ptr, unsigned long nbits,
270 return __find_next_bit(ptr, nbits, startbit, ~0UL);
274 find_first_zero_bit(const unsigned long *ptr, unsigned long nbits)
276 return find_next_zero_bit(ptr, nbits, 0);
279 #define for_each_set_bit(BIT, PTR, NBITS) \
280 for ((BIT) = find_first_bit((PTR), (NBITS)); \
282 (BIT) = find_next_bit((PTR), (NBITS), (BIT) + 1))
284 #define for_each_clear_bit(BIT, PTR, NBITS) \
285 for ((BIT) = find_first_zero_bit((PTR), (NBITS)); \
287 (BIT) = find_next_zero_bit((PTR), (NBITS), (BIT) + 1))
290 set_bit(unsigned int bit, volatile unsigned long *ptr)
292 const unsigned int units = (sizeof(*ptr) * CHAR_BIT);
295 atomic_or_ulong(&ptr[bit / units], (1UL << (bit % units)));
299 clear_bit(unsigned int bit, volatile unsigned long *ptr)
301 const unsigned int units = (sizeof(*ptr) * CHAR_BIT);
304 atomic_and_ulong(&ptr[bit / units], ~(1UL << (bit % units)));
308 clear_bit_unlock(unsigned int bit, volatile unsigned long *ptr)
310 const unsigned int units = (sizeof(*ptr) * CHAR_BIT);
314 atomic_and_ulong(&ptr[bit / units], ~(1UL << (bit % units)));
318 change_bit(unsigned int bit, volatile unsigned long *ptr)
320 const unsigned int units = (sizeof(*ptr) * CHAR_BIT);
321 volatile unsigned long *const p = &ptr[bit / units];
330 test_and_set_bit(unsigned int bit, volatile unsigned long *ptr)
332 const unsigned int units = (sizeof(*ptr) * CHAR_BIT);
333 volatile unsigned long *const p = &ptr[bit / units];
345 test_and_clear_bit(unsigned int bit, volatile unsigned long *ptr)
347 const unsigned int units = (sizeof(*ptr) * CHAR_BIT);
348 volatile unsigned long *const p = &ptr[bit / units];
360 test_and_change_bit(unsigned int bit, volatile unsigned long *ptr)
362 const unsigned int units = (sizeof(*ptr) * CHAR_BIT);
363 volatile unsigned long *const p = &ptr[bit / units];