libmetal
Toggle main menu visibility
Loading...
Searching...
No Matches
lib
dma.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved.
3
*
4
* SPDX-License-Identifier: BSD-3-Clause
5
*/
6
11
12
#ifndef __METAL_DMA__H__
13
#define __METAL_DMA__H__
14
15
#include <stdint.h>
16
#include <metal/sys.h>
17
18
#ifdef __cplusplus
19
extern
"C"
{
20
#endif
21
25
26
#define METAL_DMA_DEV_R 1
27
#define METAL_DMA_DEV_W 2
28
#define METAL_DMA_DEV_WR 3
29
33
struct
metal_sg
{
34
void
*
virt
;
35
struct
metal_io_region
*
io
;
36
int
len
;
37
};
38
39
struct
metal_device
;
40
53
int
metal_dma_map
(
struct
metal_device
*dev,
54
uint32_t dir,
55
struct
metal_sg
*sg_in,
56
int
nents_in,
57
struct
metal_sg
*sg_out);
58
69
void
metal_dma_unmap
(
struct
metal_device
*dev,
70
uint32_t dir,
71
struct
metal_sg
*sg,
72
int
nents);
73
75
76
#ifdef __cplusplus
77
}
78
#endif
79
80
#endif
/* __METAL_DMA__H__ */
metal_dma_unmap
void metal_dma_unmap(struct metal_device *dev, uint32_t dir, struct metal_sg *sg, int nents)
Unmap DMA memory After the memory is DMA unmapped, the memory should be accessed by the CPU but not t...
Definition
dma.c:44
metal_dma_map
int metal_dma_map(struct metal_device *dev, uint32_t dir, struct metal_sg *sg_in, int nents_in, struct metal_sg *sg_out)
Map memory for DMA transaction. After the memory is DMA mapped, the memory should be accessed by the ...
Definition
dma.c:19
metal_device
Definition
device.h:72
metal_io_region
Definition
io.h:73
metal_sg
scatter/gather list element structure
Definition
dma.h:33
metal_sg::io
struct metal_io_region * io
Definition
dma.h:35
metal_sg::len
int len
Definition
dma.h:36
metal_sg::virt
void * virt
Definition
dma.h:34
Generated on
for libmetal by
1.17.0