qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] fifo8: add fifo8_peek(), fifo8_peek_buf() and tests
@ 2024-08-28 12:22 Mark Cave-Ayland
  2024-08-28 12:22 ` [PATCH 1/9] fifo8: rename fifo8_peekpop_buf() to fifo8_peekpop_bufptr() Mark Cave-Ayland
                   ` (9 more replies)
  0 siblings, 10 replies; 33+ messages in thread
From: Mark Cave-Ayland @ 2024-08-28 12:22 UTC (permalink / raw)
  To: philmd, Alistair.Francis, tavip, qemu-devel

This is something I've had lying around for a little while as a follow on from
Phil's recent work on Fifo8 with a few updates, but also adding the missing
fifo8_peek() and fifo8_peek_buf() functions along with some relevant tests.

The reason for sending this now is that there are couple of recent series
(https://patchew.org/QEMU/20240819113148.3007047-1-alistair.francis@wdc.com/ and
https://patchew.org/QEMU/20240817102606.3996242-1-tavip@google.com/) which can
benefit from these changes: in particular the fifo8_peek_buf() function, unlike the
existing fifo8_peek_bufptr() function, will correctly handle FIFO wraparound. This
occurs when the FIFO head drifts due to not popping the entire FIFO content in one
go, which often happens when trying to send FIFO data to a chardev.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


Mark Cave-Ayland (9):
  fifo8: rename fifo8_peekpop_buf() to fifo8_peekpop_bufptr()
  fifo8: introduce head variable for fifo8_peekpop_bufptr()
  fifo8: add skip parameter to fifo8_peekpop_bufptr()
  fifo8: replace fifo8_pop_bufptr() with fifo8_peekpop_bufptr() in
    fifo8_pop_buf()
  fifo8: rename fifo8_pop_buf() to fifo8_peekpop_buf()
  fifo8: honour do_pop argument in fifo8_peekpop_buf()
  fifo8: add fifo8_peek_buf() function
  fifo8: introduce fifo8_peek() function
  tests/unit: add test-fifo unit test

 include/qemu/fifo8.h   |  25 ++++
 tests/unit/meson.build |   1 +
 tests/unit/test-fifo.c | 256 +++++++++++++++++++++++++++++++++++++++++
 util/fifo8.c           |  42 +++++--
 4 files changed, 313 insertions(+), 11 deletions(-)
 create mode 100644 tests/unit/test-fifo.c

-- 
2.39.2



^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2024-09-07  4:51 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 12:22 [PATCH 0/9] fifo8: add fifo8_peek(), fifo8_peek_buf() and tests Mark Cave-Ayland
2024-08-28 12:22 ` [PATCH 1/9] fifo8: rename fifo8_peekpop_buf() to fifo8_peekpop_bufptr() Mark Cave-Ayland
2024-08-29 23:47   ` Alistair Francis
2024-08-31  0:02   ` Octavian Purdila
2024-08-28 12:22 ` [PATCH 2/9] fifo8: introduce head variable for fifo8_peekpop_bufptr() Mark Cave-Ayland
2024-08-29 23:47   ` Alistair Francis
2024-08-31  0:05   ` Octavian Purdila
2024-08-28 12:22 ` [PATCH 3/9] fifo8: add skip parameter to fifo8_peekpop_bufptr() Mark Cave-Ayland
2024-08-29 23:51   ` Alistair Francis
2024-08-31  0:13   ` Octavian Purdila
2024-08-28 12:22 ` [PATCH 4/9] fifo8: replace fifo8_pop_bufptr() with fifo8_peekpop_bufptr() in fifo8_pop_buf() Mark Cave-Ayland
2024-08-29 23:52   ` Alistair Francis
2024-08-31  0:15   ` Octavian Purdila
2024-08-28 12:22 ` [PATCH 5/9] fifo8: rename fifo8_pop_buf() to fifo8_peekpop_buf() Mark Cave-Ayland
2024-08-29 23:55   ` Alistair Francis
2024-08-31  0:17   ` Octavian Purdila
2024-08-28 12:22 ` [PATCH 6/9] fifo8: honour do_pop argument in fifo8_peekpop_buf() Mark Cave-Ayland
2024-08-29 23:57   ` Alistair Francis
2024-08-31  0:41   ` Octavian Purdila
2024-08-28 12:22 ` [PATCH 7/9] fifo8: add fifo8_peek_buf() function Mark Cave-Ayland
2024-08-29 23:58   ` Alistair Francis
2024-08-31  0:42   ` Octavian Purdila
2024-09-06 20:39   ` Mark Cave-Ayland
2024-08-28 12:22 ` [PATCH 8/9] fifo8: introduce fifo8_peek() function Mark Cave-Ayland
2024-08-29 23:59   ` Alistair Francis
2024-08-31  0:44   ` Octavian Purdila
2024-08-28 12:22 ` [PATCH 9/9] tests/unit: add test-fifo unit test Mark Cave-Ayland
2024-08-30  0:01   ` Alistair Francis
2024-08-31  1:18   ` Octavian Purdila
2024-09-06 20:49   ` Mark Cave-Ayland
2024-09-06 13:14 ` [PATCH 0/9] fifo8: add fifo8_peek(), fifo8_peek_buf() and tests Philippe Mathieu-Daudé
2024-09-06 20:51   ` Mark Cave-Ayland
2024-09-07  4:51     ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).