From: Beniamino Galvani <b.galvani@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Peter Crosthwaite" <peter.crosthwaite@xilinx.com>,
"Stefan Hajnoczi" <stefanha@gmail.com>,
"Beniamino Galvani" <b.galvani@gmail.com>,
"Andreas Färber" <afaerber@suse.de>,
"Li Guang" <lig.fnst@cn.fujitsu.com>
Subject: [Qemu-devel] [PATCH v5 2/4] util/fifo8: clear fifo head upon reset
Date: Thu, 30 Jan 2014 23:02:05 +0100 [thread overview]
Message-ID: <1391119327-18190-3-git-send-email-b.galvani@gmail.com> (raw)
In-Reply-To: <1391119327-18190-1-git-send-email-b.galvani@gmail.com>
To improve the predictability of fifo8_pop_buf(), the fifo head is set
to 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>
---
util/fifo8.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/util/fifo8.c b/util/fifo8.c
index a7503c2..6a43482 100644
--- a/util/fifo8.c
+++ b/util/fifo8.c
@@ -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)
--
1.7.10.4
next prev parent reply other threads:[~2014-01-30 22:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-30 22:02 [Qemu-devel] [PATCH v5 0/4] hw/arm: add ethernet support to Allwinner A10 Beniamino Galvani
2014-01-30 22:02 ` [Qemu-devel] [PATCH v5 1/4] util/fifo8: implement push/pop of multiple bytes Beniamino Galvani
2014-02-05 5:25 ` Peter Crosthwaite
2014-01-30 22:02 ` Beniamino Galvani [this message]
2014-02-05 5:28 ` [Qemu-devel] [PATCH v5 2/4] util/fifo8: clear fifo head upon reset Peter Crosthwaite
2014-01-30 22:02 ` [Qemu-devel] [PATCH v5 3/4] hw/net: add support for Allwinner EMAC Fast Ethernet controller Beniamino Galvani
2014-01-30 22:02 ` [Qemu-devel] [PATCH v5 4/4] hw/arm/allwinner-a10: initialize EMAC Beniamino Galvani
2014-02-08 14:11 ` [Qemu-devel] [PATCH v5 0/4] hw/arm: add ethernet support to Allwinner A10 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1391119327-18190-3-git-send-email-b.galvani@gmail.com \
--to=b.galvani@gmail.com \
--cc=afaerber@suse.de \
--cc=lig.fnst@cn.fujitsu.com \
--cc=peter.crosthwaite@xilinx.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).