Mercurial > hg > Members > kono > Cerium
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 |
rev | line source |
---|---|
109 | 1 #include <stdio.h> |
2 #include <stdlib.h> | |
3 #include <string.h> | |
81 | 4 #include "SchedTaskList.h" |
5 #include "SchedTask.h" | |
6 #include "SchedNop2Ready.h" | |
7 #include "DmaManager.h" | |
8 #include "error.h" | |
9 | |
109 | 10 SchedTaskList::SchedTaskList(unsigned int addr, Scheduler *sched) |
81 | 11 { |
12 params_addr = addr; | |
109 | 13 list = sched->get_curListBuf(); |
14 scheduler = sched; | |
15 | |
16 flag_renewTaskList = 0; | |
81 | 17 } |
18 | |
109 | 19 |
81 | 20 void |
21 SchedTaskList::read(void) | |
22 { | |
23 __debug("[SchedTaskList:%s]\n", __FUNCTION__); | |
24 | |
109 | 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 | 28 scheduler->dma_wait(DMA_READ_TASKLIST); |
29 } else { | |
30 list = (TaskListPtr)params_addr; | |
31 } | |
32 | |
33 scheduler->curIndex_taskList = 0; | |
34 | |
35 scheduler->mainMem_wait(); | |
81 | 36 } |
37 | |
38 SchedTaskBase* | |
39 SchedTaskList::next(Scheduler *m, SchedTaskBase *p) | |
40 { | |
41 __debug("[SchedTaskList:%s]\n", __FUNCTION__); | |
42 | |
43 delete p; | |
44 | |
45 if (list->length < 1) { | |
109 | 46 return new SchedNop2Ready(scheduler); |
81 | 47 } else { |
109 | 48 SchedTask* task = CreateSchedTask(list, m); |
49 task->__flag_renewTask = this->flag_renewTaskList; | |
50 task->__init__(); | |
51 return task; | |
81 | 52 } |
53 } | |
54 |