mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
util/fifo8: clear fifo head upon reset
To improve the predictability of fifo8_pop_buf(), the fifo head is set to the start of data buffer upon a reset so that the first call to the function will be able to retrieve all data in the fifo. Signed-off-by: Beniamino Galvani <b.galvani@gmail.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
c4e57af852
commit
58892d4782
1 changed files with 1 additions and 0 deletions
|
@ -89,6 +89,7 @@ const uint8_t *fifo8_pop_buf(Fifo8 *fifo, uint32_t max, uint32_t *num)
|
|||
void fifo8_reset(Fifo8 *fifo)
|
||||
{
|
||||
fifo->num = 0;
|
||||
fifo->head = 0;
|
||||
}
|
||||
|
||||
bool fifo8_is_empty(Fifo8 *fifo)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue