[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/10] pcnet-pci: Use PCI DMA stub functions
From: |
David Gibson |
Subject: |
[Qemu-devel] [PATCH 08/10] pcnet-pci: Use PCI DMA stub functions |
Date: |
Thu, 1 Sep 2011 15:01:01 +1000 |
From: Eduard - Gabriel Munteanu <address@hidden>
This updates the pcnet-pci device emulation to use the explicit PCI DMA
functions, instead of directly calling physical memory access functions.
Signed-off-by: Eduard - Gabriel Munteanu <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/pcnet-pci.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/pcnet-pci.c b/hw/pcnet-pci.c
index 51e1320..40403a9 100644
--- a/hw/pcnet-pci.c
+++ b/hw/pcnet-pci.c
@@ -31,6 +31,7 @@
#include "net.h"
#include "loader.h"
#include "qemu-timer.h"
+#include "dma.h"
#include "pcnet.h"
@@ -230,13 +231,13 @@ static const MemoryRegionOps pcnet_mmio_ops = {
static void pci_physical_memory_write(void *dma_opaque, target_phys_addr_t
addr,
uint8_t *buf, int len, int do_bswap)
{
- cpu_physical_memory_write(addr, buf, len);
+ pci_dma_write(dma_opaque, addr, buf, len);
}
static void pci_physical_memory_read(void *dma_opaque, target_phys_addr_t addr,
uint8_t *buf, int len, int do_bswap)
{
- cpu_physical_memory_read(addr, buf, len);
+ pci_dma_read(dma_opaque, addr, buf, len);
}
static void pci_pcnet_cleanup(VLANClientState *nc)
@@ -302,6 +303,7 @@ static int pci_pcnet_init(PCIDevice *pci_dev)
s->irq = pci_dev->irq[0];
s->phys_mem_read = pci_physical_memory_read;
s->phys_mem_write = pci_physical_memory_write;
+ s->dma_opaque = pci_dev;
if (!pci_dev->qdev.hotplugged) {
static int loaded = 0;
--
1.7.5.4
- Re: [Qemu-devel] [PATCH 01/10] Add stub functions for PCI device models to do PCI DMA, (continued)
- [Qemu-devel] [PATCH 10/10] intel-hda: Use PCI DMA stub functions, David Gibson, 2011/09/01
- [Qemu-devel] [PATCH 03/10] eepro100: Use PCI DMA stub functions, David Gibson, 2011/09/01
- [Qemu-devel] [PATCH 04/10] ac97: Use PCI DMA stub functions, David Gibson, 2011/09/01
- [Qemu-devel] [PATCH 07/10] lsi53c895a: Use PCI DMA stub functions, David Gibson, 2011/09/01
- [Qemu-devel] [PATCH 08/10] pcnet-pci: Use PCI DMA stub functions,
David Gibson <=
- [Qemu-devel] [PATCH 05/10] es1370: Use PCI DMA stub functions, David Gibson, 2011/09/01
- [Qemu-devel] [PATCH 02/10] rtl8139: Use PCI DMA stub functions, David Gibson, 2011/09/01
- [Qemu-devel] [PATCH 06/10] e1000: Use PCI DMA stub functions, David Gibson, 2011/09/01
- [Qemu-devel] [PATCH 09/10] usb-ohci: Use PCI DMA stub functions, David Gibson, 2011/09/01
- Re: [Qemu-devel] [0/10] Preliminary work for IOMMU emulation support; the easy bits, Eduard - Gabriel Munteanu, 2011/09/01