📄 dmablib.h
字号:
/*****************************************************************************File dmablibAuthor SasiFunction Library support for direct memory access & allocation for DMA for Linux user mode clients Requires dmab.o driver to be loaded*****************************************************************************/#ifndef DMABLIB_SASI#define DMABLIB_SASI/* treat as opaque */typedef struct{ unsigned long size; /* in - size to allocate */ unsigned long phys; /* out - physical address allocated */ void *virt; /* rsv - kernel virtual address mapped */ void *user; /* out - user virtual address mapped */}DMABUF_T;int dmab_init(char *name, int cache_on);/* in name name of device file or NULL for default ret -1 on failure*/int dmab_exit(int h);/* in h return from previous call to dmab_init ret 0 on failure*/void *dmab_get(int fd, int size, DMABUF_T *t);/* in h return from previous call to dmab_init size bytes to allocate out t opaque structure for use in dmab_free proc allocates & maps DMA buffer ret t->user (0 on failure)*/int dmab_free(int h, DMABUF_T *t);/* in h return from previous call to dmab_init t from previous successful call to dmab_get proc unmaps buffer & frees it ret 0 on success*/int dmab_clean(int h, DMABUF_T *t);/* flush data from cache to physical memory*/int dmab_invalidate(int h, DMABUF_T *t);/* mark cache as invalid tell ARM to do subsequent read from physical memory */#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -