Lines Matching refs:bit

17 #define BIT_INDEX(bit)  ((3 - ((bit >> 3) & 0x3)) + 4*(bit >> 5))  argument
19 #define BIT_INDEX(bit) (bit >> 3) argument
21 #define BIT_VAL(bit) (1 << (bit & 0x7)) argument
132 size_t bit, bundle_idx, bit_idx_in_bundle; in ZTEST() local
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()
145 ret = sys_bitarray_set_bit(&ba, bit); in ZTEST()
147 "sys_bitarray_set_bit failed on bit %d", bit); in ZTEST()
149 "sys_bitarray_set_bit did not set bit %d\n", bit); in ZTEST()
150 zassert_not_equal(sys_bitfield_test_bit((mem_addr_t)ba.bundles, bit), in ZTEST()
151 0, "sys_bitarray_set_bit did not set bit %d\n", bit); in ZTEST()
153 ret = sys_bitarray_test_bit(&ba, bit, &bit_val); in ZTEST()
155 "sys_bitarray_test_bit failed at bit %d", bit); in ZTEST()
157 "sys_bitarray_test_bit did not detect bit %d\n", bit); in ZTEST()
159 ret = sys_bitarray_clear_bit(&ba, bit); in ZTEST()
161 "sys_bitarray_clear_bit failed at bit %d", bit); in ZTEST()
163 "sys_bitarray_clear_bit did not clear bit %d\n", bit); in ZTEST()
164 zassert_equal(sys_bitfield_test_bit((mem_addr_t)ba.bundles, bit), in ZTEST()
165 0, "sys_bitarray_set_bit did not set bit %d\n", bit); in ZTEST()
167 ret = sys_bitarray_test_bit(&ba, bit, &bit_val); in ZTEST()
169 "sys_bitarray_test_bit failed at bit %d", bit); in ZTEST()
172 bit); in ZTEST()
174 ret = sys_bitarray_test_and_set_bit(&ba, bit, &bit_val); in ZTEST()
176 "sys_bitarray_test_and_set_bit failed at bit %d", bit); in ZTEST()
179 bit); in ZTEST()
181 "sys_bitarray_test_and_set_bit did not set bit %d\n", bit); in ZTEST()
182 zassert_not_equal(sys_bitfield_test_bit((mem_addr_t)ba.bundles, bit), in ZTEST()
183 0, "sys_bitarray_set_bit did not set bit %d\n", bit); in ZTEST()
185 ret = sys_bitarray_test_and_set_bit(&ba, bit, &bit_val); in ZTEST()
187 "sys_bitarray_test_and_set_bit failed at bit %d", bit); in ZTEST()
190 bit); in ZTEST()
192 "sys_bitarray_test_and_set_bit cleared bit %d\n", bit); in ZTEST()
193 zassert_not_equal(sys_bitfield_test_bit((mem_addr_t)ba.bundles, bit), in ZTEST()
194 0, "sys_bitarray_set_bit did not set bit %d\n", bit); in ZTEST()
196 ret = sys_bitarray_test_and_clear_bit(&ba, bit, &bit_val); in ZTEST()
198 "sys_bitarray_test_and_clear_bit failed at bit %d", bit); in ZTEST()
201 bit); in ZTEST()
204 bit); in ZTEST()
205 zassert_equal(sys_bitfield_test_bit((mem_addr_t)ba.bundles, bit), in ZTEST()
206 0, "sys_bitarray_set_bit did not set bit %d\n", bit); in ZTEST()
208 ret = sys_bitarray_test_and_clear_bit(&ba, bit, &bit_val); in ZTEST()
210 "sys_bitarray_test_and_clear_bit failed at bit %d", bit); in ZTEST()
213 bit); in ZTEST()
216 bit); in ZTEST()
217 zassert_equal(sys_bitfield_test_bit((mem_addr_t)ba.bundles, bit), in ZTEST()
218 0, "sys_bitarray_set_bit did not set bit %d\n", bit); in ZTEST()
390 size_t bit; in alloc_and_free_loop() local
399 for (bit = 0U; bit < ba.num_bits; ++bit) { in alloc_and_free_loop()
403 expected_popcnt, cur_popcnt, bit); in alloc_and_free_loop()
406 num_bits = (ba.num_bits - bit) / divisor; in alloc_and_free_loop()
412 bit); in alloc_and_free_loop()
416 ret, bit); in alloc_and_free_loop()
417 zassert_equal(offset, bit, in alloc_and_free_loop()
419 bit, offset); in alloc_and_free_loop()
427 expected_popcnt, cur_popcnt, bit); in alloc_and_free_loop()
430 ret = sys_bitarray_free(&ba, (num_bits - 1), (bit + 1)); in alloc_and_free_loop()
434 bit); in alloc_and_free_loop()
438 ret, (bit + 1)); in alloc_and_free_loop()
1022 unsigned int bit; in ZTEST() local
1055 for (bit = 0; bit < 32 ; bit++) { in ZTEST()
1056 value = 1UL << bit; in ZTEST()
1057 zassert_equal(find_msb_set(value), bit + 1, "MSB is not matched"); in ZTEST()
1058 zassert_equal(find_lsb_set(value), bit + 1, "LSB is not matched"); in ZTEST()