libdma.h

Go to the documentation of this file.
00001 /*
00002 ** libdma.h for lseos in lseos-srv/hw/dma
00003 ** 
00004 ** Copyright(c)2004 Vianney Rancurel
00005 ** Login   <vianney@epita.fr>
00006 ** 
00007 ** Started on  Wed Mar  3 12:27:20 2004 Vianney Rancurel
00008 ** Last update Mon Dec  6 12:23:25 2004 Vianney Rancurel
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)         /* copy buffer          */
00016 #define DMAOPT_READ     (1<<1u)         /* dma read             */
00017 #define DMAOPT_WRITE    (1<<2u)         /* dma write            */
00018 
00019 #define SYSDMA_UNREGISTER       2
00020 #define SYSDMA_RESET            3
00021 
00022 #define SYSDMA_DUMP             5
00023 
00024 /*
00025  * suberrno codes (advice)
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 /* PROTO libdma.c */
00038 /* libdma.c */
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

Generated on Wed May 24 23:04:18 2006 for LSE/OS by  doxygen 1.4.6