Lines Matching refs:buf
457 static int bitmap_pos_to_ord(const unsigned long *buf, unsigned int pos, unsigned int nbits) in bitmap_pos_to_ord() argument
459 if (pos >= nbits || !test_bit(pos, buf)) in bitmap_pos_to_ord()
462 return bitmap_weight(buf, pos); in bitmap_pos_to_ord()
788 void bitmap_from_arr32(unsigned long *bitmap, const u32 *buf, unsigned int nbits) in bitmap_from_arr32() argument
794 bitmap[i/2] = (unsigned long) buf[i]; in bitmap_from_arr32()
796 bitmap[i/2] |= ((unsigned long) buf[i]) << 32; in bitmap_from_arr32()
811 void bitmap_to_arr32(u32 *buf, const unsigned long *bitmap, unsigned int nbits) in bitmap_to_arr32() argument
817 buf[i] = (u32) (bitmap[i/2] & UINT_MAX); in bitmap_to_arr32()
819 buf[i] = (u32) (bitmap[i/2] >> 32); in bitmap_to_arr32()
824 buf[halfwords - 1] &= (u32) (UINT_MAX >> ((-nbits) & 31)); in bitmap_to_arr32()
836 void bitmap_from_arr64(unsigned long *bitmap, const u64 *buf, unsigned int nbits) in bitmap_from_arr64() argument
841 u64 val = *buf++; in bitmap_from_arr64()
866 void bitmap_to_arr64(u64 *buf, const unsigned long *bitmap, unsigned int nbits) in bitmap_to_arr64() argument
871 *buf = *bitmap++; in bitmap_to_arr64()
873 *buf |= (u64)(*bitmap++) << 32; in bitmap_to_arr64()
874 buf++; in bitmap_to_arr64()
879 buf[-1] &= GENMASK_ULL((nbits - 1) % 64, 0); in bitmap_to_arr64()