Alright, Ive put something together. Will CC on a series that will include it shortly.
Regards, Peter On Wed, Aug 1, 2012 at 5:08 AM, Igor Mitsyanko <i.mitsya...@samsung.com> wrote: > 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. >> >> Regards, >> Peter >> >> > > 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.