From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5yCO-0004ow-EQ for qemu-devel@nongnu.org; Tue, 20 Sep 2011 07:09:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5yCJ-0008WI-If for qemu-devel@nongnu.org; Tue, 20 Sep 2011 07:09:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5yCJ-0008W4-1B for qemu-devel@nongnu.org; Tue, 20 Sep 2011 07:09:07 -0400 From: Kevin Wolf Date: Tue, 20 Sep 2011 13:11:39 +0200 Message-Id: <1316517112-9908-8-git-send-email-kwolf@redhat.com> In-Reply-To: <1316517112-9908-1-git-send-email-kwolf@redhat.com> References: <1316517112-9908-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 07/20] dma-helpers: allow including from target-independent code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Paolo Bonzini 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 Signed-off-by: Kevin Wolf --- dma.h | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dma.h b/dma.h index b222346..2bdc236 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, -- 1.7.6.2