From patchwork Wed Sep 7 15:20:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 113773 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 22107B6F81 for ; Thu, 8 Sep 2011 01:22:02 +1000 (EST) Received: from localhost ([::1]:45423 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1Jws-0003sP-6o for incoming@patchwork.ozlabs.org; Wed, 07 Sep 2011 11:21:58 -0400 Received: from eggs.gnu.org ([140.186.70.92]:40633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1JwI-0002Jr-6T for qemu-devel@nongnu.org; Wed, 07 Sep 2011 11:21:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R1JwC-00086p-9q for qemu-devel@nongnu.org; Wed, 07 Sep 2011 11:21:22 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:48471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1JwC-00086l-68 for qemu-devel@nongnu.org; Wed, 07 Sep 2011 11:21:16 -0400 Received: by gye5 with SMTP id 5so551615gye.4 for ; Wed, 07 Sep 2011 08:21:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; bh=uWc3edoluf0evskjq595DC8a0p//Txj6Az4b/FhGbj0=; b=d3jyD/NsBVRjiAT+9Omzg0+I3tH3QHwLPBIT7Rvo6Me1dujcs4ayYT3ho8sOwG66Qd 144luGgOC7Z7l6styarr4FDDfwsX+AOp+SU1ct5gn8NKxuTA5v1XjQoEr7Js6TG65uUi POk9Hf9knHHaLUlNP91h7w7Tbynlg28RC7cn8= Received: by 10.236.191.103 with SMTP id f67mr21675544yhn.16.1315408875682; Wed, 07 Sep 2011 08:21:15 -0700 (PDT) Received: from localhost.localdomain (93-34-199-31.ip51.fastwebnet.it [93.34.199.31]) by mx.google.com with ESMTPS id a12sm325187yhh.17.2011.09.07.08.21.13 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 07 Sep 2011 08:21:14 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 7 Sep 2011 17:20:59 +0200 Message-Id: <1315408862-15178-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1315408862-15178-1-git-send-email-pbonzini@redhat.com> References: <1315408862-15178-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.160.173 Subject: [Qemu-devel] [PATCH 2/5] dma-helpers: allow including from target-independent code 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 Target-independent code cannot construct sglists, but it can take them from the outside as a black box. Allow this. Signed-off-by: Paolo Bonzini --- dma.h | 8 ++++++-- qemu-common.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dma.h b/dma.h index a6db5ba..f7e0142 100644 --- a/dma.h +++ b/dma.h @@ -15,10 +15,13 @@ #include "hw/hw.h" #include "block.h" -typedef struct { +typedef struct ScatterGatherEntry ScatterGatherEntry; + +#if defined(TARGET_PHYS_ADDR_BITS) +struct ScatterGatherEntry { target_phys_addr_t base; target_phys_addr_t len; -} ScatterGatherEntry; +}; struct QEMUSGList { ScatterGatherEntry *sg; @@ -31,6 +34,7 @@ void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint); void qemu_sglist_add(QEMUSGList *qsg, target_phys_addr_t base, target_phys_addr_t len); void qemu_sglist_destroy(QEMUSGList *qsg); +#endif typedef BlockDriverAIOCB *DMAIOFunc(BlockDriverState *bs, int64_t sector_num, QEMUIOVector *iov, int nb_sectors, diff --git a/qemu-common.h b/qemu-common.h index 404c421..ef9a2bb 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -18,6 +18,7 @@ typedef struct DeviceState DeviceState; struct Monitor; typedef struct Monitor Monitor; +typedef struct QEMUSGList QEMUSGList; /* we put basic includes here to avoid repeating them in device drivers */ #include