Lines Matching +full:0 +full:xfffffff0

17 #define BIT_INDEX(bit)  ((3 - ((bit >> 3) & 0x3)) + 4*(bit >> 5))
21 #define BIT_VAL(bit) (1 << (bit & 0x7))
35 for (i = 0; i < sz; i++) { in cmp_u32_arrays()
38 printk("%s: [%zu] 0x%x != 0x%x", __func__, in cmp_u32_arrays()
51 #define FREE 0U
69 for (i = 0; i < num_bundles; i++) { in validate_bitarray_define()
109 for (i = 0; i < ba->num_bundles; i++) { in bitarray_bundles_is_zero()
110 if (ba->bundles[i] != 0) { in bitarray_bundles_is_zero()
141 for (bit = 0U; bit < ba.num_bits; ++bit) { in ZTEST()
142 bundle_idx = bit / (sizeof(ba.bundles[0]) * 8); in ZTEST()
143 bit_idx_in_bundle = bit % (sizeof(ba.bundles[0]) * 8); in ZTEST()
146 zassert_equal(ret, 0, in ZTEST()
151 0, "sys_bitarray_set_bit did not set bit %d\n", bit); in ZTEST()
154 zassert_equal(ret, 0, in ZTEST()
160 zassert_equal(ret, 0, in ZTEST()
162 zassert_equal(ba.bundles[bundle_idx], 0, in ZTEST()
165 0, "sys_bitarray_set_bit did not set bit %d\n", bit); in ZTEST()
168 zassert_equal(ret, 0, in ZTEST()
170 zassert_equal(bit_val, 0, in ZTEST()
175 zassert_equal(ret, 0, in ZTEST()
177 zassert_equal(bit_val, 0, in ZTEST()
183 0, "sys_bitarray_set_bit did not set bit %d\n", bit); in ZTEST()
186 zassert_equal(ret, 0, in ZTEST()
194 0, "sys_bitarray_set_bit did not set bit %d\n", bit); in ZTEST()
197 zassert_equal(ret, 0, in ZTEST()
202 zassert_equal(ba.bundles[bundle_idx], 0, in ZTEST()
206 0, "sys_bitarray_set_bit did not set bit %d\n", bit); in ZTEST()
209 zassert_equal(ret, 0, in ZTEST()
211 zassert_equal(bit_val, 0, in ZTEST()
214 zassert_equal(ba.bundles[bundle_idx], 0, in ZTEST()
218 0, "sys_bitarray_set_bit did not set bit %d\n", bit); in ZTEST()
226 zassert_not_equal(ret, 0, "sys_bitarray_set_bit() should fail but not"); in ZTEST()
231 zassert_not_equal(ret, 0, "sys_bitarray_clear_bit() should fail but not"); in ZTEST()
236 zassert_not_equal(ret, 0, "sys_bitarray_test_bit() should fail but not"); in ZTEST()
241 zassert_not_equal(ret, 0, in ZTEST()
247 zassert_not_equal(ret, 0, in ZTEST()
253 zassert_not_equal(ret, 0, "sys_bitarray_set_bit() should fail but not"); in ZTEST()
258 zassert_not_equal(ret, 0, "sys_bitarray_clear_bit() should fail but not"); in ZTEST()
263 zassert_not_equal(ret, 0, "sys_bitarray_test_bit() should fail but not"); in ZTEST()
268 zassert_not_equal(ret, 0, in ZTEST()
274 zassert_not_equal(ret, 0, in ZTEST()
292 ba_128.bundles[0] = 0x0F0F070F; in alloc_and_free_predefined()
293 ba_128.bundles[1] = 0x0F0F0F0F; in alloc_and_free_predefined()
294 ba_128.bundles[2] = 0x0F0F0F0F; in alloc_and_free_predefined()
295 ba_128.bundles[3] = 0x0F0F0000; in alloc_and_free_predefined()
298 ba_128_expected[0] = 0x0F0FFF0F; in alloc_and_free_predefined()
299 ba_128_expected[1] = 0x0F0F0F0F; in alloc_and_free_predefined()
300 ba_128_expected[2] = 0x0F0F0F0F; in alloc_and_free_predefined()
301 ba_128_expected[3] = 0x0F0F0000; in alloc_and_free_predefined()
304 zassert_equal(ret, 0, "sys_bitarray_alloc() failed: %d", ret); in alloc_and_free_predefined()
310 ba_128_expected[2] = 0xFF0F0F0F; in alloc_and_free_predefined()
311 ba_128_expected[3] = 0x0F0F0FFF; in alloc_and_free_predefined()
312 zassert_equal(ret, 0, "sys_bitarray_alloc() failed: %d", ret); in alloc_and_free_predefined()
318 ba_128_expected[0] = 0x0F0F070F; in alloc_and_free_predefined()
319 zassert_equal(ret, 0, "sys_bitarray_free() failed: %d", ret); in alloc_and_free_predefined()
323 ret = sys_bitarray_free(&ba_128, 5, 0); in alloc_and_free_predefined()
324 zassert_not_equal(ret, 0, "sys_bitarray_free() should fail but not"); in alloc_and_free_predefined()
329 zassert_not_equal(ret, 0, "sys_bitarray_free() should fail but not"); in alloc_and_free_predefined()
334 ba_128_expected[2] = 0x0F0F0F0F; in alloc_and_free_predefined()
335 ba_128_expected[3] = 0x0F0F0000; in alloc_and_free_predefined()
336 zassert_equal(ret, 0, "sys_bitarray_free() failed: %d", ret); in alloc_and_free_predefined()
341 ba_128.bundles[0] = 0x7FFFFFFF; in alloc_and_free_predefined()
342 ba_128.bundles[1] = 0xFFFFFFFF; in alloc_and_free_predefined()
343 ba_128.bundles[2] = 0x00000000; in alloc_and_free_predefined()
344 ba_128.bundles[3] = 0x00000000; in alloc_and_free_predefined()
346 ba_128_expected[0] = 0x7FFFFFFF; in alloc_and_free_predefined()
347 ba_128_expected[1] = 0xFFFFFFFF; in alloc_and_free_predefined()
348 ba_128_expected[2] = 0xFFFFFFFF; in alloc_and_free_predefined()
349 ba_128_expected[3] = 0x00000003; in alloc_and_free_predefined()
352 zassert_equal(ret, 0, "sys_bitarray_alloc() failed: %d", ret); in alloc_and_free_predefined()
364 size_t cnt = 0; in count_bits()
366 while (val != 0) { in count_bits()
376 size_t popcnt = 0; in get_bitarray_popcnt()
379 for (idx = 0; idx < ba->num_bundles; idx++) { in get_bitarray_popcnt()
393 size_t expected_popcnt = 0; in alloc_and_free_loop()
399 for (bit = 0U; bit < ba.num_bits; ++bit) { in alloc_and_free_loop()
409 if (num_bits == 0) { in alloc_and_free_loop()
410 zassert_not_equal(ret, 0, in alloc_and_free_loop()
414 zassert_equal(ret, 0, in alloc_and_free_loop()
431 if ((num_bits == 0) || ((num_bits - 1) == 0)) { in alloc_and_free_loop()
432 zassert_not_equal(ret, 0, in alloc_and_free_loop()
436 zassert_equal(ret, 0, in alloc_and_free_loop()
461 for (cnt = 0; cnt < ba.num_bundles; cnt++) { in alloc_and_free_interval()
462 ba.bundles[cnt] = 0x0F0F0F0F; in alloc_and_free_interval()
467 for (cnt = 0; cnt <= (ba.num_bits / 8); cnt++) { in alloc_and_free_interval()
471 zassert_not_equal(ret, 0, in alloc_and_free_interval()
475 zassert_equal(ret, 0, in alloc_and_free_interval()
538 ba.bundles[0] = 0x00000005; in ZTEST()
539 ba.bundles[1] = 0x00000000; in ZTEST()
540 ba.bundles[2] = 0x00000000; in ZTEST()
541 ba.bundles[3] = 0x00000000; in ZTEST()
543 ret = sys_bitarray_popcount_region(&ba, 1, 0, &count); in ZTEST()
544 zassert_equal(ret, 0, "sys_bitarray_popcount_region() returned unexpected value: %d", ret); in ZTEST()
549 zassert_equal(ret, 0, "sys_bitarray_popcount_region() returned unexpected value: %d", ret); in ZTEST()
550 zassert_equal(count, 0, "sys_bitarray_popcount_region() returned unexpected count: %d", in ZTEST()
553 ret = sys_bitarray_popcount_region(&ba, 2, 0, &count); in ZTEST()
554 zassert_equal(ret, 0, "sys_bitarray_popcount_region() returned unexpected value: %d", ret); in ZTEST()
558 ret = sys_bitarray_popcount_region(&ba, 3, 0, &count); in ZTEST()
559 zassert_equal(ret, 0, "sys_bitarray_popcount_region() returned unexpected value: %d", ret); in ZTEST()
564 zassert_equal(ret, 0, "sys_bitarray_popcount_region() returned unexpected value: %d", ret); in ZTEST()
573 ba.bundles[0] = 0x00000001; in ZTEST()
574 ba.bundles[1] = 0x00000000; in ZTEST()
575 ba.bundles[2] = 0x00000000; in ZTEST()
576 ba.bundles[3] = 0x80000000; in ZTEST()
579 zassert_equal(ret, 0, "sys_bitarray_popcount_region() returned unexpected value: %d", ret); in ZTEST()
580 zassert_equal(count, 0, "sys_bitarray_popcount_region() returned unexpected count: %d", in ZTEST()
583 ret = sys_bitarray_popcount_region(&ba, 126, 0, &count); in ZTEST()
584 zassert_equal(ret, 0, "sys_bitarray_popcount_region() returned unexpected value: %d", ret); in ZTEST()
589 zassert_equal(ret, 0, "sys_bitarray_popcount_region() returned unexpected value: %d", ret); in ZTEST()
593 zassert_equal(ret, 0, "sys_bitarray_popcount_region() returned unexpected value: %d", ret); in ZTEST()
597 ret = sys_bitarray_popcount_region(&ba, 128, 0, &count); in ZTEST()
598 zassert_equal(ret, 0, "sys_bitarray_popcount_region() returned unexpected value: %d", ret); in ZTEST()
603 ret = sys_bitarray_popcount_region(&ba, 0, 0, &count); in ZTEST()
606 ret = sys_bitarray_popcount_region(&ba, 0, 128, &count); in ZTEST()
609 ret = sys_bitarray_popcount_region(&ba, 128, 0, &count); in ZTEST()
610 zassert_equal(ret, 0, "sys_bitarray_popcount_region() returned unexpected value: %d", ret); in ZTEST()
615 ret = sys_bitarray_popcount_region(&ba, 129, 0, &count); in ZTEST()
636 ba.bundles[0] = 0x80001001; in ZTEST()
637 ba.bundles[1] = 0x10000008; in ZTEST()
638 ba.bundles[2] = 0xFFFFFFFF; in ZTEST()
639 ba.bundles[3] = 0x00000000; in ZTEST()
641 bb.bundles[0] = 0x80010001; in ZTEST()
642 bb.bundles[1] = 0x10000008; in ZTEST()
643 bb.bundles[2] = 0xFFFFFFFF; in ZTEST()
644 bb.bundles[3] = 0x00000000; in ZTEST()
646 ret = sys_bitarray_xor(&ba, &bb, 32, 0); in ZTEST()
647 zassert_equal(ret, 0, "sys_bitarray_xor() returned unexpected value: %d", ret); in ZTEST()
648 zassert_equal(ba.bundles[0], 0x00011000, "sys_bitarray_xor() result unexpected: %x", in ZTEST()
649 ba.bundles[0]); in ZTEST()
650 zassert_equal(bb.bundles[0], 0x80010001, "sys_bitarray_xor() result unexpected: %x", in ZTEST()
651 bb.bundles[0]); in ZTEST()
653 zassert_equal(ba.bundles[1], 0x10000008, "sys_bitarray_xor() result unexpected: %x", in ZTEST()
655 zassert_equal(bb.bundles[1], 0x10000008, "sys_bitarray_xor() result unexpected: %x", in ZTEST()
658 zassert_equal(ba.bundles[2], 0xFFFFFFFF, "sys_bitarray_xor() result unexpected: %x", in ZTEST()
660 zassert_equal(bb.bundles[2], 0xFFFFFFFF, "sys_bitarray_xor() result unexpected: %x", in ZTEST()
663 zassert_equal(ba.bundles[3], 0x00000000, "sys_bitarray_xor() result unexpected: %x", in ZTEST()
665 zassert_equal(bb.bundles[3], 0x00000000, "sys_bitarray_xor() result unexpected: %x", in ZTEST()
669 ba.bundles[0] = 0x80001001; in ZTEST()
670 ba.bundles[1] = 0x10000008; in ZTEST()
671 ba.bundles[2] = 0xFFFFFFFF; in ZTEST()
672 ba.bundles[3] = 0x00000000; in ZTEST()
674 bb.bundles[0] = 0x80010001; in ZTEST()
675 bb.bundles[1] = 0x10000008; in ZTEST()
676 bb.bundles[2] = 0xFFFFFFFF; in ZTEST()
677 bb.bundles[3] = 0x00000000; in ZTEST()
679 ret = sys_bitarray_xor(&ba, &bb, 16, 0); in ZTEST()
680 zassert_equal(ret, 0, "sys_bitarray_xor() returned unexpected value: %d", ret); in ZTEST()
681 zassert_equal(ba.bundles[0], 0x80001000, "sys_bitarray_xor() result unexpected: %x", in ZTEST()
682 ba.bundles[0]); in ZTEST()
683 zassert_equal(bb.bundles[0], 0x80010001, "sys_bitarray_xor() result unexpected: %x", in ZTEST()
684 bb.bundles[0]); in ZTEST()
687 ba.bundles[0] = 0x80001001; in ZTEST()
688 ba.bundles[1] = 0x10000008; in ZTEST()
689 ba.bundles[2] = 0xFFFFFFFF; in ZTEST()
690 ba.bundles[3] = 0x00000000; in ZTEST()
692 bb.bundles[0] = 0x80010001; in ZTEST()
693 bb.bundles[1] = 0x10000008; in ZTEST()
694 bb.bundles[2] = 0xFFFFFFFF; in ZTEST()
695 bb.bundles[3] = 0x00000000; in ZTEST()
698 zassert_equal(ret, 0, "sys_bitarray_xor() returned unexpected value: %d", ret); in ZTEST()
699 zassert_equal(ba.bundles[0], 0x00011001, "sys_bitarray_xor() result unexpected: %x", in ZTEST()
700 ba.bundles[0]); in ZTEST()
701 zassert_equal(bb.bundles[0], 0x80010001, "sys_bitarray_xor() result unexpected: %x", in ZTEST()
702 bb.bundles[0]); in ZTEST()
707 ba.bundles[0] = 0x00000000; in ZTEST()
708 ba.bundles[1] = 0xFFFFFFFF; in ZTEST()
709 ba.bundles[2] = 0xFFFFFFFF; in ZTEST()
710 ba.bundles[3] = 0xFFFFFFFF; in ZTEST()
712 bb.bundles[0] = 0x00000000; in ZTEST()
713 bb.bundles[1] = 0xFFFFFFFF; in ZTEST()
714 bb.bundles[2] = 0xFFFFFFFF; in ZTEST()
715 bb.bundles[3] = 0xFFFFFFFF; in ZTEST()
718 zassert_equal(ret, 0, "sys_bitarray_xor() returned unexpected value: %d", ret); in ZTEST()
719 zassert_equal(ba.bundles[0], 0x00000000, "sys_bitarray_xor() result unexpected: %x", in ZTEST()
720 ba.bundles[0]); in ZTEST()
721 zassert_equal(ba.bundles[1], 0x00000001, "sys_bitarray_xor() result unexpected: %x", in ZTEST()
723 zassert_equal(ba.bundles[2], 0x00000000, "sys_bitarray_xor() result unexpected: %x", in ZTEST()
725 zassert_equal(ba.bundles[3], 0x80000000, "sys_bitarray_xor() result unexpected: %x", in ZTEST()
730 ba.bundles[0] = 0x00000000; in ZTEST()
731 ba.bundles[1] = 0x00000000; in ZTEST()
732 ba.bundles[2] = 0x00000000; in ZTEST()
733 ba.bundles[3] = 0x00000000; in ZTEST()
735 bb.bundles[0] = 0x00000000; in ZTEST()
736 bb.bundles[1] = 0x00000000; in ZTEST()
737 bb.bundles[2] = 0x00000000; in ZTEST()
738 bb.bundles[3] = 0x00000000; in ZTEST()
740 bc.bundles[0] = 0x00000000; in ZTEST()
741 bc.bundles[1] = 0x00000000; in ZTEST()
742 bc.bundles[2] = 0x00000000; in ZTEST()
743 bc.bundles[3] = 0x00000000; in ZTEST()
744 bc.bundles[4] = 0x00000000; in ZTEST()
746 ret = sys_bitarray_xor(&ba, &bb, 32, 0); in ZTEST()
747 zassert_equal(ret, 0, "sys_bitarray_xor() returned unexpected value: %d", ret); in ZTEST()
748 ret = sys_bitarray_xor(&ba, &bc, 32, 0); in ZTEST()
750 ret = sys_bitarray_xor(&bc, &ba, 32, 0); in ZTEST()
753 ret = sys_bitarray_xor(&ba, &bb, 128, 0); in ZTEST()
754 zassert_equal(ret, 0, "sys_bitarray_xor() returned unexpected value: %d", ret); in ZTEST()
757 ret = sys_bitarray_xor(&ba, &bb, 129, 0); in ZTEST()
759 ret = sys_bitarray_xor(&ba, &bb, 0, 0); in ZTEST()
778 ba.bundles[0] = 0x80000001; in ZTEST()
779 ba.bundles[1] = 0x80000001; in ZTEST()
780 ba.bundles[2] = 0x80000001; in ZTEST()
781 ba.bundles[3] = 0x80000001; in ZTEST()
783 ret = sys_bitarray_find_nth_set(&ba, 1, 1, 0, &found_at); in ZTEST()
784 zassert_equal(ret, 0, "sys_bitarray_find_nth_set() returned unexpected value: %d", ret); in ZTEST()
785 zassert_equal(found_at, 0, "sys_bitarray_find_nth_set() returned unexpected found_at: %d", in ZTEST()
788 ret = sys_bitarray_find_nth_set(&ba, 1, 32, 0, &found_at); in ZTEST()
789 zassert_equal(ret, 0, "sys_bitarray_find_nth_set() returned unexpected value: %d", ret); in ZTEST()
790 zassert_equal(found_at, 0, "sys_bitarray_find_nth_set() returned unexpected found_at: %d", in ZTEST()
793 ret = sys_bitarray_find_nth_set(&ba, 2, 32, 0, &found_at); in ZTEST()
794 zassert_equal(ret, 0, "sys_bitarray_find_nth_set() returned unexpected value: %d", ret); in ZTEST()
799 zassert_equal(ret, 0, "sys_bitarray_find_nth_set() returned unexpected value: %d", ret); in ZTEST()
808 ret = sys_bitarray_find_nth_set(&ba, 1, 128, 0, &found_at); in ZTEST()
809 zassert_equal(ret, 0, "sys_bitarray_find_nth_set() returned unexpected value: %d", ret); in ZTEST()
810 zassert_equal(found_at, 0, "sys_bitarray_find_nth_set() returned unexpected found_at: %d", in ZTEST()
813 ret = sys_bitarray_find_nth_set(&ba, 8, 128, 0, &found_at); in ZTEST()
814 zassert_equal(ret, 0, "sys_bitarray_find_nth_set() returned unexpected value: %d", ret); in ZTEST()
823 zassert_equal(ret, 0, "sys_bitarray_find_nth_set() returned unexpected value: %d", ret); in ZTEST()
827 ret = sys_bitarray_find_nth_set(&ba, 7, 127, 0, &found_at); in ZTEST()
828 zassert_equal(ret, 0, "sys_bitarray_find_nth_set() returned unexpected value: %d", ret); in ZTEST()
833 zassert_equal(ret, 0, "sys_bitarray_find_nth_set() returned unexpected value: %d", ret); in ZTEST()
838 zassert_equal(ret, 0, "sys_bitarray_find_nth_set() returned unexpected value: %d", ret); in ZTEST()
843 zassert_equal(ret, 0, "sys_bitarray_find_nth_set() returned unexpected value: %d", ret); in ZTEST()
848 zassert_equal(ret, 0, "sys_bitarray_find_nth_set() returned unexpected value: %d", ret); in ZTEST()
854 ret = sys_bitarray_find_nth_set(&ba, 1, 128, 0, &found_at); in ZTEST()
855 zassert_equal(ret, 0, "sys_bitarray_find_nth_set() returned unexpected value: %d", ret); in ZTEST()
861 ret = sys_bitarray_find_nth_set(&ba, 1, 129, 0, &found_at); in ZTEST()
865 ret = sys_bitarray_find_nth_set(&ba, 0, 128, 0, &found_at); in ZTEST()
886 ba.bundles[0] = 0xFF0F0F0F; in ZTEST()
887 ba.bundles[1] = 0x0F0F0FFF; in ZTEST()
889 zassert_true(sys_bitarray_is_region_set(&ba, 4, 0)); in ZTEST()
895 zassert_false(sys_bitarray_is_region_cleared(&ba, 4, 0)); in ZTEST()
901 ba.bundles[0] = ~ba.bundles[0]; in ZTEST()
904 zassert_true(sys_bitarray_is_region_cleared(&ba, 4, 0)); in ZTEST()
910 zassert_false(sys_bitarray_is_region_set(&ba, 4, 0)); in ZTEST()
924 ba.bundles[0] = 0xFF0F0F0F; in ZTEST()
925 ba.bundles[1] = 0x0F0F0FFF; in ZTEST()
928 ba_expected[0] = 0xFF0F0F0F; in ZTEST()
929 ba_expected[1] = 0x0F0F0FFF; in ZTEST()
931 ret = sys_bitarray_set_region(&ba, 4, 0); in ZTEST()
932 zassert_equal(ret, 0, "sys_bitarray_set_region() failed: %d", ret); in ZTEST()
937 ba_expected[0] = 0xFF0F0FFF; in ZTEST()
938 zassert_equal(ret, 0, "sys_bitarray_set_region() failed: %d", ret); in ZTEST()
943 ba_expected[0] = 0xFF0F0F0F; in ZTEST()
944 zassert_equal(ret, 0, "sys_bitarray_clear_region() failed: %d", ret); in ZTEST()
949 ba_expected[0] = 0x3F0F0F0F; in ZTEST()
950 ba_expected[1] = 0x0F0F0000; in ZTEST()
951 zassert_equal(ret, 0, "sys_bitarray_clear_region() failed: %d", ret); in ZTEST()
956 ba_expected[0] = 0xFF0F0F0F; in ZTEST()
957 ba_expected[1] = 0x0F0F0FFF; in ZTEST()
958 zassert_equal(ret, 0, "sys_bitarray_set_region() failed: %d", ret); in ZTEST()
985 bw.bundles[0] = 0xFF0F0F0F; in ZTEST()
986 bw.bundles[1] = 0xF0000000; in ZTEST()
987 bw.bundles[2] = 0xFFFFFFFF; in ZTEST()
988 bw.bundles[3] = 0x0000000F; in ZTEST()
993 bw.bundles[2] = 0xFFFEEFFF; in ZTEST()
998 bw.bundles[1] = 0x0FFFFFFF; in ZTEST()
999 bw.bundles[2] = 0x00000000; in ZTEST()
1000 bw.bundles[3] = 0xFFFFFFF0; in ZTEST()
1005 bw.bundles[2] = 0x00011000; in ZTEST()
1025 value = 0x0; in ZTEST()
1026 zassert_equal(find_msb_set(value), 0, "MSB is not matched"); in ZTEST()
1027 zassert_equal(find_lsb_set(value), 0, "LSB is not matched"); in ZTEST()
1030 value = 0x00000001; in ZTEST()
1035 value = 0x80000000; in ZTEST()
1040 value = 0x000FF000; in ZTEST()
1045 value = 0xffffffff; in ZTEST()
1050 value = 0xfffffffe; in ZTEST()
1055 for (bit = 0; bit < 32 ; bit++) { in ZTEST()