[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC] Factor out fifos / circular buffers

From: Igor Mitsyanko
Subject: Re: [Qemu-devel] [RFC] Factor out fifos / circular buffers
Date: Tue, 31 Jul 2012 23:08:03 +0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0

On 07/31/2012 02:20 PM, Peter Crosthwaite wrote:
Hi All,

A lot of devices have little internal fifos that are often implemented
as circular buffers in the device state. Any reason to not factor that
out into a helper module? Was thinkin just a struct defintion
containing the key elements (the uint8_t *data buffer, head/tail
pointers, capacity). and helper functions to create/destroy, put/get,
test for full/empty etc. And VMSD support - which will make devices a
lot cleaner if theres just one VM_STATE_FIFO instead of all these
little bits of implementation detail in the device state.


Just yesterday I thought, why there is no builtin FIFO api in QEMU?

I think majority of device models use fifos with length which is a power of 2, I think that's the way to go for these helpers at first.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]