提交 10dc8aef 编写于 作者: P Paolo Bonzini 提交者: Kevin Wolf

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: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 bbca72c6
...@@ -15,10 +15,13 @@ ...@@ -15,10 +15,13 @@
#include "hw/hw.h" #include "hw/hw.h"
#include "block.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 base;
target_phys_addr_t len; target_phys_addr_t len;
} ScatterGatherEntry; };
struct QEMUSGList { struct QEMUSGList {
ScatterGatherEntry *sg; ScatterGatherEntry *sg;
...@@ -31,6 +34,7 @@ void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint); ...@@ -31,6 +34,7 @@ void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint);
void qemu_sglist_add(QEMUSGList *qsg, target_phys_addr_t base, void qemu_sglist_add(QEMUSGList *qsg, target_phys_addr_t base,
target_phys_addr_t len); target_phys_addr_t len);
void qemu_sglist_destroy(QEMUSGList *qsg); void qemu_sglist_destroy(QEMUSGList *qsg);
#endif
typedef BlockDriverAIOCB *DMAIOFunc(BlockDriverState *bs, int64_t sector_num, typedef BlockDriverAIOCB *DMAIOFunc(BlockDriverState *bs, int64_t sector_num,
QEMUIOVector *iov, int nb_sectors, QEMUIOVector *iov, int nb_sectors,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册