Mercurial > hg > Members > kono > Cerium
comparison TaskManager/kernel/schedule/SchedTask.cc @ 698:dcaa40ec963d
no compile error for Task Array
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 13 Dec 2009 20:14:18 +0900 |
parents | cbcf0182635e |
children | 7e937a1cd121 |
comparison
equal
deleted
inserted
replaced
697:257ad1a518e3 | 698:dcaa40ec963d |
---|---|
13 #ifdef SIMPLE_TASK | 13 #ifdef SIMPLE_TASK |
14 #define Task SimpleTask | 14 #define Task SimpleTask |
15 #define TaskPtr SimpleTaskPtr | 15 #define TaskPtr SimpleTaskPtr |
16 #endif | 16 #endif |
17 | 17 |
18 extern Scheduler::TaskObject task_list[MAX_TASK_OBJECT]; | 18 extern TaskObject task_list[MAX_TASK_OBJECT]; |
19 | 19 |
20 /** | 20 /** |
21 Task Object を作る | 21 Task Object を作る |
22 */ | 22 */ |
23 | 23 |
26 createSchedTask(Scheduler *scheduler, TaskPtr task) | 26 createSchedTask(Scheduler *scheduler, TaskPtr task) |
27 { | 27 { |
28 return new SchedTask(); | 28 return new SchedTask(); |
29 } | 29 } |
30 | 30 |
31 | 31 #if 0 |
32 /** | 32 /** |
33 code load を始める。既に get_segment hash に入っていれば何もしない。 | 33 code load を始める。既に get_segment hash に入っていれば何もしない。 |
34 最初の一回は SchedTaskList:: next から呼ばれる。 | |
35 この段階では、SchedTask object は、まだ作られてない。 | |
36 */ | 34 */ |
37 extern void | 35 extern void |
38 loadSchedTask(Scheduler *scheduler,TaskPtr task) | 36 loadSchedTask(Scheduler *scheduler,TaskPtr task) |
39 { | 37 { |
40 // fprintf(stderr,"loadSchedTask %d\n",task->command); | 38 // fprintf(stderr,"loadSchedTask %d\n",task->command); |
41 task_list[task->command].load(scheduler,task->command); | 39 task_list[task->command].load(scheduler,task->command); |
42 } | 40 } |
41 #endif | |
43 | 42 |
44 | 43 |
45 SchedTask::SchedTask() | 44 SchedTask::SchedTask() |
46 { | 45 { |
47 list = NULL; | 46 list = NULL; |
93 { | 92 { |
94 __debug("[SchedTask:%s]\n", __FUNCTION__); | 93 __debug("[SchedTask:%s]\n", __FUNCTION__); |
95 | 94 |
96 // object creation をSchedTask生成時にやらないので、 | 95 // object creation をSchedTask生成時にやらないので、 |
97 // exec の直前のread で十分に間に合う | 96 // exec の直前のread で十分に間に合う |
98 if (cur_index < list->length) { | 97 if (cur_index < list->length) { // if 文は要らないのでは? |
99 // load next task | 98 // load next task |
100 loadSchedTask(scheduler, &list->tasks[cur_index]); | 99 loadSchedTask(scheduler, list->tasks[cur_index].command); |
101 } | 100 } |
102 #ifdef SIMPLE_TASK | 101 #ifdef SIMPLE_TASK |
103 // 読むデータが一つもなければ無視 | 102 // 読むデータが一つもなければ無視 |
104 if (task->r_size == 0) return; | 103 if (task->r_size == 0) return; |
105 // load Input Data | 104 // load Input Data |
268 memaddr | 267 memaddr |
269 SchedTask::get_param(int index) | 268 SchedTask::get_param(int index) |
270 { | 269 { |
271 return task->param[index]; | 270 return task->param[index]; |
272 } | 271 } |
272 | |
273 #else | |
274 | |
275 void* SchedTask::get_input(void *buff, int index) { | |
276 printf("Cannot use inData in SimpleTask use TaskArray\n"); | |
277 return NULL; } | |
278 memaddr SchedTask::get_inputAddr(int index) { return NULL; } | |
279 int SchedTask::get_inputSize(int index) {return 0; } | |
280 void* SchedTask::get_output(void *buff, int index) {return 0; } | |
281 memaddr SchedTask::get_outputAddr(int index) { return NULL; } | |
282 int SchedTask::get_outputSize(int index) { return 0; } | |
283 memaddr SchedTask::get_param(int index) { return 0; } | |
284 | |
273 #endif | 285 #endif |
274 | 286 |
275 void* | 287 void* |
276 SchedTask::global_alloc(int id, int size) { | 288 SchedTask::global_alloc(int id, int size) { |
277 return scheduler->global_alloc(id, size); | 289 return scheduler->global_alloc(id, size); |