mirror of
https://gitee.com/Vancouver2017/luban-lite.git
synced 2025-12-15 16:48:56 +00:00
v1.0.4
This commit is contained in:
@@ -216,24 +216,28 @@ int aic_set_burst(struct dma_slave_config *sconfig,
|
|||||||
struct aic_dma_task *aic_dma_task_alloc(void)
|
struct aic_dma_task *aic_dma_task_alloc(void)
|
||||||
{
|
{
|
||||||
struct aic_dma_task *task;
|
struct aic_dma_task *task;
|
||||||
|
unsigned long state;
|
||||||
/* Remove the QH structure from the freelist */
|
/* Remove the QH structure from the freelist */
|
||||||
|
|
||||||
|
aicos_local_irq_save(&state);
|
||||||
task = aich_dma.freetask;
|
task = aich_dma.freetask;
|
||||||
|
|
||||||
if (task) {
|
if (task) {
|
||||||
aich_dma.freetask = task->v_next;
|
aich_dma.freetask = task->v_next;
|
||||||
memset(task, 0, sizeof(struct aic_dma_task));
|
memset(task, 0, sizeof(struct aic_dma_task));
|
||||||
}
|
}
|
||||||
|
aicos_local_irq_restore(state);
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void aic_dma_task_free(struct aic_dma_task *task)
|
static void aic_dma_task_free(struct aic_dma_task *task)
|
||||||
{
|
{
|
||||||
|
unsigned long state;
|
||||||
CHECK_PARAM_RET(task != NULL);
|
CHECK_PARAM_RET(task != NULL);
|
||||||
|
aicos_local_irq_save(&state);
|
||||||
task->v_next = aich_dma.freetask;
|
task->v_next = aich_dma.freetask;
|
||||||
aich_dma.freetask = task;
|
aich_dma.freetask = task;
|
||||||
|
aicos_local_irq_restore(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *aic_dma_task_add(struct aic_dma_task *prev,
|
void *aic_dma_task_add(struct aic_dma_task *prev,
|
||||||
@@ -401,7 +405,9 @@ struct aic_dma_chan *hal_request_dma_chan(void)
|
|||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
struct aic_dma_chan *chan;
|
struct aic_dma_chan *chan;
|
||||||
|
unsigned long state;
|
||||||
|
|
||||||
|
aicos_local_irq_save(&state);
|
||||||
for (i = 0; i < AIC_DMA_CH_NUM; i++)
|
for (i = 0; i < AIC_DMA_CH_NUM; i++)
|
||||||
{
|
{
|
||||||
chan = &aich_dma.dma_chan[i];
|
chan = &aich_dma.dma_chan[i];
|
||||||
@@ -414,10 +420,11 @@ struct aic_dma_chan *hal_request_dma_chan(void)
|
|||||||
chan->callback = NULL;
|
chan->callback = NULL;
|
||||||
chan->callback_param = NULL;
|
chan->callback_param = NULL;
|
||||||
chan->desc = NULL;
|
chan->desc = NULL;
|
||||||
|
aicos_local_irq_restore(state);
|
||||||
return chan;
|
return chan;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
aicos_local_irq_restore(state);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user