]> git.proxmox.com Git - qemu.git/blame - dma.h
monitor: fix build breakage for !CONFIG_VNC
[qemu.git] / dma.h
CommitLineData
244ab90e
AL
1/*
2 * DMA helper functions
3 *
4 * Copyright (c) 2009 Red Hat
5 *
6 * This work is licensed under the terms of the GNU General Public License
7 * (GNU GPL), version 2 or later.
8 */
9
10#ifndef DMA_H
11#define DMA_H
12
13#include <stdio.h>
1ad2134f
PB
14//#include "cpu.h"
15#include "hw/hw.h"
59a703eb 16#include "block.h"
244ab90e
AL
17
18typedef struct {
c227f099
AL
19 target_phys_addr_t base;
20 target_phys_addr_t len;
244ab90e
AL
21} ScatterGatherEntry;
22
23typedef struct {
24 ScatterGatherEntry *sg;
25 int nsg;
26 int nalloc;
c227f099 27 target_phys_addr_t size;
244ab90e
AL
28} QEMUSGList;
29
30void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint);
c227f099
AL
31void qemu_sglist_add(QEMUSGList *qsg, target_phys_addr_t base,
32 target_phys_addr_t len);
244ab90e
AL
33void qemu_sglist_destroy(QEMUSGList *qsg);
34
cb144ccb
CH
35typedef BlockDriverAIOCB *DMAIOFunc(BlockDriverState *bs, int64_t sector_num,
36 QEMUIOVector *iov, int nb_sectors,
37 BlockDriverCompletionFunc *cb, void *opaque);
38
39BlockDriverAIOCB *dma_bdrv_io(BlockDriverState *bs,
40 QEMUSGList *sg, uint64_t sector_num,
41 DMAIOFunc *io_func, BlockDriverCompletionFunc *cb,
42 void *opaque, int is_write);
59a703eb
AL
43BlockDriverAIOCB *dma_bdrv_read(BlockDriverState *bs,
44 QEMUSGList *sg, uint64_t sector,
45 BlockDriverCompletionFunc *cb, void *opaque);
46BlockDriverAIOCB *dma_bdrv_write(BlockDriverState *bs,
47 QEMUSGList *sg, uint64_t sector,
48 BlockDriverCompletionFunc *cb, void *opaque);
244ab90e 49#endif