annotate TaskManager/Cell/spe/SchedTaskList.cc @ 81:b03a4d3565c0

*** empty log message ***
author gongo
date Wed, 20 Feb 2008 17:07:11 +0900
parents
children 504899860e66
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
81
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
1 #include "SchedTaskList.h"
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
2 #include "SchedTask.h"
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
3 #include "SchedNop2Ready.h"
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
4 #include "DmaManager.h"
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
5 #include "error.h"
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
6
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
7 SchedTaskList::SchedTaskList(unsigned int addr, TaskListPtr listbuf, DmaManager* c)
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
8 {
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
9 params_addr = addr;
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
10 list = listbuf;
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
11 connector = c;
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
12 }
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
13
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
14 void
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
15 SchedTaskList::read(void)
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
16 {
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
17 __debug("[SchedTaskList:%s]\n", __FUNCTION__);
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
18
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
19 connector->dma_load(list, params_addr, sizeof(TaskList), DMA_READ);
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
20 connector->dma_wait(DMA_READ);
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
21 }
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
22
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
23 extern SchedTask* CreateSchedTask(TaskListPtr, void*, void*, DmaManager*);
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
24
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
25 SchedTaskBase*
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
26 SchedTaskList::next(Scheduler *m, SchedTaskBase *p)
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
27 {
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
28 __debug("[SchedTaskList:%s]\n", __FUNCTION__);
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
29
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
30 delete p;
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
31
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
32 if (list->length < 1) {
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
33 return new SchedNop2Ready(connector);
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
34 } else {
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
35 // 本当は、ここで task->command に対応する、
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
36 // SchedTask を継承する class を作ればいい。。。はず
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
37 #if 0
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
38 return new SchedTask(list, &list->tasks[--list->length],
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
39 m->get_curReadBuf(),
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
40 m->get_curWriteBuf(),
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
41 connector);
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
42 #else
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
43 return CreateSchedTask(list, m->get_curReadBuf(), m->get_curWriteBuf(),
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
44 connector);
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
45 #endif
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
46 }
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
47 }
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
48