Lines Matching refs:bmap
76 const unsigned long *exp_bmap, const unsigned long *bmap, in __check_eq_bitmap() argument
79 if (!bitmap_equal(exp_bmap, bmap, nbits)) { in __check_eq_bitmap()
82 nbits, exp_bmap, nbits, bmap); in __check_eq_bitmap()
197 DECLARE_BITMAP(bmap, 1024); in test_zero_clear()
200 memset(bmap, 0xff, 128); in test_zero_clear()
202 expect_eq_pbl("0-22", bmap, 23); in test_zero_clear()
203 expect_eq_pbl("0-1023", bmap, 1024); in test_zero_clear()
206 bitmap_clear(bmap, 0, 9); in test_zero_clear()
207 expect_eq_pbl("9-1023", bmap, 1024); in test_zero_clear()
209 bitmap_zero(bmap, 35); in test_zero_clear()
210 expect_eq_pbl("64-1023", bmap, 1024); in test_zero_clear()
213 bitmap_clear(bmap, 79, 19); in test_zero_clear()
214 expect_eq_pbl("64-78,98-1023", bmap, 1024); in test_zero_clear()
216 bitmap_zero(bmap, 115); in test_zero_clear()
217 expect_eq_pbl("128-1023", bmap, 1024); in test_zero_clear()
220 bitmap_zero(bmap, 1024); in test_zero_clear()
221 expect_eq_pbl("", bmap, 1024); in test_zero_clear()
227 DECLARE_BITMAP(bmap, 64 * 3); in test_find_nth_bit()
229 bitmap_zero(bmap, 64 * 3); in test_find_nth_bit()
230 __set_bit(10, bmap); in test_find_nth_bit()
231 __set_bit(20, bmap); in test_find_nth_bit()
232 __set_bit(30, bmap); in test_find_nth_bit()
233 __set_bit(40, bmap); in test_find_nth_bit()
234 __set_bit(50, bmap); in test_find_nth_bit()
235 __set_bit(60, bmap); in test_find_nth_bit()
236 __set_bit(80, bmap); in test_find_nth_bit()
237 __set_bit(123, bmap); in test_find_nth_bit()
239 expect_eq_uint(10, find_nth_bit(bmap, 64 * 3, 0)); in test_find_nth_bit()
240 expect_eq_uint(20, find_nth_bit(bmap, 64 * 3, 1)); in test_find_nth_bit()
241 expect_eq_uint(30, find_nth_bit(bmap, 64 * 3, 2)); in test_find_nth_bit()
242 expect_eq_uint(40, find_nth_bit(bmap, 64 * 3, 3)); in test_find_nth_bit()
243 expect_eq_uint(50, find_nth_bit(bmap, 64 * 3, 4)); in test_find_nth_bit()
244 expect_eq_uint(60, find_nth_bit(bmap, 64 * 3, 5)); in test_find_nth_bit()
245 expect_eq_uint(80, find_nth_bit(bmap, 64 * 3, 6)); in test_find_nth_bit()
246 expect_eq_uint(123, find_nth_bit(bmap, 64 * 3, 7)); in test_find_nth_bit()
247 expect_eq_uint(0, !!(find_nth_bit(bmap, 64 * 3, 8) < 64 * 3)); in test_find_nth_bit()
249 expect_eq_uint(10, find_nth_bit(bmap, 64 * 3 - 1, 0)); in test_find_nth_bit()
250 expect_eq_uint(20, find_nth_bit(bmap, 64 * 3 - 1, 1)); in test_find_nth_bit()
251 expect_eq_uint(30, find_nth_bit(bmap, 64 * 3 - 1, 2)); in test_find_nth_bit()
252 expect_eq_uint(40, find_nth_bit(bmap, 64 * 3 - 1, 3)); in test_find_nth_bit()
253 expect_eq_uint(50, find_nth_bit(bmap, 64 * 3 - 1, 4)); in test_find_nth_bit()
254 expect_eq_uint(60, find_nth_bit(bmap, 64 * 3 - 1, 5)); in test_find_nth_bit()
255 expect_eq_uint(80, find_nth_bit(bmap, 64 * 3 - 1, 6)); in test_find_nth_bit()
256 expect_eq_uint(123, find_nth_bit(bmap, 64 * 3 - 1, 7)); in test_find_nth_bit()
257 expect_eq_uint(0, !!(find_nth_bit(bmap, 64 * 3 - 1, 8) < 64 * 3 - 1)); in test_find_nth_bit()
267 DECLARE_BITMAP(bmap, 1024); in test_fill_set()
270 memset(bmap, 0x00, 128); in test_fill_set()
272 expect_eq_pbl("", bmap, 23); in test_fill_set()
273 expect_eq_pbl("", bmap, 1024); in test_fill_set()
276 bitmap_set(bmap, 0, 9); in test_fill_set()
277 expect_eq_pbl("0-8", bmap, 1024); in test_fill_set()
279 bitmap_fill(bmap, 35); in test_fill_set()
280 expect_eq_pbl("0-63", bmap, 1024); in test_fill_set()
283 bitmap_set(bmap, 79, 19); in test_fill_set()
284 expect_eq_pbl("0-63,79-97", bmap, 1024); in test_fill_set()
286 bitmap_fill(bmap, 115); in test_fill_set()
287 expect_eq_pbl("0-127", bmap, 1024); in test_fill_set()
290 bitmap_fill(bmap, 1024); in test_fill_set()
291 expect_eq_pbl("0-1023", bmap, 1024); in test_fill_set()
337 DECLARE_BITMAP(bmap, 1000); in test_bitmap_region()
339 bitmap_zero(bmap, 1000); in test_bitmap_region()
342 pos = bitmap_find_free_region(bmap, 1000, order); in test_bitmap_region()
349 bitmap_release_region(bmap, 0, 0); in test_bitmap_region()
351 bitmap_release_region(bmap, BIT(order), order); in test_bitmap_region()
353 expect_eq_uint(bitmap_weight(bmap, 1000), 0); in test_bitmap_region()
362 DECLARE_BITMAP(bmap, 1024); in test_replace()
366 bitmap_zero(bmap, 1024); in test_replace()
367 bitmap_replace(bmap, &exp2[0 * nlongs], &exp2[1 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
368 expect_eq_bitmap(bmap, exp3_0_1, nbits); in test_replace()
370 bitmap_zero(bmap, 1024); in test_replace()
371 bitmap_replace(bmap, &exp2[1 * nlongs], &exp2[0 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
372 expect_eq_bitmap(bmap, exp3_1_0, nbits); in test_replace()
374 bitmap_fill(bmap, 1024); in test_replace()
375 bitmap_replace(bmap, &exp2[0 * nlongs], &exp2[1 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
376 expect_eq_bitmap(bmap, exp3_0_1, nbits); in test_replace()
378 bitmap_fill(bmap, 1024); in test_replace()
379 bitmap_replace(bmap, &exp2[1 * nlongs], &exp2[0 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
380 expect_eq_bitmap(bmap, exp3_1_0, nbits); in test_replace()
525 DECLARE_BITMAP(bmap, 2048); in test_bitmap_parselist()
531 err = bitmap_parselist(ptest.in, bmap, ptest.nbits); in test_bitmap_parselist()
542 && !__bitmap_equal(bmap, ptest.expected, ptest.nbits)) { in test_bitmap_parselist()
544 i, ptest.in, bmap[0], in test_bitmap_parselist()
560 unsigned long *bmap = kmalloc(PAGE_SIZE, GFP_KERNEL); in test_bitmap_printlist() local
566 if (!buf || !bmap) in test_bitmap_printlist()
569 memset(bmap, -1, PAGE_SIZE); in test_bitmap_printlist()
575 ret = bitmap_print_to_pagebuf(true, buf, bmap, PAGE_SIZE * 8); in test_bitmap_printlist()
593 kfree(bmap); in test_bitmap_printlist()
641 DECLARE_BITMAP(bmap, 2048); in test_bitmap_parse()
648 err = bitmap_parse(test.in, len, bmap, test.nbits); in test_bitmap_parse()
659 && !__bitmap_equal(bmap, test.expected, test.nbits)) { in test_bitmap_parse()
661 i, test.in, bmap[0], in test_bitmap_parse()