Lines Matching refs:size

21 extern unsigned long _find_first_bit(const unsigned long *addr, unsigned long size);
22 unsigned long __find_nth_bit(const unsigned long *addr, unsigned long size, unsigned long n);
24 unsigned long size, unsigned long n);
26 unsigned long size, unsigned long n);
28 const unsigned long *addr3, unsigned long size,
31 const unsigned long *addr2, unsigned long size);
32 extern unsigned long _find_first_zero_bit(const unsigned long *addr, unsigned long size);
33 extern unsigned long _find_last_bit(const unsigned long *addr, unsigned long size);
36 unsigned long _find_first_zero_bit_le(const unsigned long *addr, unsigned long size);
38 long size, unsigned long offset);
40 long size, unsigned long offset);
54 unsigned long find_next_bit(const unsigned long *addr, unsigned long size, in find_next_bit() argument
57 if (small_const_nbits(size)) { in find_next_bit()
60 if (unlikely(offset >= size)) in find_next_bit()
61 return size; in find_next_bit()
63 val = *addr & GENMASK(size - 1, offset); in find_next_bit()
64 return val ? __ffs(val) : size; in find_next_bit()
67 return _find_next_bit(addr, size, offset); in find_next_bit()
84 const unsigned long *addr2, unsigned long size, in find_next_and_bit() argument
87 if (small_const_nbits(size)) { in find_next_and_bit()
90 if (unlikely(offset >= size)) in find_next_and_bit()
91 return size; in find_next_and_bit()
93 val = *addr1 & *addr2 & GENMASK(size - 1, offset); in find_next_and_bit()
94 return val ? __ffs(val) : size; in find_next_and_bit()
97 return _find_next_and_bit(addr1, addr2, size, offset); in find_next_and_bit()
115 const unsigned long *addr2, unsigned long size, in find_next_andnot_bit() argument
118 if (small_const_nbits(size)) { in find_next_andnot_bit()
121 if (unlikely(offset >= size)) in find_next_andnot_bit()
122 return size; in find_next_andnot_bit()
124 val = *addr1 & ~*addr2 & GENMASK(size - 1, offset); in find_next_andnot_bit()
125 return val ? __ffs(val) : size; in find_next_andnot_bit()
128 return _find_next_andnot_bit(addr1, addr2, size, offset); in find_next_andnot_bit()
145 const unsigned long *addr2, unsigned long size, in find_next_or_bit() argument
148 if (small_const_nbits(size)) { in find_next_or_bit()
151 if (unlikely(offset >= size)) in find_next_or_bit()
152 return size; in find_next_or_bit()
154 val = (*addr1 | *addr2) & GENMASK(size - 1, offset); in find_next_or_bit()
155 return val ? __ffs(val) : size; in find_next_or_bit()
158 return _find_next_or_bit(addr1, addr2, size, offset); in find_next_or_bit()
173 unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, in find_next_zero_bit() argument
176 if (small_const_nbits(size)) { in find_next_zero_bit()
179 if (unlikely(offset >= size)) in find_next_zero_bit()
180 return size; in find_next_zero_bit()
182 val = *addr | ~GENMASK(size - 1, offset); in find_next_zero_bit()
183 return val == ~0UL ? size : ffz(val); in find_next_zero_bit()
186 return _find_next_zero_bit(addr, size, offset); in find_next_zero_bit()
200 unsigned long find_first_bit(const unsigned long *addr, unsigned long size) in find_first_bit() argument
202 if (small_const_nbits(size)) { in find_first_bit()
203 unsigned long val = *addr & GENMASK(size - 1, 0); in find_first_bit()
205 return val ? __ffs(val) : size; in find_first_bit()
208 return _find_first_bit(addr, size); in find_first_bit()
226 unsigned long find_nth_bit(const unsigned long *addr, unsigned long size, unsigned long n) in find_nth_bit() argument
228 if (n >= size) in find_nth_bit()
229 return size; in find_nth_bit()
231 if (small_const_nbits(size)) { in find_nth_bit()
232 unsigned long val = *addr & GENMASK(size - 1, 0); in find_nth_bit()
234 return val ? fns(val, n) : size; in find_nth_bit()
237 return __find_nth_bit(addr, size, n); in find_nth_bit()
252 unsigned long size, unsigned long n) in find_nth_and_bit() argument
254 if (n >= size) in find_nth_and_bit()
255 return size; in find_nth_and_bit()
257 if (small_const_nbits(size)) { in find_nth_and_bit()
258 unsigned long val = *addr1 & *addr2 & GENMASK(size - 1, 0); in find_nth_and_bit()
260 return val ? fns(val, n) : size; in find_nth_and_bit()
263 return __find_nth_and_bit(addr1, addr2, size, n); in find_nth_and_bit()
279 unsigned long size, unsigned long n) in find_nth_andnot_bit() argument
281 if (n >= size) in find_nth_andnot_bit()
282 return size; in find_nth_andnot_bit()
284 if (small_const_nbits(size)) { in find_nth_andnot_bit()
285 unsigned long val = *addr1 & (~*addr2) & GENMASK(size - 1, 0); in find_nth_andnot_bit()
287 return val ? fns(val, n) : size; in find_nth_andnot_bit()
290 return __find_nth_andnot_bit(addr1, addr2, size, n); in find_nth_andnot_bit()
309 unsigned long size, unsigned long n) in find_nth_and_andnot_bit() argument
311 if (n >= size) in find_nth_and_andnot_bit()
312 return size; in find_nth_and_andnot_bit()
314 if (small_const_nbits(size)) { in find_nth_and_andnot_bit()
315 unsigned long val = *addr1 & *addr2 & (~*addr3) & GENMASK(size - 1, 0); in find_nth_and_andnot_bit()
317 return val ? fns(val, n) : size; in find_nth_and_andnot_bit()
320 return __find_nth_and_andnot_bit(addr1, addr2, addr3, size, n); in find_nth_and_andnot_bit()
336 unsigned long size) in find_first_and_bit() argument
338 if (small_const_nbits(size)) { in find_first_and_bit()
339 unsigned long val = *addr1 & *addr2 & GENMASK(size - 1, 0); in find_first_and_bit()
341 return val ? __ffs(val) : size; in find_first_and_bit()
344 return _find_first_and_bit(addr1, addr2, size); in find_first_and_bit()
358 unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size) in find_first_zero_bit() argument
360 if (small_const_nbits(size)) { in find_first_zero_bit()
361 unsigned long val = *addr | ~GENMASK(size - 1, 0); in find_first_zero_bit()
363 return val == ~0UL ? size : ffz(val); in find_first_zero_bit()
366 return _find_first_zero_bit(addr, size); in find_first_zero_bit()
379 unsigned long find_last_bit(const unsigned long *addr, unsigned long size) in find_last_bit() argument
381 if (small_const_nbits(size)) { in find_last_bit()
382 unsigned long val = *addr & GENMASK(size - 1, 0); in find_last_bit()
384 return val ? __fls(val) : size; in find_last_bit()
387 return _find_last_bit(addr, size); in find_last_bit()
404 unsigned long size, unsigned long offset) in find_next_and_bit_wrap() argument
406 unsigned long bit = find_next_and_bit(addr1, addr2, size, offset); in find_next_and_bit_wrap()
408 if (bit < size) in find_next_and_bit_wrap()
412 return bit < offset ? bit : size; in find_next_and_bit_wrap()
426 unsigned long size, unsigned long offset) in find_next_bit_wrap() argument
428 unsigned long bit = find_next_bit(addr, size, offset); in find_next_bit_wrap()
430 if (bit < size) in find_next_bit_wrap()
434 return bit < offset ? bit : size; in find_next_bit_wrap()
442 unsigned long __for_each_wrap(const unsigned long *bitmap, unsigned long size, in __for_each_wrap() argument
450 bit = find_next_bit(bitmap, size, n); in __for_each_wrap()
451 if (bit < size) in __for_each_wrap()
460 return bit < start ? bit : size; in __for_each_wrap()
475 unsigned long size, unsigned long offset);
477 #define find_first_clump8(clump, bits, size) \ argument
478 find_next_clump8((clump), (bits), (size), 0)
483 unsigned long size, unsigned long offset) in find_next_zero_bit_le() argument
485 return find_next_zero_bit(addr, size, offset); in find_next_zero_bit_le()
489 unsigned long size, unsigned long offset) in find_next_bit_le() argument
491 return find_next_bit(addr, size, offset); in find_next_bit_le()
495 unsigned long size) in find_first_zero_bit_le() argument
497 return find_first_zero_bit(addr, size); in find_first_zero_bit_le()
505 long size, unsigned long offset) in find_next_zero_bit_le() argument
507 if (small_const_nbits(size)) { in find_next_zero_bit_le()
510 if (unlikely(offset >= size)) in find_next_zero_bit_le()
511 return size; in find_next_zero_bit_le()
513 val = swab(val) | ~GENMASK(size - 1, offset); in find_next_zero_bit_le()
514 return val == ~0UL ? size : ffz(val); in find_next_zero_bit_le()
517 return _find_next_zero_bit_le(addr, size, offset); in find_next_zero_bit_le()
523 unsigned long find_first_zero_bit_le(const void *addr, unsigned long size) in find_first_zero_bit_le() argument
525 if (small_const_nbits(size)) { in find_first_zero_bit_le()
526 unsigned long val = swab(*(const unsigned long *)addr) | ~GENMASK(size - 1, 0); in find_first_zero_bit_le()
528 return val == ~0UL ? size : ffz(val); in find_first_zero_bit_le()
531 return _find_first_zero_bit_le(addr, size); in find_first_zero_bit_le()
538 long size, unsigned long offset) in find_next_bit_le() argument
540 if (small_const_nbits(size)) { in find_next_bit_le()
543 if (unlikely(offset >= size)) in find_next_bit_le()
544 return size; in find_next_bit_le()
546 val = swab(val) & GENMASK(size - 1, offset); in find_next_bit_le()
547 return val ? __ffs(val) : size; in find_next_bit_le()
550 return _find_next_bit_le(addr, size, offset); in find_next_bit_le()
558 #define for_each_set_bit(bit, addr, size) \ argument
559 for ((bit) = 0; (bit) = find_next_bit((addr), (size), (bit)), (bit) < (size); (bit)++)
561 #define for_each_and_bit(bit, addr1, addr2, size) \ argument
563 (bit) = find_next_and_bit((addr1), (addr2), (size), (bit)), (bit) < (size);\
566 #define for_each_andnot_bit(bit, addr1, addr2, size) \ argument
568 (bit) = find_next_andnot_bit((addr1), (addr2), (size), (bit)), (bit) < (size);\
571 #define for_each_or_bit(bit, addr1, addr2, size) \ argument
573 (bit) = find_next_or_bit((addr1), (addr2), (size), (bit)), (bit) < (size);\
577 #define for_each_set_bit_from(bit, addr, size) \ argument
578 for (; (bit) = find_next_bit((addr), (size), (bit)), (bit) < (size); (bit)++)
580 #define for_each_clear_bit(bit, addr, size) \ argument
582 (bit) = find_next_zero_bit((addr), (size), (bit)), (bit) < (size); \
586 #define for_each_clear_bit_from(bit, addr, size) \ argument
587 for (; (bit) = find_next_zero_bit((addr), (size), (bit)), (bit) < (size); (bit)++)
596 #define for_each_set_bitrange(b, e, addr, size) \ argument
598 (b) = find_next_bit((addr), (size), b), \
599 (e) = find_next_zero_bit((addr), (size), (b) + 1), \
600 (b) < (size); \
610 #define for_each_set_bitrange_from(b, e, addr, size) \ argument
612 (b) = find_next_bit((addr), (size), (b)), \
613 (e) = find_next_zero_bit((addr), (size), (b) + 1), \
614 (b) < (size); \
624 #define for_each_clear_bitrange(b, e, addr, size) \ argument
626 (b) = find_next_zero_bit((addr), (size), (b)), \
627 (e) = find_next_bit((addr), (size), (b) + 1), \
628 (b) < (size); \
638 #define for_each_clear_bitrange_from(b, e, addr, size) \ argument
640 (b) = find_next_zero_bit((addr), (size), (b)), \
641 (e) = find_next_bit((addr), (size), (b) + 1), \
642 (b) < (size); \
653 #define for_each_set_bit_wrap(bit, addr, size, start) \ argument
654 for ((bit) = find_next_bit_wrap((addr), (size), (start)); \
655 (bit) < (size); \
656 (bit) = __for_each_wrap((addr), (size), (start), (bit) + 1))
665 #define for_each_set_clump8(start, clump, bits, size) \ argument
666 for ((start) = find_first_clump8(&(clump), (bits), (size)); \
667 (start) < (size); \
668 (start) = find_next_clump8(&(clump), (bits), (size), (start) + 8))