Re: [Qemu-devel] [PATCH v4 1/3] util/fifo8: implement push/pop of multiple bytes

2014-01-29 Thread Peter Crosthwaite
On Wed, Jan 29, 2014 at 4:48 AM, Beniamino Galvani wrote: > On Tue, Jan 28, 2014 at 10:43:28AM +, Peter Maydell wrote: >> On 28 January 2014 00:04, Peter Crosthwaite >> wrote: >> > On Tue, Jan 28, 2014 at 4:32 AM, Peter Maydell >> > wrote: >> >>> void fifo8_reset(Fifo8 *fifo) >> >>> { >>

Re: [Qemu-devel] [PATCH v4 1/3] util/fifo8: implement push/pop of multiple bytes

2014-01-28 Thread Beniamino Galvani
On Tue, Jan 28, 2014 at 10:43:28AM +, Peter Maydell wrote: > On 28 January 2014 00:04, Peter Crosthwaite > wrote: > > On Tue, Jan 28, 2014 at 4:32 AM, Peter Maydell > > wrote: > >>> void fifo8_reset(Fifo8 *fifo) > >>> { > >>> fifo->num = 0; > >>> +fifo->head = 0; > >> > >> This is

Re: [Qemu-devel] [PATCH v4 1/3] util/fifo8: implement push/pop of multiple bytes

2014-01-28 Thread Beniamino Galvani
On Tue, Jan 28, 2014 at 10:04:09AM +1000, Peter Crosthwaite wrote: > On Tue, Jan 28, 2014 at 4:32 AM, Peter Maydell > wrote: > > On 26 January 2014 21:39, Beniamino Galvani wrote: > >> In some circumstances it is useful to be able to push the entire > >> content of a memory buffer to the fifo or

Re: [Qemu-devel] [PATCH v4 1/3] util/fifo8: implement push/pop of multiple bytes

2014-01-28 Thread Peter Maydell
On 28 January 2014 00:04, Peter Crosthwaite wrote: > On Tue, Jan 28, 2014 at 4:32 AM, Peter Maydell > wrote: >>> void fifo8_reset(Fifo8 *fifo) >>> { >>> fifo->num = 0; >>> +fifo->head = 0; >> >> This is a bug fix, right? It should go in its own patch. >> > > No bug - where the ring bu

Re: [Qemu-devel] [PATCH v4 1/3] util/fifo8: implement push/pop of multiple bytes

2014-01-27 Thread Peter Crosthwaite
On Tue, Jan 28, 2014 at 4:32 AM, Peter Maydell wrote: > On 26 January 2014 21:39, Beniamino Galvani wrote: >> In some circumstances it is useful to be able to push the entire >> content of a memory buffer to the fifo or to pop multiple bytes with a >> single operation. >> >> The functions fifo8_h

Re: [Qemu-devel] [PATCH v4 1/3] util/fifo8: implement push/pop of multiple bytes

2014-01-27 Thread Peter Maydell
On 26 January 2014 21:39, Beniamino Galvani wrote: > In some circumstances it is useful to be able to push the entire > content of a memory buffer to the fifo or to pop multiple bytes with a > single operation. > > The functions fifo8_has_space() and fifo8_push_all() added by this > patch allow to

[Qemu-devel] [PATCH v4 1/3] util/fifo8: implement push/pop of multiple bytes

2014-01-26 Thread Beniamino Galvani
In some circumstances it is useful to be able to push the entire content of a memory buffer to the fifo or to pop multiple bytes with a single operation. The functions fifo8_has_space() and fifo8_push_all() added by this patch allow to perform the first kind of operation efficiently. The function