PatchworkOS  3984a1d
A non-POSIX operating system.
Loading...
Searching...
No Matches
fifo.c File Reference
#include <kernel/utils/fifo.h>
#include <errno.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for fifo.c:

Go to the source code of this file.

Functions

void fifo_init (fifo_t *fifo, uint8_t *buffer, size_t size)
 Initialize a fifo buffer.
 
void fifo_reset (fifo_t *fifo)
 Reset a fifo buffer.
 
size_t fifo_bytes_readable (const fifo_t *fifo)
 Return the number of bytes available for reading in 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_read (fifo_t *fifo, void *buffer, size_t count)
 Read data from a fifo buffer at a specific offset.
 
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_advance_tail (fifo_t *fifo, size_t count)
 Advance the tail of the fifo buffer.