Lines Matching refs:bit_nr

132 static int axmap_handler(struct axmap *axmap, uint64_t bit_nr,  in axmap_handler()  argument
140 unsigned long index = ulog64(bit_nr, i); in axmap_handler()
153 static int axmap_handler_topdown(struct axmap *axmap, uint64_t bit_nr, in axmap_handler_topdown() argument
161 unsigned long index = ulog64(bit_nr, --level); in axmap_handler_topdown()
184 void axmap_clear(struct axmap *axmap, uint64_t bit_nr) in axmap_clear() argument
186 axmap_handler(axmap, bit_nr, axmap_clear_fn, NULL); in axmap_clear()
254 static void __axmap_set(struct axmap *axmap, uint64_t bit_nr, in __axmap_set() argument
259 if (axmap->first_free >= bit_nr && in __axmap_set()
260 axmap->first_free < bit_nr + data->nr_bits) in __axmap_set()
263 if (bit_nr > axmap->nr_bits) in __axmap_set()
265 else if (bit_nr + nr_bits > axmap->nr_bits) in __axmap_set()
266 nr_bits = axmap->nr_bits - bit_nr; in __axmap_set()
270 axmap_handler(axmap, bit_nr, axmap_set_fn, data); in __axmap_set()
278 bit_nr += data->set_bits; in __axmap_set()
286 void axmap_set(struct axmap *axmap, uint64_t bit_nr) in axmap_set() argument
290 __axmap_set(axmap, bit_nr, &data); in axmap_set()
293 unsigned int axmap_set_nr(struct axmap *axmap, uint64_t bit_nr, unsigned int nr_bits) in axmap_set_nr() argument
301 max_bits = BLOCKS_PER_UNIT - (bit_nr & BLOCKS_PER_UNIT_MASK); in axmap_set_nr()
306 __axmap_set(axmap, bit_nr, &data); in axmap_set_nr()
312 bit_nr += data.set_bits; in axmap_set_nr()
324 int axmap_isset(struct axmap *axmap, uint64_t bit_nr) in axmap_isset() argument
326 if (bit_nr <= axmap->nr_bits) in axmap_isset()
327 return axmap_handler_topdown(axmap, bit_nr, axmap_isset_fn, NULL); in axmap_isset()
409 uint64_t axmap_next_free(struct axmap *axmap, uint64_t bit_nr) in axmap_next_free() argument
411 struct axmap_next_free_data data = { .level = -1U, .bit = bit_nr, }; in axmap_next_free()
414 if (firstfree_valid(axmap) && bit_nr < axmap->first_free) in axmap_next_free()
417 if (!axmap_handler(axmap, bit_nr, axmap_next_free_fn, &data)) in axmap_next_free()