From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SydH5-0007Xz-Nx for qemu-devel@nongnu.org; Tue, 07 Aug 2012 02:28:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SydH4-0005IH-PR for qemu-devel@nongnu.org; Tue, 07 Aug 2012 02:28:15 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:29041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SydH4-0005I9-Ja for qemu-devel@nongnu.org; Tue, 07 Aug 2012 02:28:14 -0400 Received: from eusync2.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M8D000PUGNQFY30@mailout2.w1.samsung.com> for qemu-devel@nongnu.org; Tue, 07 Aug 2012 07:28:38 +0100 (BST) Received: from [106.109.9.232] by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0M8D00E18GMZ0K30@eusync2.samsung.com> for qemu-devel@nongnu.org; Tue, 07 Aug 2012 07:28:12 +0100 (BST) Message-id: <5020B57B.8040401@samsung.com> Date: Tue, 07 Aug 2012 10:28:11 +0400 From: Igor Mitsyanko MIME-version: 1.0 References: <81b9e406e0b0292ccd3168385ab6a73a78a0ada5.1344218410.git.peter.crosthwaite@petalogix.com> <501F93DD.8090905@samsung.com> In-reply-to: Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 09/15] hw: Added generic FIFO API. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: peter.maydell@linaro.org, stefanha@gmail.com, qemu-devel@nongnu.org, paul@codesourcery.com, edgar.iglesias@gmail.com, john.williams@petalogix.com On 08/07/2012 10:10 AM, Peter Crosthwaite wrote: >>> + >>> +extern const VMStateDescription vmstate_fifo8; >>> + >>> +#define VMSTATE_FIFO8(_field, _state) { \ >>> + .name = (stringify(_field)), \ >>> + .size = sizeof(Fifo8), \ >>> + .vmsd = &vmstate_fifo8, \ >>> + .flags = VMS_STRUCT, \ >>> + .offset = vmstate_offset_value(_state, _field, Fifo8), \ >>> +} >> >> how about implementing this as a wrapper to VMSTATE_STRUCT_TEST() macro >> instead? > This has no existing precedent in QEMU so I am unsure of what you mean? I meant VMSTATE_TIMER_TEST() in vmstate.h as an example, which is a wrapper to VMSTATE_POINTER_TEST(). With this approach, fifo macro could be #define VMSTATE_FIFO8(_field, _state) \ VMSTATE_STRUCT(_field, _state, 0, vmstate_fifo8, Fifo8) > > And maybe this should go to vmstate.h header > > I disagree. All other clients of VMS_STRUCT are out in their repective > device specific headers (pci.h, i2c.h) etc. Unless this is new > established policy, I dont really want to change the current adopted > approach. Yeah, looks like you're right. > Regards, > Peter > >> >>> + >>> +#endif /* FIFO_H */ >>