[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/10] dma-helpers: allow including from target-inde
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 01/10] dma-helpers: allow including from target-independent code |
Date: |
Thu, 4 Aug 2011 19:14:39 +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 | 12 ++++++++----
qemu-common.h | 1 +
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/dma.h b/dma.h
index 3d8324b..f7e0142 100644
--- a/dma.h
+++ b/dma.h
@@ -15,22 +15,26 @@
#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;
+};
-typedef struct {
+struct QEMUSGList {
ScatterGatherEntry *sg;
int nsg;
int nalloc;
target_phys_addr_t size;
-} QEMUSGList;
+};
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 1e3c665..69c6595 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 00/10] SCSI scatter/gather support, Paolo Bonzini, 2011/08/04
- [Qemu-devel] [PATCH 01/10] dma-helpers: allow including from target-independent code,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 03/10] dma-helpers: rewrite completion/cancellation, Paolo Bonzini, 2011/08/04
- [Qemu-devel] [PATCH 02/10] dma-helpers: track position in the QEMUSGList, Paolo Bonzini, 2011/08/04
- [Qemu-devel] [PATCH 04/10] dma-helpers: prepare for adding dma_buf_* functions, Paolo Bonzini, 2011/08/04
- [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write, Paolo Bonzini, 2011/08/04
- Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write, Stefan Hajnoczi, 2011/08/11
- Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write, Paolo Bonzini, 2011/08/11
- Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write, Stefan Hajnoczi, 2011/08/11
- Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write, Paolo Bonzini, 2011/08/11
- Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write, Kevin Wolf, 2011/08/11
- Re: [Qemu-devel] [PATCH 05/10] dma-helpers: add dma_buf_read and dma_buf_write, Paolo Bonzini, 2011/08/11