From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSF3I-0005Mz-ED for qemu-devel@nongnu.org; Tue, 05 Jan 2010 14:26:48 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSF3D-0005Iu-5K for qemu-devel@nongnu.org; Tue, 05 Jan 2010 14:26:47 -0500 Received: from [199.232.76.173] (port=33972 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSF3D-0005Iq-1G for qemu-devel@nongnu.org; Tue, 05 Jan 2010 14:26:43 -0500 Received: from mx20.gnu.org ([199.232.41.8]:35457) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NSF3C-0002qi-Nc for qemu-devel@nongnu.org; Tue, 05 Jan 2010 14:26:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NS9FC-0005WJ-Sr for qemu-devel@nongnu.org; Tue, 05 Jan 2010 08:14:43 -0500 Date: Tue, 5 Jan 2010 15:11:24 +0200 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] [PATCH 1/6] PCI config space access overhaul Message-ID: <20100105131124.GA27684@redhat.com> References: <1262590375-11431-1-git-send-email-agraf@suse.de> <1262590375-11431-2-git-send-email-agraf@suse.de> <20100105124638.GA29412@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100105124638.GA29412@valinux.co.jp> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: Blue Swirl , Alexander Graf , Aurelien Jarno , QEMU Developers On Tue, Jan 05, 2010 at 09:46:38PM +0900, Isaku Yamahata wrote: > > diff --git a/hw/pci_host_template_all.h b/hw/pci_host_template_all.h > > new file mode 100644 > > index 0000000..74b3e84 > > --- /dev/null > > +++ b/hw/pci_host_template_all.h > > @@ -0,0 +1,23 @@ > > +#define PCI_HOST_BWL b > > +#define PCI_HOST_BITS 8 > > + > > +#include "pci_host_template.h" > > + > > +#undef PCI_HOST_BWL > > +#undef PCI_HOST_BITS > > + > > +#define PCI_HOST_BWL w > > +#define PCI_HOST_BITS 16 > > + > > +#include "pci_host_template.h" > > + > > +#undef PCI_HOST_BWL > > +#undef PCI_HOST_BITS > > + > > +#define PCI_HOST_BWL l > > +#define PCI_HOST_BITS 32 > > + > > +#include "pci_host_template.h" > > + > > +#undef PCI_HOST_BWL > > +#undef PCI_HOST_BITS > > Oh, another new cpp tricks. > I'm ok with this trick. However Michael may have his own idea. I'm ok, yes. Though long term, we should think about switching to an API that does not result in all this horrible boilerplate code that we are then forced to work around with macros. And it need not be hard: we just want 1. bswap(addr, len) 2. wrapper around cpu_register_io_memory that gets length and passes it on. > This trick would be split out into independent patch. Yes.