From mboxrd@z Thu Jan 1 00:00:00 1970 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) Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 7 Sep 2011 17:20:59 +0200 Message-Id: <1315408862-15178-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1315408862-15178-1-git-send-email-pbonzini@redhat.com> References: <1315408862-15178-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 2/5] dma-helpers: allow including from target-independent code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@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 -- 1.7.6