Lines Matching full:last

8  * Memory FIFO permitting enqueue at tail (last) and dequeue from head (first).
17 * Invariant: last-index refers to the buffer that is safe to write while in
18 * limbo-state. Outside limbo state, last-index refers one buffer ahead of what
55 uint8_t l; /* Last. Write index */ \
60 * @details API 1 and 2. An MFIFO is empty if first == last
81 uint8_t last, uint8_t *idx) in mfifo_enqueue_idx_get() argument
84 last = last + 1; in mfifo_enqueue_idx_get()
85 if (last == count) { in mfifo_enqueue_idx_get()
86 last = 0U; in mfifo_enqueue_idx_get()
91 * first == last, but we just advanced a copy of the write-index before in mfifo_enqueue_idx_get()
92 * and may have wrapped. So if first == last the queue is full and we in mfifo_enqueue_idx_get()
95 if (last == first) { in mfifo_enqueue_idx_get()
99 *idx = last; /* Emit the allocated buffer's index */ in mfifo_enqueue_idx_get()
118 uint8_t idx, void *mem, uint8_t *last) in mfifo_by_idx_enqueue() argument
121 void **p = (void **)(fifo + (*last) * size); /* buffer preceding idx */ in mfifo_by_idx_enqueue()
125 *last = idx; /* Commit: Update write index */ in mfifo_by_idx_enqueue()
145 uint8_t last, void **mem) in mfifo_enqueue_get() argument
150 if (!mfifo_enqueue_idx_get(count, first, last, &idx)) { in mfifo_enqueue_get()
157 * buffer (last). Recall that last has not been updated, in mfifo_enqueue_get()
158 * so idx != last in mfifo_enqueue_get()
160 *mem = (void *)(fifo + last * size); /* preceding buffer */ in mfifo_enqueue_get()
188 * @param last[out] Write-index
190 static inline void mfifo_enqueue(uint8_t idx, uint8_t *last) in mfifo_enqueue() argument
193 *last = idx; /* Commit: Update write index */ in mfifo_enqueue()
208 * Empty if first == last
211 uint8_t last) in mfifo_avail_count_get() argument
213 if (last >= first) { in mfifo_avail_count_get()
214 return last - first; in mfifo_avail_count_get()
216 return count - first + last; in mfifo_avail_count_get()
233 uint8_t first, uint8_t last) in mfifo_dequeue_get() argument
235 if (first == last) { in mfifo_dequeue_get()
255 uint8_t first, uint8_t last) in mfifo_dequeue_peek() argument
257 if (first == last) { in mfifo_dequeue_peek()
275 uint8_t last, uint8_t *idx) in mfifo_dequeue_iter_get() argument
284 if (*idx == last) { in mfifo_dequeue_iter_get()
311 * @param last[in] Tail index, Span: [0 .. count-1]
316 uint8_t last, uint8_t *first) in mfifo_dequeue() argument
321 /* Queue is empty if first == last */ in mfifo_dequeue()
322 if (_first == last) { in mfifo_dequeue()