Mercurial > hg > Members > kono > Cerium
annotate TaskManager/kernel/schedule/SchedTask.cc @ 518:125a72948e44
....
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 16 Oct 2009 17:57:17 +0900 |
parents | 1d4a8a86f26b |
children | 5c76db2a07fa |
rev | line source |
---|---|
308 | 1 #include <stdlib.h> |
2 #include <string.h> | |
42 | 3 #include "SchedTask.h" |
308 | 4 #include "SchedTaskList.h" |
5 #include "SchedNop2Ready.h" | |
6 #include "DmaManager.h" | |
7 #include "error.h" | |
8 #include "TaskManager.h" | |
466
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
9 #include <stdarg.h> |
180
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
10 |
308 | 11 extern Scheduler::TaskObject task_list[MAX_TASK_OBJECT]; |
12 | |
373 | 13 //#define NO_PIPELINE |
308 | 14 |
421
cd77224d4224
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
15 /** |
cd77224d4224
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
16 Task Object を作る |
cd77224d4224
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
17 */ |
cd77224d4224
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
18 |
439 | 19 |
308 | 20 SchedTask * |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
21 createSchedTask(Scheduler *scheduler, TaskPtr task) |
302 | 22 { |
464
01b321c86747
task run is mere C function now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
463
diff
changeset
|
23 return new SchedTask(); |
308 | 24 } |
25 | |
373 | 26 |
421
cd77224d4224
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
27 /** |
cd77224d4224
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
28 code load を始める。既に get_segment hash に入っていれば何もしない。 |
cd77224d4224
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
29 最初の一回は SchedTaskList:: next から呼ばれる。 |
cd77224d4224
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
30 この段階では、SchedTask object は、まだ作られてない。 |
cd77224d4224
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
31 */ |
cd77224d4224
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
32 void |
cd77224d4224
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
33 loadSchedTask(Scheduler *scheduler,TaskPtr task) |
cd77224d4224
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
34 { |
439 | 35 // fprintf(stderr,"loadSchedTask %d\n",task->command); |
421
cd77224d4224
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
36 task_list[task->command].load(scheduler,task->command); |
cd77224d4224
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
37 } |
cd77224d4224
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
38 |
cd77224d4224
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
39 |
308 | 40 SchedTask::SchedTask() |
41 { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
42 list = NULL; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
43 task = NULL; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
44 inListData = NULL; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
45 outListData = NULL; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
46 readbuf = NULL; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
47 writebuf = NULL; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
48 scheduler = NULL; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
49 taskGroup = NULL; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
50 renew_flag = 0; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
51 cur_index = 0; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
52 flag_renewTask = SCHED_TASK_NORMAL; |
466
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
53 this->stdout_ = stdout; |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
54 this->stderr_ = stderr; |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
55 this->stdin_ = stdin; |
373 | 56 |
308 | 57 ex_init = &SchedTask::ex_init_normal; |
58 ex_read = &SchedTask::ex_read_normal; | |
59 ex_exec = &SchedTask::ex_exec_normal; | |
60 ex_write = &SchedTask::ex_write_normal; | |
61 ex_next = &SchedTask::ex_next_normal; | |
62 | |
63 } | |
64 | |
65 /** | |
66 * dma_store の wait を行う | |
67 */ | |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
68 SchedTask::~SchedTask() |
308 | 69 { |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
70 if (flag_renewTask == SCHED_TASK_RENEW) { |
373 | 71 /** |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
72 * list != NULL の場合、 |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
73 * この Task が list の最後の Task になるので (SchedTask::next 参照) |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
74 * このタイミングで list を解放する |
373 | 75 * (free に渡されるアドレスが正しいものとなる)。 |
76 * それ以外の Task では当然解放しない。 | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
77 * list == NULL なので、free に渡しても無問題 |
373 | 78 */ |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
79 free(list); |
308 | 80 } |
81 | |
321 | 82 |
308 | 83 } |
84 | |
373 | 85 /** |
308 | 86 * このタスクを Renew Task とし、それに応じた関数をセットする |
87 */ | |
88 void | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
89 SchedTask::setRenew() |
308 | 90 { |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
91 flag_renewTask = SCHED_TASK_RENEW; |
308 | 92 |
93 ex_init = &SchedTask::ex_init_renew; | |
94 ex_read = &SchedTask::ex_read_renew; | |
95 ex_exec = &SchedTask::ex_exec_renew; | |
373 | 96 ex_write = &SchedTask::ex_write_renew; |
308 | 97 ex_next = &SchedTask::ex_next_renew; |
98 } | |
99 | |
100 void | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
101 SchedTask::init(TaskListPtr _list, TaskPtr _task, int index, |
501
4a2c9ff53605
Cell inData/outData DMA removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
499
diff
changeset
|
102 // ListDataPtr rbuf, ListDataPtr wbuf, |
4a2c9ff53605
Cell inData/outData DMA removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
499
diff
changeset
|
103 Scheduler* sc) |
308 | 104 { |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
105 list = _list; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
106 task = _task; |
501
4a2c9ff53605
Cell inData/outData DMA removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
499
diff
changeset
|
107 inListData = &_task->inData; |
4a2c9ff53605
Cell inData/outData DMA removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
499
diff
changeset
|
108 outListData = &_task->outData; |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
109 scheduler = sc; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
110 cur_index = index; |
308 | 111 |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
112 scheduler->mainMem_wait(); |
308 | 113 |
114 (this->*ex_init)(); | |
115 } | |
116 | |
117 /** | |
118 * PPE 内で生成されたタスクの ex_init() | |
119 */ | |
120 void | |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
121 SchedTask::ex_init_normal() |
308 | 122 { |
501
4a2c9ff53605
Cell inData/outData DMA removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
499
diff
changeset
|
123 #if 0 |
4a2c9ff53605
Cell inData/outData DMA removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
499
diff
changeset
|
124 // task list に入れたので既に読んでいる? |
4a2c9ff53605
Cell inData/outData DMA removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
499
diff
changeset
|
125 // |
498
cb5ecfc5aaa3
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
497
diff
changeset
|
126 scheduler->dma_load(inListData, (uint32)&task->inData, |
373 | 127 sizeof(ListData), DMA_READ_IN_LIST); |
498
cb5ecfc5aaa3
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
497
diff
changeset
|
128 scheduler->dma_load(outListData, (uint32)&task->outData, |
373 | 129 sizeof(ListData), DMA_READ_OUT_LIST); |
308 | 130 #if defined(NO_PIPELINE) |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
131 scheduler->dma_wait(DMA_READ_IN_LIST); |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
132 scheduler->dma_wait(DMA_READ_OUT_LIST); |
308 | 133 #endif |
501
4a2c9ff53605
Cell inData/outData DMA removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
499
diff
changeset
|
134 #endif |
373 | 135 |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
136 taskGroup = new TaskGroup; |
497 | 137 taskGroup->command = (int)task->self; |
308 | 138 } |
139 | |
140 /** | |
141 * SPE 内で生成されたタスクの ex_init() | |
142 * 各データは SPE 内の create_task 時に生成もしくは引き継がれているので | |
143 * ex_init_normal() と違い、ここでは値を渡すだけ | |
144 */ | |
145 void | |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
146 SchedTask::ex_init_renew() |
308 | 147 { |
498
cb5ecfc5aaa3
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
497
diff
changeset
|
148 inListData = &task->inData; |
cb5ecfc5aaa3
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
497
diff
changeset
|
149 outListData = &task->outData; |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
150 taskGroup = (TaskGroupPtr)task->self; |
308 | 151 } |
152 | |
502
36b323130b1b
Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
501
diff
changeset
|
153 void |
36b323130b1b
Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
501
diff
changeset
|
154 SchedTask::read() |
36b323130b1b
Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
501
diff
changeset
|
155 { |
506 | 156 __debug("[SchedTask:%s]\n", __FUNCTION__); |
157 | |
158 #if 0 | |
159 #if !defined(NO_PIPELINE) | |
160 scheduler->dma_wait(DMA_READ_IN_LIST); | |
161 scheduler->dma_wait(DMA_READ_OUT_LIST); | |
162 #endif | |
163 #endif | |
164 // object creation をSchedTask生成時にやらないので、 | |
165 // exec の直前のread で十分に間に合う | |
166 if (cur_index < list->length) { | |
167 // load next task | |
168 loadSchedTask(scheduler, &list->tasks[cur_index]); | |
169 } | |
170 | |
171 writebuf = scheduler->allocate(outListData->size); | |
172 | |
173 // 読むデータが一つもなければ無視 | |
174 if (inListData->length == 0) return; | |
175 | |
176 // load Input Data | |
177 readbuf = scheduler->allocate(inListData->size); | |
178 scheduler->dma_loadList(inListData, readbuf, DMA_READ); | |
179 | |
180 #if defined(NO_PIPELINE) | |
181 scheduler->dma_wait(DMA_READ); | |
182 #endif | |
183 | |
502
36b323130b1b
Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
501
diff
changeset
|
184 (this->*ex_read)(); |
36b323130b1b
Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
501
diff
changeset
|
185 } |
36b323130b1b
Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
501
diff
changeset
|
186 |
308 | 187 /** |
502
36b323130b1b
Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
501
diff
changeset
|
188 * PPE 内で生成されたタスクの ex_read() |
36b323130b1b
Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
501
diff
changeset
|
189 * |
308 | 190 * [Todo] |
191 * データの読み込み場所を readbuf ではなく、 | |
192 * ユーザ自身で決めれるようになるといいかもしれない。 | |
193 * | |
194 * # TaskManager が勝手に消すことなく、 | |
195 * # ユーザが SPE 上に持ち続けることができるため。 | |
196 * # もちろん管理はユーザに任せるわけだ。 | |
197 */ | |
198 void | |
502
36b323130b1b
Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
501
diff
changeset
|
199 SchedTask::ex_read_normal() |
373 | 200 { |
308 | 201 } |
202 | |
203 void | |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
204 SchedTask::exec() |
308 | 205 { |
206 __debug("[SchedTask:%s]\n", __FUNCTION__); | |
207 | |
208 #if !defined(NO_PIPELINE) | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
209 scheduler->dma_wait(DMA_READ); |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
210 task_list[task->command].wait(scheduler,task->command); |
308 | 211 #endif |
212 | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
213 task_list[task->command].run(this, readbuf, writebuf); |
308 | 214 |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
215 free(readbuf); |
308 | 216 |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
217 if (taskGroup->status() != 0) { |
498
cb5ecfc5aaa3
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
497
diff
changeset
|
218 task->self = (int)taskGroup->command; |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
219 delete taskGroup; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
220 taskGroup = NULL; |
308 | 221 } |
222 | |
223 | |
224 // 書き込む領域がなければ無視 | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
225 if (outListData->length > 0) { |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
226 scheduler->dma_storeList(outListData, writebuf, DMA_WRITE); |
308 | 227 |
228 #if defined(NO_PIPELINE) | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
229 scheduler->dma_wait(DMA_WRITE); |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
230 free(writebuf); |
308 | 231 #endif |
232 } | |
233 | |
234 (this->*ex_exec)(); | |
235 } | |
236 | |
237 void | |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
238 SchedTask::write() |
308 | 239 { |
240 __debug("[SchedTask:%s]\n", __FUNCTION__); | |
373 | 241 |
308 | 242 #if !defined(NO_PIPELINE) |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
243 scheduler->dma_wait(DMA_WRITE); |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
244 free(writebuf); |
308 | 245 #endif |
246 | |
497 | 247 if ((int)task->self == MY_SPE_NOP) return; |
308 | 248 |
249 (this->*ex_write)(); | |
250 } | |
251 | |
252 | |
253 /** | |
254 * SPE 内で生成されたタスクの ex_read() | |
255 */ | |
256 void | |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
257 SchedTask::ex_read_renew() |
308 | 258 { |
502
36b323130b1b
Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
501
diff
changeset
|
259 writebuf = scheduler->allocate(outListData->size); |
308 | 260 } |
261 | |
262 /** | |
263 * PPE 内で生成されたタスクの ex_exec() | |
264 */ | |
265 void | |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
266 SchedTask::ex_exec_normal() |
308 | 267 { |
268 } | |
269 | |
270 /** | |
271 * SPE 内で生成されたタスクの ex_exec() | |
272 */ | |
273 void | |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
274 SchedTask::ex_exec_renew() |
308 | 275 { |
276 } | |
277 | |
278 | |
279 | |
280 /** | |
281 * PPE 内で生成されたタスクの ex_write() | |
373 | 282 * |
308 | 283 * このタスク内で新たにタスクが生成され、 |
284 * 且つそのタスクの終了を待つ必要がある場合、 | |
285 * PPE に終了したことは知らせない(command は送信しない) | |
286 */ | |
287 void | |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
288 SchedTask::ex_write_normal() |
308 | 289 { |
290 /** | |
291 * このタスク内で新たにタスクが生成されなかった | |
292 * or 生成されたが、そのタスクの終了を待つ必要は無い | |
293 */ | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
294 if (renew_flag == 0) { |
497 | 295 scheduler->mail_write((int)task->self); |
308 | 296 } |
302 | 297 } |
298 | |
308 | 299 /** |
300 * SPE 内で生成されたタスクの ex_write() | |
301 * | |
302 * A <- 親タスク | |
303 * | \ | |
304 * B C <- SPE 内で生成されたタスク | |
305 * | |
306 * A は SPE 内で B, C を生成したとする。 | |
307 * B と C が終了したら、A が PPE に送るはずだったコマンドが | |
308 * 子タスクに引き継がれているので、最後に実行された子タスクが | |
309 * PPE に mail 送信する。 | |
310 */ | |
311 void | |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
312 SchedTask::ex_write_renew() |
308 | 313 { |
314 uint32 cmd; | |
373 | 315 |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
316 taskGroup->remove(task); |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
317 cmd = taskGroup->status(); |
308 | 318 |
319 // タスク内で作られた全てのタスクが終了した | |
320 if (cmd != 0) { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
321 delete taskGroup; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
322 scheduler->mail_write(cmd); |
308 | 323 } |
324 } | |
373 | 325 |
308 | 326 SchedTaskBase* |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
327 SchedTask::next(Scheduler *scheduler, SchedTaskBase *p) |
308 | 328 { |
329 __debug("[SchedTask:%s]\n", __FUNCTION__); | |
330 | |
468
bd5b93d39597
test_nogl on Mac OS X worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
467
diff
changeset
|
331 // delete p; move to Scheduler |
308 | 332 |
333 return (this->*ex_next)(); | |
334 } | |
335 | |
336 SchedTaskBase* | |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
337 SchedTask::ex_next_normal() |
308 | 338 { |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
339 if (cur_index < list->length) { |
373 | 340 SchedTaskBase *nextSched; |
341 | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
342 nextSched = scheduler->get_nextRenewTaskList(); |
308 | 343 |
373 | 344 // RenewTask がある |
345 if (nextSched) { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
346 scheduler->set_backupTaskList(list); |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
347 scheduler->set_backupTaskListIndex(cur_index); |
373 | 348 return nextSched; |
349 } else { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
350 TaskPtr nextTask = &list->tasks[cur_index++]; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
351 nextSched = createSchedTask(scheduler, nextTask); |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
352 ((SchedTask*)nextSched)->init(list, nextTask, cur_index, |
501
4a2c9ff53605
Cell inData/outData DMA removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
499
diff
changeset
|
353 // scheduler->get_curReadBuf(), |
4a2c9ff53605
Cell inData/outData DMA removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
499
diff
changeset
|
354 // scheduler->get_curWriteBuf(), |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
355 scheduler); |
373 | 356 return nextSched; |
357 } | |
308 | 358 } else { |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
359 uint32 nextList = (uint32)list->next; |
373 | 360 |
361 if (nextList == 0) { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
362 return new SchedNop2Ready(scheduler); |
373 | 363 } else { |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
364 return createSchedTaskList(nextList, scheduler, |
373 | 365 SCHED_TASKLIST_NORMAL); |
366 } | |
308 | 367 } |
368 } | |
369 | |
370 /** | |
371 * | |
372 */ | |
373 SchedTaskBase* | |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
374 SchedTask::ex_next_renew() |
308 | 375 { |
376 TaskPtr nextTask; | |
377 SchedTask *nextSched; | |
378 | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
379 if (cur_index < list->length) { |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
380 nextTask = &list->tasks[cur_index++]; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
381 nextSched = createSchedTask(scheduler, nextTask); |
308 | 382 |
373 | 383 // RenewTaskList を実行中なので |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
384 nextSched->setRenew(); |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
385 nextSched->init(list, nextTask, cur_index, |
501
4a2c9ff53605
Cell inData/outData DMA removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
499
diff
changeset
|
386 // scheduler->get_curReadBuf(), |
4a2c9ff53605
Cell inData/outData DMA removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
499
diff
changeset
|
387 // scheduler->get_curWriteBuf(), |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
388 scheduler); |
308 | 389 |
373 | 390 /** |
391 * この理由は SchedTask:~SchedTask() で | |
392 */ | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
393 list = NULL; |
373 | 394 return nextSched; |
308 | 395 } else { |
373 | 396 SchedTaskBase *nextList; |
397 | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
398 nextList = scheduler->get_nextRenewTaskList(); |
373 | 399 |
400 if (nextList) { | |
401 return nextList; | |
402 } else { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
403 TaskListPtr nextList = scheduler->get_backupTaskList(); |
373 | 404 |
405 // 中断した TaskList がある | |
406 if (nextList) { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
407 cur_index = scheduler->get_backupTaskListIndex(); |
308 | 408 |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
409 nextTask = &nextList->tasks[cur_index++]; |
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
410 nextSched = createSchedTask(scheduler, nextTask); |
373 | 411 |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
412 nextSched->init(nextList, nextTask, cur_index, |
501
4a2c9ff53605
Cell inData/outData DMA removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
499
diff
changeset
|
413 // scheduler->get_curReadBuf(), |
4a2c9ff53605
Cell inData/outData DMA removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
499
diff
changeset
|
414 // scheduler->get_curWriteBuf(), |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
415 scheduler); |
373 | 416 return nextSched; |
417 } else { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
418 return new SchedNop2Ready(scheduler); |
373 | 419 } |
420 } | |
308 | 421 } |
422 } | |
423 | |
424 int | |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
425 SchedTask::get_cpuid() |
308 | 426 { |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
427 return scheduler->id; |
308 | 428 } |
429 | |
430 /** | |
431 * task->add_inData で与えられた順番に対応する index (0〜n-1) で、 | |
432 * buffer から対応するデータを返す。 | |
433 */ | |
434 void* | |
435 SchedTask::get_input(void *buff, int index) | |
436 { | |
437 if (buff != NULL) { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
438 return (void*)((int)buff + inListData->bound[index]); |
308 | 439 } else { |
373 | 440 return NULL; |
308 | 441 } |
442 } | |
443 | |
444 /** | |
445 * get_input(index) のアドレスを返す | |
446 */ | |
447 uint32 | |
448 SchedTask::get_inputAddr(int index) | |
449 { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
450 return inListData->element[index].addr; |
308 | 451 } |
452 | |
453 /** | |
454 * get_input(index) のサイズを返す | |
455 */ | |
456 int | |
457 SchedTask::get_inputSize(int index) | |
458 { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
459 return inListData->element[index].size; |
308 | 460 } |
461 | |
462 /** | |
463 * write buffer の領域を返す。 | |
464 */ | |
465 void* | |
466 SchedTask::get_output(void *buff, int index) | |
467 { | |
468 if (buff != NULL) { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
469 return (void*)((int)buff + outListData->bound[index]); |
308 | 470 } else { |
373 | 471 return NULL; |
308 | 472 } |
473 } | |
474 | |
475 /** | |
476 * get_output(index) のアドレスを返す | |
477 */ | |
478 uint32 | |
479 SchedTask::get_outputAddr(int index) | |
480 { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
481 return outListData->element[index].addr; |
308 | 482 } |
483 | |
484 /** | |
485 * get_output(index) のサイズを返す | |
486 */ | |
487 int | |
488 SchedTask::get_outputSize(int index) | |
489 { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
490 return outListData->element[index].size; |
308 | 491 } |
492 | |
493 int | |
494 SchedTask::get_param(int index) | |
495 { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
496 return task->param[index]; |
308 | 497 } |
498 | |
518 | 499 HTaskPtr |
308 | 500 SchedTask::create_task(int cmd) |
501 { | |
518 | 502 HTaskPtr htask = scheduler->create_task(cmd); |
503 #if 0 | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
504 TaskListPtr taskList = scheduler->get_renewListBuf(); |
308 | 505 TaskPtr p = &taskList->tasks[taskList->length++]; |
506 p->command = cmd; | |
507 | |
498
cb5ecfc5aaa3
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
497
diff
changeset
|
508 // already allocated |
cb5ecfc5aaa3
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
497
diff
changeset
|
509 // p->inData = (ListData*)scheduler->allocate(sizeof(ListData)); |
cb5ecfc5aaa3
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
497
diff
changeset
|
510 // p->outData = (ListData*)scheduler->allocate(sizeof(ListData)); |
308 | 511 |
498
cb5ecfc5aaa3
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
497
diff
changeset
|
512 p->inData.clear(); |
cb5ecfc5aaa3
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
497
diff
changeset
|
513 p->outData.clear(); |
308 | 514 |
498
cb5ecfc5aaa3
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
497
diff
changeset
|
515 p->self = (int)MY_SPE_NOP; |
308 | 516 p->param_size = 0; |
518 | 517 #endif |
308 | 518 |
519 return p; | |
520 } | |
521 | |
522 /** | |
523 * | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
524 * @param[in] waitTask タスク内で生成したタスクの登録(spawn()に相当) |
308 | 525 */ |
526 void | |
527 SchedTask::wait_task(TaskPtr waitTask) | |
528 { | |
498
cb5ecfc5aaa3
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
497
diff
changeset
|
529 waitTask->self = (int)taskGroup; |
308 | 530 |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
531 scheduler->add_groupTask(taskGroup, waitTask); |
308 | 532 |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
533 renew_flag++; |
308 | 534 } |
535 | |
536 void* | |
537 SchedTask::global_alloc(int id, int size) { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
538 return scheduler->global_alloc(id, size); |
308 | 539 } |
540 | |
541 void* | |
542 SchedTask::global_get(int id) { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
543 return scheduler->global_get(id); |
308 | 544 } |
545 | |
546 void | |
373 | 547 SchedTask::global_set(int id, void *addr) { |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
548 scheduler->global_set(id, addr); |
373 | 549 } |
550 | |
551 void | |
308 | 552 SchedTask::global_free(int id) { |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
553 scheduler->global_free(id); |
308 | 554 } |
555 | |
373 | 556 MemList* |
557 SchedTask::createMemList(int size, int count) { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
558 return scheduler->createMemList(size, count); |
373 | 559 } |
560 | |
308 | 561 void |
562 SchedTask::mainMem_alloc(int id, int size) { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
563 scheduler->mainMem_alloc(id, size); |
308 | 564 } |
565 | |
566 void | |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
567 SchedTask::mainMem_wait() { |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
568 scheduler->mainMem_wait(); |
308 | 569 } |
570 | |
571 void* | |
572 SchedTask::mainMem_get(int id) { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
573 return scheduler->mainMem_get(id); |
308 | 574 } |
575 | |
576 void* | |
577 SchedTask::allocate(int size) { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
578 return scheduler->allocate(size); |
308 | 579 } |
580 | |
467
44c0bce54dcf
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
466
diff
changeset
|
581 |
308 | 582 void |
583 SchedTask::dma_load(void *buf, uint32 addr, uint32 size, uint32 mask) { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
584 scheduler->dma_load(buf, addr, size, mask); |
308 | 585 } |
586 | |
587 void | |
588 SchedTask::dma_store(void *buf,uint32 addr, uint32 size, uint32 mask) { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
589 scheduler->dma_store(buf, addr, size, mask); |
308 | 590 } |
591 | |
592 void | |
593 SchedTask::dma_wait(uint32 mask) { | |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
594 scheduler->dma_wait(mask); |
308 | 595 } |
596 | |
334
20f2459041cb
[in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents:
321
diff
changeset
|
597 void |
20f2459041cb
[in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents:
321
diff
changeset
|
598 SchedTask::show_dma_wait() { |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
599 scheduler->show_dma_wait(); |
334
20f2459041cb
[in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents:
321
diff
changeset
|
600 } |
20f2459041cb
[in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents:
321
diff
changeset
|
601 |
387
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
602 MemorySegment * SchedTask::get_segment(memaddr addr, MemList *m) { |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
603 return scheduler->get_segment(addr,m); |
387
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
604 } |
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
605 |
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
606 void SchedTask::put_segment(MemorySegment *s) { |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
607 scheduler->put_segment(s); |
387
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
608 } |
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
609 |
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
610 void SchedTask::wait_segment(MemorySegment *s) { |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
611 scheduler->wait_segment(s); |
387
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
612 } |
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
613 |
466
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
614 /* system call */ |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
615 |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
616 int |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
617 SchedTask::fprintf(FILE * stream, const char * format, ...) |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
618 { |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
619 va_list ap; |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
620 va_start(ap,format); |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
621 int ret = vfprintf(stream,format, ap); |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
622 va_end(ap); |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
623 return ret; |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
624 } |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
625 |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
626 int |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
627 SchedTask::printf(const char * format, ...) |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
628 { |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
629 va_list ap; |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
630 va_start(ap,format); |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
631 int ret= vfprintf(stdout,format, ap); |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
632 va_end(ap); |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
633 return ret; |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
634 } |
4fa8760e18c2
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
635 |
387
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
636 |
5e2d30bfbf23
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
637 |
308 | 638 /* end */ |