]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Define DMA address and direction types
authorDavid Gibson <david@gibson.dropbear.id.au>
Mon, 31 Oct 2011 06:06:45 +0000 (17:06 +1100)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 1 Nov 2011 21:52:05 +0000 (16:52 -0500)
As a preliminary to adding more extensive DMA and IOMMU infrastructure
support into qemu, this patch defines a dma_addr_t for storing DMA bus
addresses and a DMADirection enum which describes whether a DMA is
from an external device to main memory or from main memory to an
external device.

For now dma_addr_t is just defined to be target_phys_addr_t, but in
future, we can change this to support machines where we have bus
addresses which don't necessarily have the same format as CPU physical
addresses.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
dma.h

diff --git a/dma.h b/dma.h
index 2bdc236c4c190366e7df35fad29c879ed7c42c4f..56e163a58f088b25d0d5bc7539fa5710edac9b54 100644 (file)
--- a/dma.h
+++ b/dma.h
 typedef struct ScatterGatherEntry ScatterGatherEntry;
 
 #if defined(TARGET_PHYS_ADDR_BITS)
+typedef target_phys_addr_t dma_addr_t;
+
+#define DMA_ADDR_FMT TARGET_FMT_plx
+
+typedef enum {
+    DMA_DIRECTION_TO_DEVICE = 0,
+    DMA_DIRECTION_FROM_DEVICE = 1,
+} DMADirection;
+
 struct ScatterGatherEntry {
     target_phys_addr_t base;
     target_phys_addr_t len;