Introduce block dma helpers (Avi Kivity)
These helpers perform read/write requests on entire scatter/gather lists,
relieving the device emulation code from mapping and unmapping physical
memory, and from looping when map resources are exhausted.
Signed-off-by: Avi Kivity <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6524 c046a42c-6fe2-441c-8c8c-71466251a162
diff --git a/dma.h b/dma.h
index 16af50f..d596717 100644
--- a/dma.h
+++ b/dma.h
@@ -12,6 +12,7 @@
#include <stdio.h>
#include "cpu.h"
+#include "block.h"
typedef struct {
target_phys_addr_t base;
@@ -30,4 +31,11 @@
target_phys_addr_t len);
void qemu_sglist_destroy(QEMUSGList *qsg);
+BlockDriverAIOCB *dma_bdrv_read(BlockDriverState *bs,
+ QEMUSGList *sg, uint64_t sector,
+ BlockDriverCompletionFunc *cb, void *opaque);
+BlockDriverAIOCB *dma_bdrv_write(BlockDriverState *bs,
+ QEMUSGList *sg, uint64_t sector,
+ BlockDriverCompletionFunc *cb, void *opaque);
+
#endif