void fifo_init(fifo_t *fifo, uint8_t *buffer, size_t size)
Initialize a fifo buffer.
size_t fifo_bytes_writeable(const fifo_t *fifo)
Return the number of bytes available for writing in a fifo buffer.
size_t fifo_bytes_readable(const fifo_t *fifo)
Return the number of bytes available for reading in a fifo buffer.
void fifo_advance_tail(fifo_t *fifo, size_t count)
Advance the tail of the fifo buffer.
size_t fifo_write(fifo_t *fifo, const void *buffer, size_t count)
Write data to the fifo buffer.
void fifo_advance_head(fifo_t *fifo, size_t count)
Advance the head of the fifo buffer.
void fifo_reset(fifo_t *fifo)
Reset a fifo buffer.
size_t fifo_read(fifo_t *fifo, void *buffer, size_t count)
Read data from a fifo buffer at a specific offset.
EFI_PHYSICAL_ADDRESS buffer
_PUBLIC void * memcpy(void *_RESTRICT s1, const void *_RESTRICT s2, size_t n)
size_t size
The total size of the buffer.
size_t head
The position to write to.
uint8_t * buffer
Pointer to the buffer memory.
size_t tail
The position to start reading from.