mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 23:41:23 +01:00
lib: Provide a lock enabled iteration of fifo.
Implement a lock enabled iteration for fifo so that caller can determine if next entry can be skipped or any existing entries in fifo can be updated before enqueue. Signed-off-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
@@ -23,11 +23,21 @@ struct sbi_fifo {
|
||||
u16 tail;
|
||||
};
|
||||
|
||||
enum sbi_fifo_inplace_update_types {
|
||||
SBI_FIFO_SKIP,
|
||||
SBI_FIFO_UPDATED,
|
||||
SBI_FIFO_RESET,
|
||||
SBI_FIFO_UNCHANGED,
|
||||
};
|
||||
|
||||
int sbi_fifo_dequeue(struct sbi_fifo *fifo, void *data);
|
||||
int sbi_fifo_enqueue(struct sbi_fifo *fifo, void *data);
|
||||
void sbi_fifo_init(struct sbi_fifo *fifo, void *queue_mem,
|
||||
u16 entries, u16 entry_size);
|
||||
bool sbi_fifo_is_empty(struct sbi_fifo *fifo);
|
||||
bool sbi_fifo_is_full(struct sbi_fifo *fifo);
|
||||
int sbi_fifo_inplace_update(struct sbi_fifo *fifo, void *in,
|
||||
int (*fptr) (void *in, void *data));
|
||||
u16 sbi_fifo_avail(struct sbi_fifo *fifo);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user