[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/14] Define DMA address and direction types
From: |
David Gibson |
Subject: |
[Qemu-devel] [PATCH 01/14] Define DMA address and direction types |
Date: |
Mon, 31 Oct 2011 17:06:45 +1100 |
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 <address@hidden>
---
dma.h | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/dma.h b/dma.h
index 2bdc236..56e163a 100644
--- a/dma.h
+++ b/dma.h
@@ -18,6 +18,15 @@
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;
--
1.7.7
- [Qemu-devel] [0/14] Preliminary work for IOMMU emulation support (v3), David Gibson, 2011/10/31
- [Qemu-devel] [PATCH 02/14] Use dma_addr_t type for scatter/gather code, David Gibson, 2011/10/31
- [Qemu-devel] [PATCH 07/14] es1370: Use PCI DMA stub functions, David Gibson, 2011/10/31
- [Qemu-devel] [PATCH 01/14] Define DMA address and direction types,
David Gibson <=
- [Qemu-devel] [PATCH 03/14] Add stub functions for PCI device models to do PCI DMA, David Gibson, 2011/10/31
- [Qemu-devel] [PATCH 08/14] e1000: Use PCI DMA stub functions, David Gibson, 2011/10/31
- [Qemu-devel] [PATCH 14/14] usb-uhci: Use PCI DMA stub functions, David Gibson, 2011/10/31
- [Qemu-devel] [PATCH 10/14] pcnet-pci: Use PCI DMA stub functions, David Gibson, 2011/10/31
- [Qemu-devel] [PATCH 04/14] rtl8139: Use PCI DMA stub functions, David Gibson, 2011/10/31
- [Qemu-devel] [PATCH 05/14] eepro100: Use PCI DMA stub functions, David Gibson, 2011/10/31
- [Qemu-devel] [PATCH 06/14] ac97: Use PCI DMA stub functions, David Gibson, 2011/10/31
- [Qemu-devel] [PATCH 11/14] intel-hda: Use PCI DMA stub functions, David Gibson, 2011/10/31
- [Qemu-devel] [PATCH 12/14] PCI IDE: Use PCI DMA stub functions, David Gibson, 2011/10/31