annotate TaskManager/Cell/spe/SchedTaskList.cc @ 180:5cde66c926b4

いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
author gongo@localhost.localdomain
date Mon, 22 Dec 2008 16:09:57 +0900
parents 5c194c71eca8
children 907bda4a1a14
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
1 #include <stdio.h>
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
2 #include <stdlib.h>
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
3 #include <string.h>
81
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
4 #include "SchedTaskList.h"
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
5 #include "SchedTask.h"
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
6 #include "SchedNop2Ready.h"
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
7 #include "DmaManager.h"
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
8 #include "error.h"
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
9
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
10 SchedTaskList::SchedTaskList(unsigned int addr, Scheduler *sched)
81
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
11 {
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
12 params_addr = addr;
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
13 list = sched->get_curListBuf();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
14 scheduler = sched;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
15
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
16 flag_renewTaskList = 0;
81
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
17 }
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
18
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
19
81
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
20 void
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
21 SchedTaskList::read(void)
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
22 {
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
23 __debug("[SchedTaskList:%s]\n", __FUNCTION__);
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
24
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
25 if (flag_renewTaskList == 0) {
180
5cde66c926b4 いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents: 109
diff changeset
26 scheduler->dma_load(list, params_addr,
5cde66c926b4 いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents: 109
diff changeset
27 sizeof(TaskList), DMA_READ_TASKLIST);
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
28 scheduler->dma_wait(DMA_READ_TASKLIST);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
29 } else {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
30 list = (TaskListPtr)params_addr;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
31 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
32
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
33 scheduler->curIndex_taskList = 0;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
34
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
35 scheduler->mainMem_wait();
81
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
36 }
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
37
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
38 SchedTaskBase*
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
39 SchedTaskList::next(Scheduler *m, SchedTaskBase *p)
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
40 {
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
41 __debug("[SchedTaskList:%s]\n", __FUNCTION__);
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
42
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
43 delete p;
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
44
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
45 if (list->length < 1) {
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
46 return new SchedNop2Ready(scheduler);
81
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
47 } else {
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
48 SchedTask* task = CreateSchedTask(list, m);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
49 task->__flag_renewTask = this->flag_renewTaskList;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
50 task->__init__();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
51 return task;
81
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
52 }
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
53 }
b03a4d3565c0 *** empty log message ***
gongo
parents:
diff changeset
54