root / dma.h @ 4870852c
History | View | Annotate | Download (1.1 kB)
1 | 244ab90e | aliguori | /*
|
---|---|---|---|
2 | 244ab90e | aliguori | * DMA helper functions
|
3 | 244ab90e | aliguori | *
|
4 | 244ab90e | aliguori | * Copyright (c) 2009 Red Hat
|
5 | 244ab90e | aliguori | *
|
6 | 244ab90e | aliguori | * This work is licensed under the terms of the GNU General Public License
|
7 | 244ab90e | aliguori | * (GNU GPL), version 2 or later.
|
8 | 244ab90e | aliguori | */
|
9 | 244ab90e | aliguori | |
10 | 244ab90e | aliguori | #ifndef DMA_H
|
11 | 244ab90e | aliguori | #define DMA_H
|
12 | 244ab90e | aliguori | |
13 | 244ab90e | aliguori | #include <stdio.h> |
14 | 244ab90e | aliguori | #include "cpu.h" |
15 | 59a703eb | aliguori | #include "block.h" |
16 | 244ab90e | aliguori | |
17 | 244ab90e | aliguori | typedef struct { |
18 | 244ab90e | aliguori | target_phys_addr_t base; |
19 | 244ab90e | aliguori | target_phys_addr_t len; |
20 | 244ab90e | aliguori | } ScatterGatherEntry; |
21 | 244ab90e | aliguori | |
22 | 244ab90e | aliguori | typedef struct { |
23 | 244ab90e | aliguori | ScatterGatherEntry *sg; |
24 | 244ab90e | aliguori | int nsg;
|
25 | 244ab90e | aliguori | int nalloc;
|
26 | 244ab90e | aliguori | target_phys_addr_t size; |
27 | 244ab90e | aliguori | } QEMUSGList; |
28 | 244ab90e | aliguori | |
29 | 244ab90e | aliguori | void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint); |
30 | 244ab90e | aliguori | void qemu_sglist_add(QEMUSGList *qsg, target_phys_addr_t base,
|
31 | 244ab90e | aliguori | target_phys_addr_t len); |
32 | 244ab90e | aliguori | void qemu_sglist_destroy(QEMUSGList *qsg);
|
33 | 244ab90e | aliguori | |
34 | 59a703eb | aliguori | BlockDriverAIOCB *dma_bdrv_read(BlockDriverState *bs, |
35 | 59a703eb | aliguori | QEMUSGList *sg, uint64_t sector, |
36 | 59a703eb | aliguori | BlockDriverCompletionFunc *cb, void *opaque);
|
37 | 59a703eb | aliguori | BlockDriverAIOCB *dma_bdrv_write(BlockDriverState *bs, |
38 | 59a703eb | aliguori | QEMUSGList *sg, uint64_t sector, |
39 | 59a703eb | aliguori | BlockDriverCompletionFunc *cb, void *opaque);
|
40 | 6512a2a7 | aliguori | void dma_helper_init(void); |
41 | 59a703eb | aliguori | |
42 | 244ab90e | aliguori | #endif |