Lines Matching +full:4 +full:- +full:word
4 * SPDX-License-Identifier: Apache-2.0
27 static uint32_t track_mask[4][12];
28 static uint32_t track_base_idx[4];
32 uint32_t idx[4];
45 #define DATA_BITS (32 - MPSC_PBUF_HDR_BITS - LEN_BITS - CTX_BITS)
60 uint32_t ridx = idx - track_base_idx[ctx]; in track_produce()
61 uint32_t word = ridx / MASK_BITS; in track_produce() local
62 uint32_t bit = ridx & (MASK_BITS - 1); in track_produce()
65 track_mask[ctx][word] |= BIT(bit); in track_produce()
73 uint32_t ridx = idx - base_idx; in track_consume()
74 uint32_t word = ridx / MASK_BITS; in track_consume() local
75 uint32_t bit = ridx & (MASK_BITS - 1); in track_consume()
86 if ((track_mask[ctx][word] & BIT(bit)) == 0) { in track_consume()
93 track_mask[ctx][word] &= ~BIT(bit); in track_consume()
95 if (word > (ARRAY_SIZE(track_mask[ctx]) / 2)) { in track_consume()
105 sizeof(track_mask[ctx]) - sizeof(uint32_t)); in track_consume()
106 track_mask[ctx][ARRAY_SIZE(track_mask[ctx]) - 1] = 0; in track_consume()
119 test_failed_cnt = packet->data; in test_fail()
120 test_failed_ctx = packet->ctx; in test_fail()
127 bool res = track_consume(packet->ctx, packet->data); in consume_check()
134 for (int i = 0; i < packet->len - 1; i++) { in consume_check()
135 if (packet->buf[i] != packet->data + i) { in consume_check()
170 zassert_true(prio < 4, NULL); in produce()
173 uint32_t wlen = sys_rand32_get() % (buffer->size / 4) + 1; in produce()
191 packet->ctx = prio; in produce()
192 packet->data = id; in produce()
193 packet->len = wlen; in produce()
194 for (int i = 0; i < (wlen - 1); i++) { in produce()
195 packet->buf[i] = id + i; in produce()
207 return packet->len; in get_wlen()
273 for (int i = 0; i < 4; i++) { in stress_test()