33#define RING_CREATE(bufferPtr, bufferSize) \
34 {.buffer = bufferPtr, .size = bufferSize, .readIndex = 0, .writeIndex = 0, .dataLength = 0}
95 if (
count < upperHalfSize)
129 if (
count < upperHalfSize)
169 if (
count < upperHalfSize)
static uint64_t ring_write(ring_t *ring, const void *buffer, uint64_t count)
Write data to the ring buffer.
static void ring_move_read_forward(ring_t *ring, uint64_t offset)
Move the read index forward by a specified offset.
static uint64_t ring_free_length(const ring_t *ring)
Get the length of free space in the ring buffer.
static uint64_t ring_get_byte(const ring_t *ring, uint64_t offset, uint8_t *byte)
Get a byte from the ring buffer at a specific offset without modifying the read index.
static uint64_t ring_data_length(const ring_t *ring)
Get the length of data currently stored in the ring buffer.
static uint64_t ring_read(ring_t *ring, void *buffer, uint64_t count)
Read data from the ring buffer.
static uint64_t ring_read_at(const ring_t *ring, uint64_t offset, void *buffer, uint64_t count)
Read data from the ring buffer at a specific offset without modifying the read index.
static void ring_init(ring_t *ring, void *buffer, uint64_t size)
Initialize a ring buffer.
#define ERR
Integer error value.
EFI_PHYSICAL_ADDRESS buffer
_PUBLIC void * memcpy(void *_RESTRICT s1, const void *_RESTRICT s2, size_t n)