Lines Matching full:bitmap
9 #include <linux/bitmap.h>
22 offset = bitmap_find_next_zero_area(bmp->bitmap, bmp->irq_count, 0, in msi_bitmap_alloc_hwirqs()
27 bitmap_set(bmp->bitmap, offset, num); in msi_bitmap_alloc_hwirqs()
48 bitmap_clear(bmp->bitmap, offset, num); in msi_bitmap_free_hwirqs()
60 bitmap_allocate_region(bmp->bitmap, hwirq, 0); in msi_bitmap_reserve_hwirq()
66 * @bmp: pointer to the MSI bitmap.
70 * are reserved in the bitmap.
96 bitmap_allocate_region(bmp->bitmap, 0, get_count_order(bmp->irq_count)); in msi_bitmap_reserve_dt_hwirqs()
104 bitmap_release_region(bmp->bitmap, *p + j, 0); in msi_bitmap_reserve_dt_hwirqs()
121 pr_debug("msi_bitmap: allocator bitmap size is 0x%x bytes\n", size); in msi_bitmap_alloc()
125 bmp->bitmap = kzalloc(size, GFP_KERNEL); in msi_bitmap_alloc()
127 bmp->bitmap = memblock_alloc(size, SMP_CACHE_BYTES); in msi_bitmap_alloc()
128 if (!bmp->bitmap) in msi_bitmap_alloc()
131 /* the bitmap won't be freed from memblock allocator */ in msi_bitmap_alloc()
132 kmemleak_not_leak(bmp->bitmap); in msi_bitmap_alloc()
135 if (!bmp->bitmap) { in msi_bitmap_alloc()
136 pr_debug("msi_bitmap: ENOMEM allocating allocator bitmap!\n"); in msi_bitmap_alloc()
140 /* We zalloc'ed the bitmap, so all irqs are free by default */ in msi_bitmap_alloc()
151 kfree(bmp->bitmap); in msi_bitmap_free()
153 bmp->bitmap = NULL; in msi_bitmap_free()
163 /* Can't allocate a bitmap of 0 irqs */ in test_basics()
170 WARN_ON(bitmap_find_free_region(bmp.bitmap, size, get_count_order(size))); in test_basics()
171 bitmap_release_region(bmp.bitmap, 0, get_count_order(size)); in test_basics()
177 WARN_ON(bitmap_find_free_region(bmp.bitmap, size, get_count_order(size))); in test_basics()
178 bitmap_release_region(bmp.bitmap, 0, get_count_order(size)); in test_basics()
187 WARN_ON(bitmap_find_free_region(bmp.bitmap, size, 0) >= 0); in test_basics()
214 /* Clients may WARN_ON bitmap == NULL for "not-allocated" */ in test_basics()
215 WARN_ON(bmp.bitmap != NULL); in test_basics()
241 WARN_ON(bitmap_find_free_region(bmp.bitmap, SIZE_EXPECTED, in test_of_node()
243 bitmap_release_region(bmp.bitmap, 0, get_count_order(SIZE_EXPECTED)); in test_of_node()
260 WARN_ON(!bitmap_equal(expected, bmp.bitmap, SIZE_EXPECTED)); in test_of_node()
263 kfree(bmp.bitmap); in test_of_node()
268 printk(KERN_DEBUG "Running MSI bitmap self-tests ...\n"); in msi_bitmap_selftest()