From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyzOz-0006L0-1r for qemu-devel@nongnu.org; Thu, 01 Sep 2011 01:01:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QyzOx-0000b3-Sh for qemu-devel@nongnu.org; Thu, 01 Sep 2011 01:01:21 -0400 Received: from ozlabs.org ([203.10.76.45]:56809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyzOw-0000Zy-Sd for qemu-devel@nongnu.org; Thu, 01 Sep 2011 01:01:19 -0400 From: David Gibson Date: Thu, 1 Sep 2011 15:01:01 +1000 Message-Id: <1314853263-2086-9-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1314853263-2086-1-git-send-email-david@gibson.dropbear.id.au> References: <1314853263-2086-1-git-send-email-david@gibson.dropbear.id.au> Subject: [Qemu-devel] [PATCH 08/10] pcnet-pci: Use PCI DMA stub functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: joerg.roedel@amd.com, aliguori@us.ibm.com, rth@twiddle.net, agraf@suse.de, eduard.munteanu@linux360.ro From: Eduard - Gabriel Munteanu 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 Signed-off-by: David Gibson --- 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