00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __LIBDMA_H__
00011 #define __LIBDMA_H__ 1
00012 #include <libc.h>
00013
00014 #define SYSDMA_REGISTER 1
00015 #define DMAOPT_COPY (1<<0u)
00016 #define DMAOPT_READ (1<<1u)
00017 #define DMAOPT_WRITE (1<<2u)
00018
00019 #define SYSDMA_UNREGISTER 2
00020 #define SYSDMA_RESET 3
00021
00022 #define SYSDMA_DUMP 5
00023
00024
00025
00026
00027 typedef enum
00028 {
00029 DMA_REGISTER_BAD_CHANNEL = 100,
00030 DMA_REGISTER_CHANNEL_NOT_AVAIL,
00031 DMA_REGISTER_BAD_LEN,
00032 DMA_REGISTER_NOT_SHARED_RW,
00033 DMA_REGISTER_BAD_DMA_BLOCK,
00034 DMA_REGISTER_NOT_DMA_MEM,
00035 } t_dma_register_suberrno_codes;
00036
00037
00038
00039 int dma_register(int channel, char *dmabuf, int dmaoff, int dmalen, u_int32_t dmaopt);
00040 int dma_write(int channel, char *buf, int len);
00041 int dma_read(int channel, char *buf, int len);
00042 int dma_unregister(int channel);
00043 int dma_reset(int channel, int dmaoff, int dmalen);
00044 int dma_dump(void);
00045 #endif