Lines Matching full:last
19 uint8_t first, last; in dbuf_alloc() local
22 last = hdr->last; in dbuf_alloc()
23 if (first == last) { in dbuf_alloc()
25 last++; in dbuf_alloc()
26 if (last == DOUBLE_BUFFER_SIZE) { in dbuf_alloc()
27 last = 0U; in dbuf_alloc()
32 /* LLL has not consumed the first PDU. Revert back the `last` so in dbuf_alloc()
37 * 1. LLL runs before `pdu->last` is reverted, then `pdu->first` in dbuf_alloc()
38 * has changed, hence restore `pdu->last` and return index of in dbuf_alloc()
40 * 2. LLL runs after `pdu->last` is reverted, then `pdu->first` in dbuf_alloc()
41 * will not change, return the saved `last` as the index of in dbuf_alloc()
44 hdr->last = first; in dbuf_alloc()
48 hdr->last = last; in dbuf_alloc()
49 last++; in dbuf_alloc()
50 if (last == DOUBLE_BUFFER_SIZE) { in dbuf_alloc()
51 last = 0U; in dbuf_alloc()
56 *idx = last; in dbuf_alloc()
58 return &hdr->data[last * hdr->elem_size]; in dbuf_alloc()
66 if (first != hdr->last) { in dbuf_latest_get()