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.