Lines Matching refs:nbits
102 unsigned shift, unsigned nbits) in __bitmap_shift_right() argument
104 unsigned k, lim = BITS_TO_LONGS(nbits); in __bitmap_shift_right()
106 unsigned long mask = BITMAP_LAST_WORD_MASK(nbits); in __bitmap_shift_right()
147 unsigned int shift, unsigned int nbits) in __bitmap_shift_left() argument
150 unsigned int lim = BITS_TO_LONGS(nbits); in __bitmap_shift_left()
209 unsigned int first, unsigned int cut, unsigned int nbits) in bitmap_cut() argument
211 unsigned int len = BITS_TO_LONGS(nbits); in bitmap_cut()
294 const unsigned long *mask, unsigned int nbits) in __bitmap_replace() argument
297 unsigned int nr = BITS_TO_LONGS(nbits); in __bitmap_replace()
503 unsigned long *bitmap, int nbits) in bitmap_set_region() argument
507 if (r->end >= nbits) in bitmap_set_region()
796 static int bitmap_pos_to_ord(const unsigned long *buf, unsigned int pos, unsigned int nbits) in bitmap_pos_to_ord() argument
798 if (pos >= nbits || !test_bit(pos, buf)) in bitmap_pos_to_ord()
822 unsigned int bitmap_ord_to_pos(const unsigned long *buf, unsigned int ord, unsigned int nbits) in bitmap_ord_to_pos() argument
826 for (pos = find_first_bit(buf, nbits); in bitmap_ord_to_pos()
827 pos < nbits && ord; in bitmap_ord_to_pos()
828 pos = find_next_bit(buf, nbits, pos + 1)) in bitmap_ord_to_pos()
868 unsigned int nbits) in bitmap_remap() argument
874 bitmap_zero(dst, nbits); in bitmap_remap()
876 w = bitmap_weight(new, nbits); in bitmap_remap()
877 for_each_set_bit(oldbit, src, nbits) { in bitmap_remap()
878 int n = bitmap_pos_to_ord(old, oldbit, nbits); in bitmap_remap()
883 set_bit(bitmap_ord_to_pos(new, n % w, nbits), dst); in bitmap_remap()
1070 unsigned int sz, unsigned int nbits) in bitmap_fold() argument
1076 bitmap_zero(dst, nbits); in bitmap_fold()
1078 for_each_set_bit(oldbit, orig, nbits) in bitmap_fold()
1232 void bitmap_copy_le(unsigned long *dst, const unsigned long *src, unsigned int nbits) in bitmap_copy_le() argument
1236 for (i = 0; i < nbits/BITS_PER_LONG; i++) { in bitmap_copy_le()
1246 unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags) in bitmap_alloc() argument
1248 return kmalloc_array(BITS_TO_LONGS(nbits), sizeof(unsigned long), in bitmap_alloc()
1253 unsigned long *bitmap_zalloc(unsigned int nbits, gfp_t flags) in bitmap_zalloc() argument
1255 return bitmap_alloc(nbits, flags | __GFP_ZERO); in bitmap_zalloc()
1272 void bitmap_from_arr32(unsigned long *bitmap, const u32 *buf, unsigned int nbits) in bitmap_from_arr32() argument
1276 halfwords = DIV_ROUND_UP(nbits, 32); in bitmap_from_arr32()
1284 if (nbits % BITS_PER_LONG) in bitmap_from_arr32()
1285 bitmap[(halfwords - 1) / 2] &= BITMAP_LAST_WORD_MASK(nbits); in bitmap_from_arr32()
1295 void bitmap_to_arr32(u32 *buf, const unsigned long *bitmap, unsigned int nbits) in bitmap_to_arr32() argument
1299 halfwords = DIV_ROUND_UP(nbits, 32); in bitmap_to_arr32()
1307 if (nbits % BITS_PER_LONG) in bitmap_to_arr32()
1308 buf[halfwords - 1] &= (u32) (UINT_MAX >> ((-nbits) & 31)); in bitmap_to_arr32()