[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 2/5] dma-helpers: allow including from target-ind
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH v2 2/5] dma-helpers: allow including from target-independent code |
Date: |
Fri, 16 Sep 2011 16:40:01 +0200 |
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 <address@hidden>
---
dma.h | 8 ++++++--
qemu-common.h | 1 +
2 files changed, 7 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,
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 <stdlib.h>
--
1.7.6
- [Qemu-devel] [PATCH v2 0/5] block: preparatory patches for scatter/gather support, Paolo Bonzini, 2011/09/16
- [Qemu-devel] [PATCH v2 2/5] dma-helpers: allow including from target-independent code,
Paolo Bonzini <=
- [Qemu-devel] [PATCH v2 4/5] scsi-disk: commonize iovec creation between reads and writes, Paolo Bonzini, 2011/09/16
- [Qemu-devel] [PATCH v2 1/5] dma-helpers: rename is_write to to_dev, Paolo Bonzini, 2011/09/16
- [Qemu-devel] [PATCH v2 5/5] scsi-disk: lazily allocate bounce buffer, Paolo Bonzini, 2011/09/16
- [Qemu-devel] [PATCH v2 3/5] dma-helpers: rewrite completion/cancellation, Paolo Bonzini, 2011/09/16
- Re: [Qemu-devel] [PATCH v2 0/5] block: preparatory patches for scatter/gather support, Kevin Wolf, 2011/09/19