????4??DMA????????
/* DMA channel structure */
typedef struct {
dmach_t channel;//?????????0??1??2??3
unsigned int in_use;    /* Device is allocated ?豸?????*/
const char *device_id;    /* Device name ?豸??*/
dma_buf_t *head;    /* where to insert buffers ??DMA??????????????*/
dma_buf_t *tail;    /* where to remove buffers??DMA?????????????β*/
dma_buf_t *curr;    /* buffer currently DMA'ed??DMA??????????????е?????????*/
unsigned long queue_count;    /* number of buffers in the queue ?????л?????????*/
int active;    /* 1 if DMA is actually processing data ????????????????*/
dma_regs_t *regs;    /* points to appropriate DMA registers ?????????DMA????????*/
int irq;    /* IRQ used by the channel //?????????ж??*/
dma_device_t write;    /* to write //??ж???????DMA?豸*/
dma_device_t read;    /* to read ???д??????DMA?豸*/
} s3c2410_dma_t;
????DMA??????????????????:
????д???DMA???????????????????DMA???????DMA?ж????????????????á?????DMA??????С????DMA?ж?????DMA???.
????int s3c2410_request_dma(const char *device_id?? dmach_t channel??
????dma_callback_t write_cb?? dma_callback_t read_cb) (s3c2410_dma_queue_buffer);
????????????????????????DMA????????s3c2410_dma_t ????????????????DMA?ж??
?????????????device_id DMA ?豸????channel ??????
????write_cb DMAд????????????????read_cb DMA????????????????
???????????????channel?????????????????????????0
????int s3c2410_dma_queue_buffer(dmach_t channel?? void *buf_id??
????dma_addr_t data?? int size?? int write) (s3c2410_dma_stop);
??????????????????DMA????????????????????????ж?????????????????DMA?????????????????????????DMA??????У?????DMA????????????????DMA????????
????????????? channel ??????buf_id???????????
????dma_addr_t data DMA????????????????????size DMA???????????С??write ??д?????????
????int s3c2410_dma_stop(dmach_t channel)
????????????????DMA??????
????int s3c2410_dma_flush_all(dmach_t channel)
?????????????????DMA????????????????????
????void s3c2410_free_dma(dmach_t channel)
?????????????????DMA???
?????????????????????????????DMA???????????????????????3?????????ɡ???????????????е???s3c2410_request_dma?????DMA?????????s3c2410_dma_queue_buffer?????????????????s3c2410_free_dma??