fifo32 header

The documentation of QEMU’s qemu/fifo32.h header.

void fifo32_create(Fifo32 * fifo, uint32_t capacity)

Parameters

Fifo32 * fifo
struct Fifo32 to initialise with new FIFO
uint32_t capacity
capacity of the newly created FIFO expressed in 32 bit words

Description

Create a FIFO of the specified size. Clients should call fifo32_destroy() when finished using the fifo. The FIFO is initially empty.

void fifo32_destroy(Fifo32 * fifo)

Parameters

Fifo32 * fifo
FIFO to cleanup

Description

Cleanup a FIFO created with fifo32_create(). Frees memory created for FIFO storage. The FIFO is no longer usable after this has been called.

uint32_t fifo32_num_free(Fifo32 * fifo)

Parameters

Fifo32 * fifo
FIFO to check

Description

Return the number of free uint32_t slots in the FIFO.

Return

Number of free 32 bit words.

uint32_t fifo32_num_used(Fifo32 * fifo)

Parameters

Fifo32 * fifo
FIFO to check

Description

Return the number of used uint32_t slots in the FIFO.

Return

Number of used 32 bit words.

void fifo32_push(Fifo32 * fifo, uint32_t data)

Parameters

Fifo32 * fifo
FIFO to push to
uint32_t data
32 bits data word to push

Description

Push a 32 bits data word to the FIFO. Behaviour is undefined if the FIFO is full. Clients are responsible for checking for fullness using fifo32_is_full().

void fifo32_push_all(Fifo32 * fifo, const uint32_t * data, uint32_t num)

Parameters

Fifo32 * fifo
FIFO to push to
const uint32_t * data
data to push
uint32_t num
undescribed

Description

Push a 32 bit word array to the FIFO. Behaviour is undefined if the FIFO is full. Clients are responsible for checking the space left in the FIFO using fifo32_num_free().

uint32_t fifo32_pop(Fifo32 * fifo)

Parameters

Fifo32 * fifo
fifo to pop from

Description

Pop a 32 bits data word from the FIFO. Behaviour is undefined if the FIFO is empty. Clients are responsible for checking for emptiness using fifo32_is_empty().

Return

The popped 32 bits data word.

void fifo32_reset(Fifo32 * fifo)

Parameters

Fifo32 * fifo
undescribed

Description

as a set of native-order words.

bool fifo32_is_empty(Fifo32 * fifo)

Parameters

Fifo32 * fifo
FIFO to check

Description

Check if a FIFO is empty.

Return

True if the fifo is empty, false otherwise.

bool fifo32_is_full(Fifo32 * fifo)

Parameters

Fifo32 * fifo
FIFO to check

Description

Check if a FIFO is full.

Return

True if the fifo is full, false otherwise.