42
|
1 #include "SchedTaskList.h"
|
|
2 #include "SchedTask.h"
|
|
3 #include "SchedNop2Ready.h"
|
|
4 #include "DmaManager.h"
|
|
5 #include "error.h"
|
|
6
|
|
7 SchedTaskList::SchedTaskList(unsigned int addr, TaskListPtr listbuf, DmaManager* c)
|
|
8 {
|
|
9 params_addr = addr;
|
|
10 list = listbuf;
|
|
11 connector = c;
|
|
12 }
|
|
13
|
|
14 void
|
|
15 SchedTaskList::read(void)
|
|
16 {
|
|
17 __debug("[SchedTaskList:%s]\n", __FUNCTION__);
|
|
18
|
|
19 connector->dma_load(list, params_addr, sizeof(TaskList), DMA_READ);
|
|
20 connector->dma_wait(DMA_READ);
|
|
21 }
|
|
22
|
|
23 SchedTaskBase*
|
|
24 SchedTaskList::next(Scheduler *m, SchedTaskBase *p)
|
|
25 {
|
|
26 __debug("[SchedTaskList:%s]\n", __FUNCTION__);
|
|
27
|
|
28 delete p;
|
|
29
|
|
30 if (list->length < 1) {
|
|
31 return new SchedNop2Ready(connector);
|
|
32 } else {
|
|
33 // 本当は、ここで task->command に対応する、
|
|
34 // SchedTask を継承する class を作ればいい。。。はず
|
|
35 return new SchedTask(list, &list->tasks[--list->length],
|
|
36 m->get_curReadBuf(),
|
|
37 m->get_curWriteBuf(),
|
|
38 connector);
|
|
39 }
|
|
40 }
|