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()
505 unsigned long *bitmap, int nbits) in bitmap_set_region() argument
509 if (r->end >= nbits) in bitmap_set_region()
798 static int bitmap_pos_to_ord(const unsigned long *buf, unsigned int pos, unsigned int nbits) in bitmap_pos_to_ord() argument
800 if (pos >= nbits || !test_bit(pos, buf)) in bitmap_pos_to_ord()
824 unsigned int bitmap_ord_to_pos(const unsigned long *buf, unsigned int ord, unsigned int nbits) in bitmap_ord_to_pos() argument
828 for (pos = find_first_bit(buf, nbits); in bitmap_ord_to_pos()
829 pos < nbits && ord; in bitmap_ord_to_pos()
830 pos = find_next_bit(buf, nbits, pos + 1)) in bitmap_ord_to_pos()
870 unsigned int nbits) in bitmap_remap() argument
876 bitmap_zero(dst, nbits); in bitmap_remap()
878 w = bitmap_weight(new, nbits); in bitmap_remap()
879 for_each_set_bit(oldbit, src, nbits) { in bitmap_remap()
880 int n = bitmap_pos_to_ord(old, oldbit, nbits); in bitmap_remap()
885 set_bit(bitmap_ord_to_pos(new, n % w, nbits), dst); in bitmap_remap()
1072 unsigned int sz, unsigned int nbits) in bitmap_fold() argument
1078 bitmap_zero(dst, nbits); in bitmap_fold()
1080 for_each_set_bit(oldbit, orig, nbits) in bitmap_fold()
1234 void bitmap_copy_le(unsigned long *dst, const unsigned long *src, unsigned int nbits) in bitmap_copy_le() argument
1238 for (i = 0; i < nbits/BITS_PER_LONG; i++) { in bitmap_copy_le()
1248 unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags) in bitmap_alloc() argument
1250 return kmalloc_array(BITS_TO_LONGS(nbits), sizeof(unsigned long), in bitmap_alloc()
1255 unsigned long *bitmap_zalloc(unsigned int nbits, gfp_t flags) in bitmap_zalloc() argument
1257 return bitmap_alloc(nbits, flags | __GFP_ZERO); in bitmap_zalloc()
1275 unsigned int nbits, gfp_t flags) in devm_bitmap_alloc() argument
1280 bitmap = bitmap_alloc(nbits, flags); in devm_bitmap_alloc()
1293 unsigned int nbits, gfp_t flags) in devm_bitmap_zalloc() argument
1295 return devm_bitmap_alloc(dev, nbits, flags | __GFP_ZERO); in devm_bitmap_zalloc()
1306 void bitmap_from_arr32(unsigned long *bitmap, const u32 *buf, unsigned int nbits) in bitmap_from_arr32() argument
1310 halfwords = DIV_ROUND_UP(nbits, 32); in bitmap_from_arr32()
1318 if (nbits % BITS_PER_LONG) in bitmap_from_arr32()
1319 bitmap[(halfwords - 1) / 2] &= BITMAP_LAST_WORD_MASK(nbits); in bitmap_from_arr32()
1329 void bitmap_to_arr32(u32 *buf, const unsigned long *bitmap, unsigned int nbits) in bitmap_to_arr32() argument
1333 halfwords = DIV_ROUND_UP(nbits, 32); in bitmap_to_arr32()
1341 if (nbits % BITS_PER_LONG) in bitmap_to_arr32()
1342 buf[halfwords - 1] &= (u32) (UINT_MAX >> ((-nbits) & 31)); in bitmap_to_arr32()