aboutsummaryrefslogtreecommitdiff
path: root/dma.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-09-16 16:40:01 +0200
committerKevin Wolf <kwolf@redhat.com>2011-09-20 12:27:34 +0200
commit10dc8aef419b4ce77670fb080ffe995bf9d7b0a1 (patch)
tree75a4a475ee952dc86153401dc19a64b65ac7b0d9 /dma.h
parentbbca72c6215c3e1df72b80bb3f54fe3b2b05212b (diff)
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 <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'dma.h')
-rw-r--r--dma.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/dma.h b/dma.h
index b222346aa0..2bdc236c4c 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,