Lines Matching refs:nbits

104 			unsigned shift, unsigned nbits)  in __bitmap_shift_right()  argument
106 unsigned k, lim = BITS_TO_LONGS(nbits); in __bitmap_shift_right()
108 unsigned long mask = BITMAP_LAST_WORD_MASK(nbits); in __bitmap_shift_right()
149 unsigned int shift, unsigned int nbits) in __bitmap_shift_left() argument
152 unsigned int lim = BITS_TO_LONGS(nbits); in __bitmap_shift_left()
211 unsigned int first, unsigned int cut, unsigned int nbits) in bitmap_cut() argument
213 unsigned int len = BITS_TO_LONGS(nbits); in bitmap_cut()
296 const unsigned long *mask, unsigned int nbits) in __bitmap_replace() argument
299 unsigned int nr = BITS_TO_LONGS(nbits); in __bitmap_replace()
650 unsigned int nbits; member
666 if (r->end >= r->nbits) in bitmap_check_region()
730 unsigned int lastbit = r->nbits - 1; in bitmap_parse_region()
812 r.nbits = nmaskbits; in bitmap_parselist()
813 bitmap_zero(maskp, r.nbits); in bitmap_parselist()
963 static int bitmap_pos_to_ord(const unsigned long *buf, unsigned int pos, unsigned int nbits) in bitmap_pos_to_ord() argument
965 if (pos >= nbits || !test_bit(pos, buf)) in bitmap_pos_to_ord()
1005 unsigned int nbits) in bitmap_remap() argument
1011 bitmap_zero(dst, nbits); in bitmap_remap()
1013 w = bitmap_weight(new, nbits); in bitmap_remap()
1014 for_each_set_bit(oldbit, src, nbits) { in bitmap_remap()
1015 int n = bitmap_pos_to_ord(old, oldbit, nbits); in bitmap_remap()
1020 set_bit(find_nth_bit(new, nbits, n % w), dst); in bitmap_remap()
1210 unsigned int sz, unsigned int nbits) in bitmap_fold() argument
1216 bitmap_zero(dst, nbits); in bitmap_fold()
1218 for_each_set_bit(oldbit, orig, nbits) in bitmap_fold()
1372 void bitmap_copy_le(unsigned long *dst, const unsigned long *src, unsigned int nbits) in bitmap_copy_le() argument
1376 for (i = 0; i < nbits/BITS_PER_LONG; i++) { in bitmap_copy_le()
1386 unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags) in bitmap_alloc() argument
1388 return kmalloc_array(BITS_TO_LONGS(nbits), sizeof(unsigned long), in bitmap_alloc()
1393 unsigned long *bitmap_zalloc(unsigned int nbits, gfp_t flags) in bitmap_zalloc() argument
1395 return bitmap_alloc(nbits, flags | __GFP_ZERO); in bitmap_zalloc()
1399 unsigned long *bitmap_alloc_node(unsigned int nbits, gfp_t flags, int node) in bitmap_alloc_node() argument
1401 return kmalloc_array_node(BITS_TO_LONGS(nbits), sizeof(unsigned long), in bitmap_alloc_node()
1406 unsigned long *bitmap_zalloc_node(unsigned int nbits, gfp_t flags, int node) in bitmap_zalloc_node() argument
1408 return bitmap_alloc_node(nbits, flags | __GFP_ZERO, node); in bitmap_zalloc_node()
1426 unsigned int nbits, gfp_t flags) in devm_bitmap_alloc() argument
1431 bitmap = bitmap_alloc(nbits, flags); in devm_bitmap_alloc()
1444 unsigned int nbits, gfp_t flags) in devm_bitmap_zalloc() argument
1446 return devm_bitmap_alloc(dev, nbits, flags | __GFP_ZERO); in devm_bitmap_zalloc()
1457 void bitmap_from_arr32(unsigned long *bitmap, const u32 *buf, unsigned int nbits) in bitmap_from_arr32() argument
1461 halfwords = DIV_ROUND_UP(nbits, 32); in bitmap_from_arr32()
1469 if (nbits % BITS_PER_LONG) in bitmap_from_arr32()
1470 bitmap[(halfwords - 1) / 2] &= BITMAP_LAST_WORD_MASK(nbits); in bitmap_from_arr32()
1480 void bitmap_to_arr32(u32 *buf, const unsigned long *bitmap, unsigned int nbits) in bitmap_to_arr32() argument
1484 halfwords = DIV_ROUND_UP(nbits, 32); in bitmap_to_arr32()
1492 if (nbits % BITS_PER_LONG) in bitmap_to_arr32()
1493 buf[halfwords - 1] &= (u32) (UINT_MAX >> ((-nbits) & 31)); in bitmap_to_arr32()
1505 void bitmap_from_arr64(unsigned long *bitmap, const u64 *buf, unsigned int nbits) in bitmap_from_arr64() argument
1509 for (n = nbits; n > 0; n -= 64) { in bitmap_from_arr64()
1524 if (nbits % BITS_PER_LONG) in bitmap_from_arr64()
1525 bitmap[-1] &= BITMAP_LAST_WORD_MASK(nbits); in bitmap_from_arr64()
1535 void bitmap_to_arr64(u64 *buf, const unsigned long *bitmap, unsigned int nbits) in bitmap_to_arr64() argument
1537 const unsigned long *end = bitmap + BITS_TO_LONGS(nbits); in bitmap_to_arr64()
1547 if (nbits % 64) in bitmap_to_arr64()
1548 buf[-1] &= GENMASK_ULL((nbits - 1) % 64, 0); in bitmap_to_arr64()