Lines Matching full:size
38 /* Define the size of the bitmap chunk */
118 * is less than the size of the bitmap.
131 * Clears the bit nr in bitmap. Assumes that nr is less than the size of the
144 * Sets the bit nr in bitmap. Assumes that nr is less than the size of the
157 * Check and clear the bit nr in bitmap. Assumes that nr is less than the size
172 * Check and set the bit nr in bitmap. Assumes that nr is less than the size of
184 * @size: Size of the bitmaps in bits
189 * size.
191 static inline void ice_zero_bitmap(ice_bitmap_t *bmp, u16 size)
193 ice_memset(bmp, 0, BITS_TO_CHUNKS(size) * sizeof(ice_bitmap_t),
202 * @size: Size of the bitmaps in bits
204 * This function performs a bitwise AND on two "source" bitmaps of the same size
206 * size as the "source" bitmaps to avoid buffer overflows. This function returns
212 const ice_bitmap_t *bmp2, u16 size)
218 for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++) {
224 * size, even in the destination bitmap. Thus, we won't directly
226 * modify bits which are within the size, and leave any bits above the
227 * size value alone.
229 mask = LAST_CHUNK_MASK(size);
241 * @size: Size of the bitmaps in bits
243 * This function performs a bitwise OR on two "source" bitmaps of the same size
245 * size as the "source" bitmaps to avoid buffer overflows.
249 const ice_bitmap_t *bmp2, u16 size)
255 for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++)
258 /* We want to only OR bits within the size. Furthermore, we also do
260 * size. Use a bitmask to ensure that we only modify the bits that are
261 * within the specified size.
263 mask = LAST_CHUNK_MASK(size);
272 * @size: Size of the bitmaps in bits
274 * This function performs a bitwise XOR on two "source" bitmaps of the same size
276 * size as the "source" bitmaps to avoid buffer overflows.
280 const ice_bitmap_t *bmp2, u16 size)
286 for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++)
289 /* We want to only XOR bits within the size. Furthermore, we also do
291 * size. Use a bitmask to ensure that we only modify the bits that are
292 * within the specified size.
294 mask = LAST_CHUNK_MASK(size);
303 * @size: Size of the bitmaps in bits
306 * size, and stores the result to "dst" bitmap. The "dst" bitmap must be of the
307 * same size as the "source" bitmaps to avoid buffer overflows.
311 const ice_bitmap_t *bmp2, u16 size)
317 for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++)
320 /* We want to only clear bits within the size. Furthermore, we also do
322 * size. Use a bitmask to ensure that we only modify the bits that are
323 * within the specified size.
325 mask = LAST_CHUNK_MASK(size);
332 * @size: the size in bits of the bitmap
336 * to or after the specified offset. Will return size if no bits are set.
339 ice_find_next_bit(const ice_bitmap_t *bitmap, u16 size, u16 offset)
343 if (offset >= size)
344 return size;
355 return min(size, (u16)(off + j));
360 for (i++; i < BITS_TO_CHUNKS(size); i++) {
366 return min(size, (u16)(off + j));
370 return size;
376 * @size: the size in bits of the bitmap
379 * size if no bits are set.
381 static inline u16 ice_find_first_bit(const ice_bitmap_t *bitmap, u16 size)
383 return ice_find_next_bit(bitmap, size, 0);
394 * @size: the size of the bitmap
397 * bitmap size.
399 static inline bool ice_is_any_bit_set(ice_bitmap_t *bitmap, u16 size)
401 return ice_find_first_bit(bitmap, size) < size;
408 * @size: Size of the bitmaps in bits
412 * the entire last chunk even if this contains bits beyond the size.
414 static inline void ice_cp_bitmap(ice_bitmap_t *dst, ice_bitmap_t *src, u16 size)
416 ice_memcpy(dst, src, BITS_TO_CHUNKS(size) * sizeof(ice_bitmap_t),
442 * @size: size of bitmap (in bits)
449 ice_bitmap_hweight(ice_bitmap_t *bm, u16 size)
454 while (size > (bit = ice_find_next_bit(bm, size, bit))) {
466 * @size: Size of the bitmaps in bits
471 ice_cmp_bitmap(ice_bitmap_t *bmp1, ice_bitmap_t *bmp2, u16 size)
477 for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++)
481 /* We want to only compare bits within the size */
482 mask = LAST_CHUNK_MASK(size);
493 * @size: size of the bitmap (in bits)
499 ice_bitmap_from_array32(ice_bitmap_t *dst, u32 *src, u16 size)
505 ice_zero_bitmap(dst, size);
507 for (i = 0; i < (u32)(size / BITS_PER_U32); i++) {
518 /* still need to check the leftover bits (i.e. if size isn't evenly
521 remaining_bits = size % BITS_PER_U32;