4 * Copyright (c) 2009 Red Hat
6 * This work is licensed under the terms of the GNU General Public License
7 * (GNU GPL), version 2 or later.
18 typedef struct ScatterGatherEntry ScatterGatherEntry
;
20 #if defined(TARGET_PHYS_ADDR_BITS)
21 struct ScatterGatherEntry
{
22 target_phys_addr_t base
;
23 target_phys_addr_t len
;
27 ScatterGatherEntry
*sg
;
30 target_phys_addr_t size
;
33 void qemu_sglist_init(QEMUSGList
*qsg
, int alloc_hint
);
34 void qemu_sglist_add(QEMUSGList
*qsg
, target_phys_addr_t base
,
35 target_phys_addr_t len
);
36 void qemu_sglist_destroy(QEMUSGList
*qsg
);
39 typedef BlockDriverAIOCB
*DMAIOFunc(BlockDriverState
*bs
, int64_t sector_num
,
40 QEMUIOVector
*iov
, int nb_sectors
,
41 BlockDriverCompletionFunc
*cb
, void *opaque
);
43 BlockDriverAIOCB
*dma_bdrv_io(BlockDriverState
*bs
,
44 QEMUSGList
*sg
, uint64_t sector_num
,
45 DMAIOFunc
*io_func
, BlockDriverCompletionFunc
*cb
,
46 void *opaque
, bool to_dev
);
47 BlockDriverAIOCB
*dma_bdrv_read(BlockDriverState
*bs
,
48 QEMUSGList
*sg
, uint64_t sector
,
49 BlockDriverCompletionFunc
*cb
, void *opaque
);
50 BlockDriverAIOCB
*dma_bdrv_write(BlockDriverState
*bs
,
51 QEMUSGList
*sg
, uint64_t sector
,
52 BlockDriverCompletionFunc
*cb
, void *opaque
);