33#define FIFO_CREATE(_buf, _size) {.buffer = (uint8_t*)(_buf), .size = (_size), .head = 0, .tail = 0}
43#define FIFO_DEFINE(_name, _size) \
44 uint8_t _name##_buffer[_size]; \
45 fifo_t _name = FIFO_CREATE(_name##_buffer, _size)
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
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.