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()
169 DECLARE_BITMAP(bmap, 1024); in test_zero_clear()
172 memset(bmap, 0xff, 128); in test_zero_clear()
174 expect_eq_pbl("0-22", bmap, 23); in test_zero_clear()
175 expect_eq_pbl("0-1023", bmap, 1024); in test_zero_clear()
178 bitmap_clear(bmap, 0, 9); in test_zero_clear()
179 expect_eq_pbl("9-1023", bmap, 1024); in test_zero_clear()
181 bitmap_zero(bmap, 35); in test_zero_clear()
182 expect_eq_pbl("64-1023", bmap, 1024); in test_zero_clear()
185 bitmap_clear(bmap, 79, 19); in test_zero_clear()
186 expect_eq_pbl("64-78,98-1023", bmap, 1024); in test_zero_clear()
188 bitmap_zero(bmap, 115); in test_zero_clear()
189 expect_eq_pbl("128-1023", bmap, 1024); in test_zero_clear()
192 bitmap_zero(bmap, 1024); in test_zero_clear()
193 expect_eq_pbl("", bmap, 1024); in test_zero_clear()
199 DECLARE_BITMAP(bmap, 64 * 3); in test_find_nth_bit()
201 bitmap_zero(bmap, 64 * 3); in test_find_nth_bit()
202 __set_bit(10, bmap); in test_find_nth_bit()
203 __set_bit(20, bmap); in test_find_nth_bit()
204 __set_bit(30, bmap); in test_find_nth_bit()
205 __set_bit(40, bmap); in test_find_nth_bit()
206 __set_bit(50, bmap); in test_find_nth_bit()
207 __set_bit(60, bmap); in test_find_nth_bit()
208 __set_bit(80, bmap); in test_find_nth_bit()
209 __set_bit(123, bmap); in test_find_nth_bit()
211 expect_eq_uint(10, find_nth_bit(bmap, 64 * 3, 0)); in test_find_nth_bit()
212 expect_eq_uint(20, find_nth_bit(bmap, 64 * 3, 1)); in test_find_nth_bit()
213 expect_eq_uint(30, find_nth_bit(bmap, 64 * 3, 2)); in test_find_nth_bit()
214 expect_eq_uint(40, find_nth_bit(bmap, 64 * 3, 3)); in test_find_nth_bit()
215 expect_eq_uint(50, find_nth_bit(bmap, 64 * 3, 4)); in test_find_nth_bit()
216 expect_eq_uint(60, find_nth_bit(bmap, 64 * 3, 5)); in test_find_nth_bit()
217 expect_eq_uint(80, find_nth_bit(bmap, 64 * 3, 6)); in test_find_nth_bit()
218 expect_eq_uint(123, find_nth_bit(bmap, 64 * 3, 7)); in test_find_nth_bit()
219 expect_eq_uint(0, !!(find_nth_bit(bmap, 64 * 3, 8) < 64 * 3)); in test_find_nth_bit()
221 expect_eq_uint(10, find_nth_bit(bmap, 64 * 3 - 1, 0)); in test_find_nth_bit()
222 expect_eq_uint(20, find_nth_bit(bmap, 64 * 3 - 1, 1)); in test_find_nth_bit()
223 expect_eq_uint(30, find_nth_bit(bmap, 64 * 3 - 1, 2)); in test_find_nth_bit()
224 expect_eq_uint(40, find_nth_bit(bmap, 64 * 3 - 1, 3)); in test_find_nth_bit()
225 expect_eq_uint(50, find_nth_bit(bmap, 64 * 3 - 1, 4)); in test_find_nth_bit()
226 expect_eq_uint(60, find_nth_bit(bmap, 64 * 3 - 1, 5)); in test_find_nth_bit()
227 expect_eq_uint(80, find_nth_bit(bmap, 64 * 3 - 1, 6)); in test_find_nth_bit()
228 expect_eq_uint(123, find_nth_bit(bmap, 64 * 3 - 1, 7)); in test_find_nth_bit()
229 expect_eq_uint(0, !!(find_nth_bit(bmap, 64 * 3 - 1, 8) < 64 * 3 - 1)); in test_find_nth_bit()
239 DECLARE_BITMAP(bmap, 1024); in test_fill_set()
242 memset(bmap, 0x00, 128); in test_fill_set()
244 expect_eq_pbl("", bmap, 23); in test_fill_set()
245 expect_eq_pbl("", bmap, 1024); in test_fill_set()
248 bitmap_set(bmap, 0, 9); in test_fill_set()
249 expect_eq_pbl("0-8", bmap, 1024); in test_fill_set()
251 bitmap_fill(bmap, 35); in test_fill_set()
252 expect_eq_pbl("0-63", bmap, 1024); in test_fill_set()
255 bitmap_set(bmap, 79, 19); in test_fill_set()
256 expect_eq_pbl("0-63,79-97", bmap, 1024); in test_fill_set()
258 bitmap_fill(bmap, 115); in test_fill_set()
259 expect_eq_pbl("0-127", bmap, 1024); in test_fill_set()
262 bitmap_fill(bmap, 1024); in test_fill_set()
263 expect_eq_pbl("0-1023", bmap, 1024); in test_fill_set()
309 DECLARE_BITMAP(bmap, 1000); in test_bitmap_region()
311 bitmap_zero(bmap, 1000); in test_bitmap_region()
314 pos = bitmap_find_free_region(bmap, 1000, order); in test_bitmap_region()
321 bitmap_release_region(bmap, 0, 0); in test_bitmap_region()
323 bitmap_release_region(bmap, BIT(order), order); in test_bitmap_region()
325 expect_eq_uint(bitmap_weight(bmap, 1000), 0); in test_bitmap_region()
334 DECLARE_BITMAP(bmap, 1024); in test_replace()
338 bitmap_zero(bmap, 1024); in test_replace()
339 bitmap_replace(bmap, &exp2[0 * nlongs], &exp2[1 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
340 expect_eq_bitmap(bmap, exp3_0_1, nbits); in test_replace()
342 bitmap_zero(bmap, 1024); in test_replace()
343 bitmap_replace(bmap, &exp2[1 * nlongs], &exp2[0 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
344 expect_eq_bitmap(bmap, exp3_1_0, nbits); in test_replace()
346 bitmap_fill(bmap, 1024); in test_replace()
347 bitmap_replace(bmap, &exp2[0 * nlongs], &exp2[1 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
348 expect_eq_bitmap(bmap, exp3_0_1, nbits); in test_replace()
350 bitmap_fill(bmap, 1024); in test_replace()
351 bitmap_replace(bmap, &exp2[1 * nlongs], &exp2[0 * nlongs], exp2_to_exp3_mask, nbits); in test_replace()
352 expect_eq_bitmap(bmap, exp3_1_0, nbits); in test_replace()
497 DECLARE_BITMAP(bmap, 2048); in test_bitmap_parselist()
503 err = bitmap_parselist(ptest.in, bmap, ptest.nbits); in test_bitmap_parselist()
514 && !__bitmap_equal(bmap, ptest.expected, ptest.nbits)) { in test_bitmap_parselist()
516 i, ptest.in, bmap[0], in test_bitmap_parselist()
532 unsigned long *bmap = kmalloc(PAGE_SIZE, GFP_KERNEL); in test_bitmap_printlist() local
538 if (!buf || !bmap) in test_bitmap_printlist()
541 memset(bmap, -1, PAGE_SIZE); in test_bitmap_printlist()
547 ret = bitmap_print_to_pagebuf(true, buf, bmap, PAGE_SIZE * 8); in test_bitmap_printlist()
565 kfree(bmap); in test_bitmap_printlist()
613 DECLARE_BITMAP(bmap, 2048); in test_bitmap_parse()
620 err = bitmap_parse(test.in, len, bmap, test.nbits); in test_bitmap_parse()
631 && !__bitmap_equal(bmap, test.expected, test.nbits)) { in test_bitmap_parse()
633 i, test.in, bmap[0], in test_bitmap_parse()