• Home
  • Raw
  • Download

Lines Matching full:bitmap

9 #include <linux/bitmap.h>
21 offset = bitmap_find_next_zero_area(bmp->bitmap, bmp->irq_count, 0, in msi_bitmap_alloc_hwirqs()
26 bitmap_set(bmp->bitmap, offset, num); in msi_bitmap_alloc_hwirqs()
47 bitmap_clear(bmp->bitmap, offset, num); in msi_bitmap_free_hwirqs()
59 bitmap_allocate_region(bmp->bitmap, hwirq, 0); in msi_bitmap_reserve_hwirq()
65 * @bmp: pointer to the MSI bitmap.
69 * are reserved in the bitmap.
95 bitmap_allocate_region(bmp->bitmap, 0, get_count_order(bmp->irq_count)); in msi_bitmap_reserve_dt_hwirqs()
103 bitmap_release_region(bmp->bitmap, *p + j, 0); in msi_bitmap_reserve_dt_hwirqs()
120 pr_debug("msi_bitmap: allocator bitmap size is 0x%x bytes\n", size); in msi_bitmap_alloc()
124 bmp->bitmap = kzalloc(size, GFP_KERNEL); in msi_bitmap_alloc()
126 bmp->bitmap = memblock_alloc(size, SMP_CACHE_BYTES); in msi_bitmap_alloc()
127 if (!bmp->bitmap) in msi_bitmap_alloc()
130 /* the bitmap won't be freed from memblock allocator */ in msi_bitmap_alloc()
131 kmemleak_not_leak(bmp->bitmap); in msi_bitmap_alloc()
134 if (!bmp->bitmap) { in msi_bitmap_alloc()
135 pr_debug("msi_bitmap: ENOMEM allocating allocator bitmap!\n"); in msi_bitmap_alloc()
139 /* We zalloc'ed the bitmap, so all irqs are free by default */ in msi_bitmap_alloc()
150 kfree(bmp->bitmap); in msi_bitmap_free()
152 bmp->bitmap = NULL; in msi_bitmap_free()
162 /* Can't allocate a bitmap of 0 irqs */ in test_basics()
169 WARN_ON(bitmap_find_free_region(bmp.bitmap, size, get_count_order(size))); in test_basics()
170 bitmap_release_region(bmp.bitmap, 0, get_count_order(size)); in test_basics()
176 WARN_ON(bitmap_find_free_region(bmp.bitmap, size, get_count_order(size))); in test_basics()
177 bitmap_release_region(bmp.bitmap, 0, get_count_order(size)); in test_basics()
186 WARN_ON(bitmap_find_free_region(bmp.bitmap, size, 0) >= 0); in test_basics()
213 /* Clients may WARN_ON bitmap == NULL for "not-allocated" */ in test_basics()
214 WARN_ON(bmp.bitmap != NULL); in test_basics()
240 WARN_ON(bitmap_find_free_region(bmp.bitmap, SIZE_EXPECTED, in test_of_node()
242 bitmap_release_region(bmp.bitmap, 0, get_count_order(SIZE_EXPECTED)); in test_of_node()
259 WARN_ON(!bitmap_equal(expected, bmp.bitmap, SIZE_EXPECTED)); in test_of_node()
262 kfree(bmp.bitmap); in test_of_node()
267 printk(KERN_DEBUG "Running MSI bitmap self-tests ...\n"); in msi_bitmap_selftest()