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_or_panic(size, SMP_CACHE_BYTES); in msi_bitmap_alloc()
128 /* the bitmap won't be freed from memblock allocator */ in msi_bitmap_alloc()
129 kmemleak_not_leak(bmp->bitmap); in msi_bitmap_alloc()
132 if (!bmp->bitmap) { in msi_bitmap_alloc()
133 pr_debug("msi_bitmap: ENOMEM allocating allocator bitmap!\n"); in msi_bitmap_alloc()
137 /* We zalloc'ed the bitmap, so all irqs are free by default */ in msi_bitmap_alloc()
148 kfree(bmp->bitmap); in msi_bitmap_free()
150 bmp->bitmap = NULL; in msi_bitmap_free()
160 /* Can't allocate a bitmap of 0 irqs */ in test_basics()
167 WARN_ON(bitmap_find_free_region(bmp.bitmap, size, get_count_order(size))); in test_basics()
168 bitmap_release_region(bmp.bitmap, 0, get_count_order(size)); in test_basics()
174 WARN_ON(bitmap_find_free_region(bmp.bitmap, size, get_count_order(size))); in test_basics()
175 bitmap_release_region(bmp.bitmap, 0, get_count_order(size)); in test_basics()
184 WARN_ON(bitmap_find_free_region(bmp.bitmap, size, 0) >= 0); in test_basics()
211 /* Clients may WARN_ON bitmap == NULL for "not-allocated" */ in test_basics()
212 WARN_ON(bmp.bitmap != NULL); in test_basics()
238 WARN_ON(bitmap_find_free_region(bmp.bitmap, SIZE_EXPECTED, in test_of_node()
240 bitmap_release_region(bmp.bitmap, 0, get_count_order(SIZE_EXPECTED)); in test_of_node()
257 WARN_ON(!bitmap_equal(expected, bmp.bitmap, SIZE_EXPECTED)); in test_of_node()
260 kfree(bmp.bitmap); in test_of_node()
265 printk(KERN_DEBUG "Running MSI bitmap self-tests ...\n"); in msi_bitmap_selftest()