Lines Matching +full:clear +full:- +full:bit
1 /* SPDX-License-Identifier: BSD-3-Clause */
50 /* Determine which chunk a bit belongs in */
53 #define BITS_TO_CHUNKS(sz) (((sz) + BITS_PER_CHUNK - 1) / BITS_PER_CHUNK)
54 /* Which bit inside a chunk this bit corresponds to */
57 #define LAST_CHUNK_BITS(nr) ((((nr) - 1) % BITS_PER_CHUNK) + 1)
60 (BITS_PER_CHUNK - LAST_CHUNK_BITS(nr)))
67 return !!(*bitmap & BIT(nr));
80 * and define macro ICE_ATOMIC_BITOPS to overwrite the default non-atomic
85 *bitmap &= ~BIT(nr);
90 *bitmap |= BIT(nr);
113 * ice_is_bit_set - Check state of a bit in a bitmap
115 * @nr: the bit to check
117 * Returns true if bit nr of bitmap is set. False otherwise. Assumes that nr
127 * ice_clear_bit - Clear a bit in a bitmap
129 * @nr: the bit to change
131 * Clears the bit nr in bitmap. Assumes that nr is less than the size of the
140 * ice_set_bit - Set a bit in a bitmap
142 * @nr: the bit to change
144 * Sets the bit nr in bitmap. Assumes that nr is less than the size of the
153 * ice_test_and_clear_bit - Atomically clear a bit and return the old bit value
154 * @nr: the bit to change
157 * Check and clear the bit nr in bitmap. Assumes that nr is less than the size
168 * ice_test_and_set_bit - Atomically set a bit and return the old bit value
169 * @nr: the bit to change
172 * Check and set the bit nr in bitmap. Assumes that nr is less than the size of
182 /* ice_zero_bitmap - set bits of bitmap to zero.
188 * will zero every bit in the last chunk, even if those bits are beyond the
198 * ice_and_bitmap - bitwise AND 2 bitmaps and store result in dst bitmap
207 * a non-zero value if at least one bit location from both "source" bitmaps is
208 * non-zero.
218 for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++) {
237 * ice_or_bitmap - bitwise OR 2 bitmaps and store result in dst bitmap
255 for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++)
268 * ice_xor_bitmap - bitwise XOR 2 bitmaps and store result in dst bitmap
286 for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++)
299 * ice_andnot_bitmap - bitwise ANDNOT 2 bitmaps and result in dst bitmap
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
330 * ice_find_next_bit - Find the index of the next set bit of a bitmap
335 * Scans the bitmap and returns the index of the first set bit which is equal
374 * ice_find_first_bit - Find the index of the first set bit of a bitmap
378 * Scans the bitmap and returns the index of the first set bit. Will return
392 * ice_is_any_bit_set - Return true of any bit in the bitmap is set
405 * ice_cp_bitmap - copy bitmaps
421 * ice_bitmap_set - set a number of bits in bitmap from a starting position
423 * @pos: first bit position to set
426 * This function sets bits in a bitmap from pos to (pos + num_bits) - 1.
440 * ice_bitmap_hweight - hamming weight of bitmap
452 u16 bit = 0;
454 while (size > (bit = ice_find_next_bit(bm, size, bit))) {
456 bit++;
463 * ice_cmp_bitmap - compares two bitmaps
477 for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++)
490 * ice_bitmap_from_array32 - copies u32 array source into bitmap destination
504 /* clear bitmap so we only have to set when iterating */
513 if (entry & BIT(j))
528 if (entry & BIT(j))