mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
Add a scatter-gather list type and accessors (Avi Kivity)
Scatter-gather lists are used extensively in dma-capable devices; a single data structure allows more code reuse later on. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6522 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
f39023833e
commit
244ab90e17
3 changed files with 72 additions and 1 deletions
33
dma.h
Normal file
33
dma.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* DMA helper functions
|
||||
*
|
||||
* Copyright (c) 2009 Red Hat
|
||||
*
|
||||
* This work is licensed under the terms of the GNU General Public License
|
||||
* (GNU GPL), version 2 or later.
|
||||
*/
|
||||
|
||||
#ifndef DMA_H
|
||||
#define DMA_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include "cpu.h"
|
||||
|
||||
typedef struct {
|
||||
target_phys_addr_t base;
|
||||
target_phys_addr_t len;
|
||||
} ScatterGatherEntry;
|
||||
|
||||
typedef struct {
|
||||
ScatterGatherEntry *sg;
|
||||
int nsg;
|
||||
int nalloc;
|
||||
target_phys_addr_t size;
|
||||
} QEMUSGList;
|
||||
|
||||
void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint);
|
||||
void qemu_sglist_add(QEMUSGList *qsg, target_phys_addr_t base,
|
||||
target_phys_addr_t len);
|
||||
void qemu_sglist_destroy(QEMUSGList *qsg);
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue