On Thu, Sep 01, 2011 at 06:35:51PM +0300, Michael S. Tsirkin wrote: > On Thu, Sep 01, 2011 at 03:00:54PM +1000, David Gibson wrote: [snip] > > +#define DECLARE_LDST_DMA(_lname, _sname, _bits) \ > > + uint##_bits##_t ld##_lname##_pci_dma(PCIDevice *dev, dma_addr_t addr); > > \ > > + void st##_sname##_pci_dma(PCIDevice *dev, dma_addr_t addr, \ > > + uint##_bits##_t val); \ > > prefix macros with PCI_ please.
Corrected for the next spin. > > +DECLARE_LDST_DMA(ub, b, 8); > > +DECLARE_LDST_DMA(uw, w, 16); > > +DECLARE_LDST_DMA(l, l, 32); > > +DECLARE_LDST_DMA(q, q, 64); > > + > > +#undef DECLARE_LDST_DMA > > + > > #endif > > I'd prefer the stubs to be inline. Not just as an optimization: > it also makes it easier to grok what goes on in the common > no-iommu case. To elaborate on my earlier mail. The problem with making them inlines is that the cpu_physical_*() functions then appear in pci.h, which is used in pci.c amongst other places that are included in libhw32/libhw64, where those functions are poisoned. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson