From 5fa45de5623abd3a6d0b9575a4f014cbfe886b36 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 27 Jun 2012 14:50:45 +1000 Subject: iommu: Allow PCI to use IOMMU infrastructure This patch adds some hooks to let PCI devices and busses use the new IOMMU infrastructure. When IOMMU support is enabled, each PCI device now contains a DMAContext * which is used by the pci_dma_*() wrapper functions. By default, the contexts are initialized to NULL, assuming no IOMMU. However the platform or host bridge code which sets up the PCI bus can use pci_setup_iommu() to set a function which will determine the correct DMAContext for a given PCI device. Cc: Michael S. Tsirkin Cc: Richard Henderson Signed-off-by: David Gibson Signed-off-by: Eduard - Gabriel Munteanu Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Anthony Liguori --- hw/pci_internals.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hw/pci_internals.h') diff --git a/hw/pci_internals.h b/hw/pci_internals.h index 399c6d475c..e8bc9f61eb 100644 --- a/hw/pci_internals.h +++ b/hw/pci_internals.h @@ -17,6 +17,8 @@ struct PCIBus { BusState qbus; + PCIDMAContextFunc dma_context_fn; + void *dma_context_opaque; uint8_t devfn_min; pci_set_irq_fn set_irq; pci_map_irq_fn map_irq; -- cgit v1.2.3