From patchwork Mon Oct 31 06:06:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 122737 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 94F19B6FA1 for ; Mon, 31 Oct 2011 17:07:34 +1100 (EST) Received: from localhost ([::1]:60069 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKl1u-0007CP-6U for incoming@patchwork.ozlabs.org; Mon, 31 Oct 2011 02:07:30 -0400 Received: from eggs.gnu.org ([140.186.70.92]:54620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKl1f-00071X-5W for qemu-devel@nongnu.org; Mon, 31 Oct 2011 02:07:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RKl1c-00070e-U3 for qemu-devel@nongnu.org; Mon, 31 Oct 2011 02:07:15 -0400 Received: from ozlabs.org ([203.10.76.45]:45220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKl1c-0006zm-9x for qemu-devel@nongnu.org; Mon, 31 Oct 2011 02:07:12 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 581DEB6F83; Mon, 31 Oct 2011 17:07:08 +1100 (EST) From: David Gibson To: mst@redhat.com, anthony@codemonkey.ws Date: Mon, 31 Oct 2011 17:06:51 +1100 Message-Id: <1320041218-30487-8-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1320041218-30487-1-git-send-email-david@gibson.dropbear.id.au> References: <1320041218-30487-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 203.10.76.45 Cc: joerg.roedel@amd.com, qemu-devel@nongnu.org, agraf@suse.de, avi@redhat.com, eduard.munteanu@linux360.ro, rth@twiddle.net Subject: [Qemu-devel] [PATCH 07/14] es1370: Use PCI DMA stub functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Eduard - Gabriel Munteanu This updates the es1370 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/es1370.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/es1370.c b/hw/es1370.c index 2daadde..c5c16b0 100644 --- a/hw/es1370.c +++ b/hw/es1370.c @@ -30,6 +30,7 @@ #include "audiodev.h" #include "audio/audio.h" #include "pci.h" +#include "dma.h" /* Missing stuff: SCTRL_P[12](END|ST)INC @@ -802,7 +803,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel, if (!acquired) break; - cpu_physical_memory_write (addr, tmpbuf, acquired); + pci_dma_write (&s->dev, addr, tmpbuf, acquired); temp -= acquired; addr += acquired; @@ -816,7 +817,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel, int copied, to_copy; to_copy = audio_MIN ((size_t) temp, sizeof (tmpbuf)); - cpu_physical_memory_read (addr, tmpbuf, to_copy); + pci_dma_read (&s->dev, addr, tmpbuf, to_copy); copied = AUD_write (voice, tmpbuf, to_copy); if (!copied) break;