Lines Matching refs:wr_idx
71 return &pb->ext.cache.wr_idx; in get_wr_idx_loc()
74 return &pb->ext.nocache.wr_idx; in get_wr_idx_loc()
155 uint32_t wr_idx = *wr_idx_loc; in spsc_pbuf_alloc() local
159 if (wr_idx >= rd_idx) { in spsc_pbuf_alloc()
160 int32_t remaining = pblen - wr_idx; in spsc_pbuf_alloc()
180 data_loc[wr_idx] = PADDING_MARK; in spsc_pbuf_alloc()
182 cache_wb(&data_loc[wr_idx], sizeof(uint8_t), flags); in spsc_pbuf_alloc()
184 wr_idx = 0; in spsc_pbuf_alloc()
185 *wr_idx_loc = wr_idx; in spsc_pbuf_alloc()
192 free_space = rd_idx - wr_idx - FREE_SPACE_DISTANCE; in spsc_pbuf_alloc()
196 *buf = &data_loc[wr_idx + LEN_SZ]; in spsc_pbuf_alloc()
213 uint32_t wr_idx = *wr_idx_loc; in spsc_pbuf_commit() local
215 sys_put_be16(len, &data_loc[wr_idx]); in spsc_pbuf_commit()
217 cache_wb(&data_loc[wr_idx], len + LEN_SZ, flags); in spsc_pbuf_commit()
219 wr_idx += len + LEN_SZ; in spsc_pbuf_commit()
220 wr_idx = ROUND_UP(wr_idx, sizeof(uint32_t)); in spsc_pbuf_commit()
221 wr_idx = wr_idx == pblen ? 0 : wr_idx; in spsc_pbuf_commit()
223 *wr_idx_loc = wr_idx; in spsc_pbuf_commit()
261 uint32_t wr_idx = *wr_idx_loc; in spsc_pbuf_claim() local
264 if (rd_idx == wr_idx) { in spsc_pbuf_claim()
268 uint32_t bytes_stored = idx_occupied(pblen, wr_idx, rd_idx); in spsc_pbuf_claim()
301 if (rd_idx == wr_idx) { in spsc_pbuf_claim()