mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
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>
This commit is contained in:
parent
bbca72c621
commit
10dc8aef41
1 changed files with 6 additions and 2 deletions
8
dma.h
8
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,
|
||||
|
|
Loading…
Reference in a new issue