From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduard - Gabriel Munteanu Subject: [PATCH 08/13] es1370: use the DMA memory access interface Date: Sat, 29 Jan 2011 19:40:29 +0200 Message-ID: References: Cc: blauwirbel@gmail.com, paul@codesourcery.com, avi@redhat.com, anthony@codemonkey.ws, av1474@comtv.ru, yamahata@valinux.co.jp, kvm@vger.kernel.org, qemu-devel@nongnu.org, Eduard - Gabriel Munteanu To: joro@8bytes.org Return-path: Received: from mail-fx0-f46.google.com ([209.85.161.46]:50369 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754684Ab1A2RlE (ORCPT ); Sat, 29 Jan 2011 12:41:04 -0500 Received: by mail-fx0-f46.google.com with SMTP id 20so4372013fxm.19 for ; Sat, 29 Jan 2011 09:41:04 -0800 (PST) In-Reply-To: In-Reply-To: References: Sender: kvm-owner@vger.kernel.org List-ID: This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/es1370.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/es1370.c b/hw/es1370.c index 40cb48c..8b1a405 100644 --- a/hw/es1370.c +++ b/hw/es1370.c @@ -802,7 +802,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel, if (!acquired) break; - cpu_physical_memory_write (addr, tmpbuf, acquired); + dma_memory_write (&s->dev.dma, addr, tmpbuf, acquired); temp -= acquired; addr += acquired; @@ -816,7 +816,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); + dma_memory_read (&s->dev.dma, addr, tmpbuf, to_copy); copied = AUD_write (voice, tmpbuf, to_copy); if (!copied) break; -- 1.7.3.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60008 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjEnK-0005A2-5a for qemu-devel@nongnu.org; Sat, 29 Jan 2011 12:41:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PjEnI-0004h3-Tk for qemu-devel@nongnu.org; Sat, 29 Jan 2011 12:41:05 -0500 Received: from mail-fx0-f45.google.com ([209.85.161.45]:35571) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PjEnI-0004be-LC for qemu-devel@nongnu.org; Sat, 29 Jan 2011 12:41:04 -0500 Received: by mail-fx0-f45.google.com with SMTP id 12so4523658fxm.4 for ; Sat, 29 Jan 2011 09:41:04 -0800 (PST) Sender: Eduard - Gabriel Munteanu From: Eduard - Gabriel Munteanu Date: Sat, 29 Jan 2011 19:40:29 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: Subject: [Qemu-devel] [PATCH 08/13] es1370: use the DMA memory access interface List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: joro@8bytes.org Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org, blauwirbel@gmail.com, yamahata@valinux.co.jp, paul@codesourcery.com, Eduard - Gabriel Munteanu , avi@redhat.com This allows the device to work properly with an emulated IOMMU. Signed-off-by: Eduard - Gabriel Munteanu --- hw/es1370.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/es1370.c b/hw/es1370.c index 40cb48c..8b1a405 100644 --- a/hw/es1370.c +++ b/hw/es1370.c @@ -802,7 +802,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel, if (!acquired) break; - cpu_physical_memory_write (addr, tmpbuf, acquired); + dma_memory_write (&s->dev.dma, addr, tmpbuf, acquired); temp -= acquired; addr += acquired; @@ -816,7 +816,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); + dma_memory_read (&s->dev.dma, addr, tmpbuf, to_copy); copied = AUD_write (voice, tmpbuf, to_copy); if (!copied) break; -- 1.7.3.4