Lines Matching full:bitmap
60 struct ck_bitmap bitmap; \
64 ck_bitmap_iterator_init((a), &(b)->bitmap)
67 ck_bitmap_init(&(a)->bitmap, (b), (c))
70 ck_bitmap_next(&(a)->bitmap, (b), (c))
73 ck_bitmap_set(&(a)->bitmap, (b))
76 ck_bitmap_bts(&(a)->bitmap, (b))
79 ck_bitmap_reset(&(a)->bitmap, (b))
82 ck_bitmap_test(&(a)->bitmap, (b))
85 ck_bitmap_union(&(a)->bitmap, &(b)->bitmap)
88 ck_bitmap_intersection(&(a)->bitmap, &(b)->bitmap)
91 ck_bitmap_intersection_negate(&(a)->bitmap, &(b)->bitmap)
94 ck_bitmap_clear(&(a)->bitmap)
97 ck_bitmap_empty(&(a)->bitmap, b)
100 ck_bitmap_full(&(a)->bitmap, b)
103 ck_bitmap_count(&(a)->bitmap, b)
106 ck_bitmap_count_intersect(&(a)->bitmap, b, c)
109 ck_bitmap_bits(&(a)->bitmap)
112 ck_bitmap_buffer(&(a)->bitmap)
115 (&(a)->bitmap)
149 * Returns total number of bits in specified bitmap.
152 ck_bitmap_bits(const struct ck_bitmap *bitmap) in ck_bitmap_bits() argument
155 return bitmap->n_bits; in ck_bitmap_bits()
160 * with the specified bitmap.
163 ck_bitmap_buffer(struct ck_bitmap *bitmap) in ck_bitmap_buffer() argument
166 return bitmap->map; in ck_bitmap_buffer()
173 ck_bitmap_set(struct ck_bitmap *bitmap, unsigned int n) in ck_bitmap_set() argument
176 ck_pr_or_uint(CK_BITMAP_PTR(bitmap->map, n), CK_BITMAP_BIT(n)); in ck_bitmap_set()
187 ck_bitmap_bts(struct ck_bitmap *bitmap, unsigned int n) in ck_bitmap_bts() argument
190 return ck_pr_bts_uint(CK_BITMAP_PTR(bitmap->map, n), in ck_bitmap_bts()
198 ck_bitmap_reset(struct ck_bitmap *bitmap, unsigned int n) in ck_bitmap_reset() argument
201 ck_pr_and_uint(CK_BITMAP_PTR(bitmap->map, n), ~CK_BITMAP_BIT(n)); in ck_bitmap_reset()
210 ck_bitmap_test(const struct ck_bitmap *bitmap, unsigned int n) in ck_bitmap_test() argument
214 block = ck_pr_load_uint(CK_BITMAP_PTR(bitmap->map, n)); in ck_bitmap_test()
219 * Combines bits from second bitmap into the first bitmap. This is not a
220 * linearized operation with respect to the complete bitmap.
241 * Intersects bits from second bitmap into the first bitmap. This is
242 * not a linearized operation with respect to the complete bitmap.
269 * Intersects the complement of bits from second bitmap into the first
270 * bitmap. This is not a linearized operation with respect to the
271 * complete bitmap. Any trailing bit in dst is left as is.
293 * Resets all bits in the provided bitmap. This is not a linearized
297 ck_bitmap_clear(struct ck_bitmap *bitmap) in ck_bitmap_clear() argument
300 unsigned int n_buckets = ck_bitmap_base(bitmap->n_bits) / in ck_bitmap_clear()
304 ck_pr_store_uint(&bitmap->map[i], 0); in ck_bitmap_clear()
310 * Returns true if the first limit bits in bitmap are cleared. If
311 * limit is greater than the bitmap size, limit is truncated to that
315 ck_bitmap_empty(const ck_bitmap_t *bitmap, unsigned int limit) in ck_bitmap_empty() argument
319 if (limit > bitmap->n_bits) in ck_bitmap_empty()
320 limit = bitmap->n_bits; in ck_bitmap_empty()
325 if (ck_pr_load_uint(&bitmap->map[i]) != 0) { in ck_bitmap_empty()
333 word = ck_pr_load_uint(&bitmap->map[i]); in ck_bitmap_empty()
342 * Returns true if the first limit bits in bitmap are set. If limit
343 * is greater than the bitmap size, limit is truncated to that size.
346 ck_bitmap_full(const ck_bitmap_t *bitmap, unsigned int limit) in ck_bitmap_full() argument
350 if (limit > bitmap->n_bits) { in ck_bitmap_full()
351 limit = bitmap->n_bits; in ck_bitmap_full()
357 if (ck_pr_load_uint(&bitmap->map[i]) != -1U) in ck_bitmap_full()
364 word = ~ck_pr_load_uint(&bitmap->map[i]); in ck_bitmap_full()
372 * Returns the number of set bit in bitmap, upto (and excluding)
373 * limit. If limit is greater than the bitmap size, it is truncated
377 ck_bitmap_count(const ck_bitmap_t *bitmap, unsigned int limit) in ck_bitmap_count() argument
381 if (limit > bitmap->n_bits) in ck_bitmap_count()
382 limit = bitmap->n_bits; in ck_bitmap_count()
387 count += ck_cc_popcount(ck_pr_load_uint(&bitmap->map[i])); in ck_bitmap_count()
392 word = ck_pr_load_uint(&bitmap->map[i]); in ck_bitmap_count()
400 * upto (and excluding) limit. If limit is greater than either bitmap
442 ck_bitmap_init(struct ck_bitmap *bitmap, in ck_bitmap_init() argument
448 bitmap->n_bits = n_bits; in ck_bitmap_init()
449 memset(bitmap->map, -(int)set, base); in ck_bitmap_init()
457 *CK_BITMAP_PTR(bitmap->map, n_bits - 1) &= (1U << b) - 1U; in ck_bitmap_init()
464 * Initialize iterator for use with provided bitmap.
468 const struct ck_bitmap *bitmap) in ck_bitmap_iterator_init() argument
472 i->n_limit = CK_BITMAP_BLOCKS(bitmap->n_bits); in ck_bitmap_iterator_init()
474 i->cache = ck_pr_load_uint(&bitmap->map[0]); in ck_bitmap_iterator_init()
485 ck_bitmap_next(const struct ck_bitmap *bitmap, in ck_bitmap_next() argument
498 cache = ck_pr_load_uint(&bitmap->map[n_block]); in ck_bitmap_next()