]> git.ipfire.org Git - thirdparty/qemu.git/commit
esp.c: add FIFO wraparound support to esp_fifo_pop_buf()
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Fri, 12 Jan 2024 12:52:55 +0000 (12:52 +0000)
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tue, 13 Feb 2024 19:37:04 +0000 (19:37 +0000)
commit49c60d1617d4870a5e7c4f9c2dc24fb3759b9679
treeb050407bdc561f6850e2aeb33a0d872187d150cc
parentcf40a5e42084e157e1cd7bed2619f3b44fbb3fe8
esp.c: add FIFO wraparound support to esp_fifo_pop_buf()

The fifo8_pop_buf() function returns a pointer to the FIFO buffer up to the
specified length. Since the FIFO buffer is modelled as an array then once
the FIFO wraps around, only the continuous portion of the buffer can be
returned.

In future the use of continuous and unaligned accesses will advance the
internal FIFO head pointer, so modify esp_fifo_pop_buf() to ensure that
any wraparound content is also returned up to the requested length.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tested-by: Helge Deller <deller@gmx.de>
Tested-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20240112125420.514425-4-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
hw/scsi/esp.c