From 59a703ebaa9cb5aeda986dc8f627b8d23e3297cd Mon Sep 17 00:00:00 2001 From: aliguori Date: Thu, 5 Feb 2009 21:23:58 +0000 Subject: 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 Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6524 c046a42c-6fe2-441c-8c8c-71466251a162 --- dma.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'dma.h') diff --git a/dma.h b/dma.h index 16af50f1f..d596717f1 100644 --- a/dma.h +++ b/dma.h @@ -12,6 +12,7 @@ #include #include "cpu.h" +#include "block.h" typedef struct { target_phys_addr_t base; @@ -30,4 +31,11 @@ void qemu_sglist_add(QEMUSGList *qsg, target_phys_addr_t base, 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 -- cgit v1.2.3