mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
fifo8: add fifo8_peek_buf() function
This is a wrapper function around fifo8_peekpop_buf() that allows the caller to peek into the FIFO, including handling the case where there is a wraparound of the internal FIFO buffer. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Octavian Purdila <tavip@google.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20240828122258.928947-8-mark.cave-ayland@ilande.co.uk> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
cfc65db19b
commit
28fbf33b3f
2 changed files with 19 additions and 0 deletions
|
@ -140,6 +140,11 @@ uint32_t fifo8_pop_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen)
|
|||
return fifo8_peekpop_buf(fifo, dest, destlen, true);
|
||||
}
|
||||
|
||||
uint32_t fifo8_peek_buf(Fifo8 *fifo, uint8_t *dest, uint32_t destlen)
|
||||
{
|
||||
return fifo8_peekpop_buf(fifo, dest, destlen, false);
|
||||
}
|
||||
|
||||
void fifo8_drop(Fifo8 *fifo, uint32_t len)
|
||||
{
|
||||
len -= fifo8_pop_buf(fifo, NULL, len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue