Add a scatter-gather list type and accessors (Avi Kivity)
[qemu/mini2440/sniper_sniper_test.git] / dma.h
blob16af50f1f7fc77dec862d30879d79f7e403a055d
1 /*
2 * DMA helper functions
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.
8 */
10 #ifndef DMA_H
11 #define DMA_H
13 #include <stdio.h>
14 #include "cpu.h"
16 typedef struct {
17 target_phys_addr_t base;
18 target_phys_addr_t len;
19 } ScatterGatherEntry;
21 typedef struct {
22 ScatterGatherEntry *sg;
23 int nsg;
24 int nalloc;
25 target_phys_addr_t size;
26 } QEMUSGList;
28 void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint);
29 void qemu_sglist_add(QEMUSGList *qsg, target_phys_addr_t base,
30 target_phys_addr_t len);
31 void qemu_sglist_destroy(QEMUSGList *qsg);
33 #endif