From: Paolo Bonzini Date: Fri, 16 Sep 2011 14:40:01 +0000 (+0200) Subject: dma-helpers: allow including from target-independent code X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~5279^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10dc8aef419b4ce77670fb080ffe995bf9d7b0a1;p=sdk%2Femulator%2Fqemu.git dma-helpers: allow including from target-independent code 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 --- 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,