Mercurial > hg > Game > Cerium
annotate TaskManager/kernel/schedule/SchedTask.cc @ 736:1b225972ae88 draft
cut printf
author | hiroki@localhost.localdomain |
---|---|
date | Sun, 27 Dec 2009 20:39:33 +0900 |
parents | e78238b7c5d6 |
children | 55ccf5f6d9af |
rev | line source |
---|---|
736 | 1 |
308 | 2 #include <stdlib.h> |
3 #include <string.h> | |
42 | 4 #include "SchedTask.h" |
695 | 5 #include "SysFunc.h" |
308 | 6 #include "SchedTaskList.h" |
695 | 7 #include "SchedTaskArrayLoad.h" |
308 | 8 #include "SchedNop2Ready.h" |
9 #include "DmaManager.h" | |
10 #include "error.h" | |
11 #include "TaskManager.h" | |
466
c73aff02db67
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
12 #include <stdarg.h> |
180
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
13 |
703 | 14 #include "SchedTaskArray.h" |
688 | 15 #define Task SimpleTask |
16 #define TaskPtr SimpleTaskPtr | |
17 | |
698
72b2da99e875
no compile error for Task Array
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
695
diff
changeset
|
18 extern TaskObject task_list[MAX_TASK_OBJECT]; |
308 | 19 |
20 | |
423
609758f9f350
Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
403
diff
changeset
|
21 |
308 | 22 SchedTask::SchedTask() |
23 { | |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
24 list = NULL; |
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
25 task = NULL; |
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
26 readbuf = NULL; |
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
27 writebuf = NULL; |
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
28 scheduler = NULL; |
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
29 cur_index = 0; |
466
c73aff02db67
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
30 this->stdout_ = stdout; |
c73aff02db67
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
31 this->stderr_ = stderr; |
c73aff02db67
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
32 this->stdin_ = stdin; |
373 | 33 |
567 | 34 |
308 | 35 } |
36 | |
37 /** | |
38 * dma_store の wait を行う | |
39 */ | |
403
e2f29e912d0b
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
40 SchedTask::~SchedTask() |
308 | 41 { |
42 } | |
43 | |
44 | |
45 void | |
708 | 46 SchedTask::init(TaskListPtr _list, TaskPtr _task, int index, Scheduler* sc) |
308 | 47 { |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
48 list = _list; |
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
49 task = _task; |
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
50 scheduler = sc; |
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
51 cur_index = index; |
567 | 52 |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
53 scheduler->mainMem_wait(); |
308 | 54 |
567 | 55 } |
56 | |
308 | 57 |
502
fdc3e30de9d3
Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
501
diff
changeset
|
58 void |
fdc3e30de9d3
Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
501
diff
changeset
|
59 SchedTask::read() |
fdc3e30de9d3
Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
501
diff
changeset
|
60 { |
538 | 61 __debug("[SchedTask:%s]\n", __FUNCTION__); |
62 | |
63 // object creation をSchedTask生成時にやらないので、 | |
64 // exec の直前のread で十分に間に合う | |
704
ec6c897448ca
Compatibility mode works.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
703
diff
changeset
|
65 loadSchedTask(scheduler, task->command); |
713
97adb3fe85c6
remove SIMPLE_TASK conditional
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
708
diff
changeset
|
66 |
634 | 67 // 読むデータが一つもなければ無視 |
68 if (task->r_size == 0) return; | |
69 // load Input Data | |
70 readbuf = scheduler->allocate(task->r_size); | |
71 scheduler->dma_load(readbuf, task->rbuf,task->r_size, DMA_READ); | |
538 | 72 |
567 | 73 |
502
fdc3e30de9d3
Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
501
diff
changeset
|
74 } |
fdc3e30de9d3
Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
501
diff
changeset
|
75 |
308 | 76 |
77 void | |
403
e2f29e912d0b
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
78 SchedTask::exec() |
308 | 79 { |
80 __debug("[SchedTask:%s]\n", __FUNCTION__); | |
81 | |
699 | 82 if (task->w_size > 0) { |
83 writebuf = scheduler->allocate(task->w_size); | |
84 } | |
567 | 85 scheduler->dma_wait(DMA_READ); |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
86 task_list[task->command].wait(scheduler,task->command); |
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
87 task_list[task->command].run(this, readbuf, writebuf); |
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
88 free(readbuf); |
308 | 89 |
547 | 90 // 書き込む領域がなければ無視 |
713
97adb3fe85c6
remove SIMPLE_TASK conditional
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
708
diff
changeset
|
91 |
635
c56f6847fb87
SimpleTask worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
634
diff
changeset
|
92 if (task->w_size > 0) { |
637 | 93 scheduler->dma_store(writebuf, task->wbuf,task->w_size, DMA_WRITE); |
635
c56f6847fb87
SimpleTask worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
634
diff
changeset
|
94 } |
308 | 95 } |
96 | |
97 void | |
403
e2f29e912d0b
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
98 SchedTask::write() |
308 | 99 { |
100 __debug("[SchedTask:%s]\n", __FUNCTION__); | |
373 | 101 |
567 | 102 scheduler->dma_wait(DMA_WRITE); |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
103 free(writebuf); |
567 | 104 |
625
94d82f2c842f
64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
619
diff
changeset
|
105 scheduler->mail_write((memaddr)task->self); |
308 | 106 } |
107 | |
108 SchedTaskBase* | |
403
e2f29e912d0b
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
109 SchedTask::next(Scheduler *scheduler, SchedTaskBase *p) |
308 | 110 { |
111 __debug("[SchedTask:%s]\n", __FUNCTION__); | |
112 | |
567 | 113 if (cur_index < list->length) { |
619 | 114 // Task List が残っているので、次を準備 |
567 | 115 |
619 | 116 TaskPtr nextTask = &list->tasks[cur_index++]; |
708 | 117 SchedTask *nextSched = new SchedTask(); |
118 nextSched->init(list, nextTask, cur_index, scheduler); | |
717
dfb3518d8694
TaskList load timing...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
713
diff
changeset
|
119 // この時点で、TaskList は down load が済んでないことがある |
dfb3518d8694
TaskList load timing...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
713
diff
changeset
|
120 // 最初のTaskの種類に関しては、別な情報で渡す方が良い |
dfb3518d8694
TaskList load timing...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
713
diff
changeset
|
121 // あるいはTaskListの最初には、TaskArray1/TaskArray を置かない? |
713
97adb3fe85c6
remove SIMPLE_TASK conditional
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
708
diff
changeset
|
122 |
703 | 123 if (nextTask->command==TaskArray1) { |
124 // compatibility | |
125 return new SchedTaskArray(scheduler, nextSched); | |
126 } | |
695 | 127 if (nextTask->command==TaskArray) { |
128 // Start Task Array | |
708 | 129 return new SchedTaskArrayLoad(scheduler, nextSched); |
695 | 130 } |
619 | 131 return nextSched; |
308 | 132 } else { |
603
57ec231bc8ac
long -> memaddr (64 or 32)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
602
diff
changeset
|
133 memaddr nextList = (memaddr)list->next; |
567 | 134 if (nextList == 0) { |
619 | 135 // もう何もする必要がない |
567 | 136 return new SchedNop2Ready(scheduler); |
137 } else { | |
619 | 138 // 新しいリストに取り掛かる |
708 | 139 return new SchedTaskList(nextList, scheduler); |
567 | 140 } |
308 | 141 } |
142 } | |
143 | |
144 | |
145 int | |
403
e2f29e912d0b
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
146 SchedTask::get_cpuid() |
308 | 147 { |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
148 return scheduler->id; |
308 | 149 } |
150 | |
708 | 151 void SchedTask::free_(void *p) { |
152 scheduler->free_(p); | |
153 } | |
154 | |
698
72b2da99e875
no compile error for Task Array
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
695
diff
changeset
|
155 |
72b2da99e875
no compile error for Task Array
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
695
diff
changeset
|
156 void* SchedTask::get_input(void *buff, int index) { |
736 | 157 scheduler->printf("Cannot use inData in SimpleTask use TaskArray\n"); |
698
72b2da99e875
no compile error for Task Array
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
695
diff
changeset
|
158 return NULL; } |
706
b2b4a1243961
no compile error on Cell. Regression Test.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
704
diff
changeset
|
159 memaddr SchedTask::get_inputAddr(int index) { return 0; } |
698
72b2da99e875
no compile error for Task Array
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
695
diff
changeset
|
160 int SchedTask::get_inputSize(int index) {return 0; } |
72b2da99e875
no compile error for Task Array
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
695
diff
changeset
|
161 void* SchedTask::get_output(void *buff, int index) {return 0; } |
706
b2b4a1243961
no compile error on Cell. Regression Test.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
704
diff
changeset
|
162 memaddr SchedTask::get_outputAddr(int index) { return 0; } |
698
72b2da99e875
no compile error for Task Array
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
695
diff
changeset
|
163 int SchedTask::get_outputSize(int index) { return 0; } |
72b2da99e875
no compile error for Task Array
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
695
diff
changeset
|
164 memaddr SchedTask::get_param(int index) { return 0; } |
72b2da99e875
no compile error for Task Array
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
695
diff
changeset
|
165 |
308 | 166 |
167 void* | |
168 SchedTask::global_alloc(int id, int size) { | |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
169 return scheduler->global_alloc(id, size); |
308 | 170 } |
171 | |
172 void* | |
173 SchedTask::global_get(int id) { | |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
174 return scheduler->global_get(id); |
308 | 175 } |
176 | |
177 void | |
373 | 178 SchedTask::global_set(int id, void *addr) { |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
179 scheduler->global_set(id, addr); |
373 | 180 } |
181 | |
182 void | |
308 | 183 SchedTask::global_free(int id) { |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
184 scheduler->global_free(id); |
308 | 185 } |
186 | |
373 | 187 MemList* |
188 SchedTask::createMemList(int size, int count) { | |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
189 return scheduler->createMemList(size, count); |
373 | 190 } |
191 | |
308 | 192 void |
193 SchedTask::mainMem_alloc(int id, int size) { | |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
194 scheduler->mainMem_alloc(id, size); |
308 | 195 } |
196 | |
197 void | |
403
e2f29e912d0b
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
395
diff
changeset
|
198 SchedTask::mainMem_wait() { |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
199 scheduler->mainMem_wait(); |
308 | 200 } |
201 | |
631
30dd8a3deb4a
Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
625
diff
changeset
|
202 memaddr |
308 | 203 SchedTask::mainMem_get(int id) { |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
204 return scheduler->mainMem_get(id); |
308 | 205 } |
206 | |
467
839e34d0cc3c
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
466
diff
changeset
|
207 |
308 | 208 void |
625
94d82f2c842f
64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
619
diff
changeset
|
209 SchedTask::dma_load(void *buf, memaddr addr, uint32 size, uint32 mask) { |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
210 scheduler->dma_load(buf, addr, size, mask); |
308 | 211 } |
212 | |
213 void | |
625
94d82f2c842f
64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
619
diff
changeset
|
214 SchedTask::dma_store(void *buf,memaddr addr, uint32 size, uint32 mask) { |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
215 scheduler->dma_store(buf, addr, size, mask); |
308 | 216 } |
217 | |
218 void | |
219 SchedTask::dma_wait(uint32 mask) { | |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
220 scheduler->dma_wait(mask); |
308 | 221 } |
222 | |
334
7bc5cbc5fe04
[in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents:
321
diff
changeset
|
223 void |
7bc5cbc5fe04
[in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents:
321
diff
changeset
|
224 SchedTask::show_dma_wait() { |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
225 scheduler->show_dma_wait(); |
334
7bc5cbc5fe04
[in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents:
321
diff
changeset
|
226 } |
7bc5cbc5fe04
[in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents:
321
diff
changeset
|
227 |
674
07351a5a51c9
fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
672
diff
changeset
|
228 long |
07351a5a51c9
fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
672
diff
changeset
|
229 SchedTask::get_random() { |
07351a5a51c9
fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
672
diff
changeset
|
230 return scheduler->get_random(); |
07351a5a51c9
fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
672
diff
changeset
|
231 } |
07351a5a51c9
fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
672
diff
changeset
|
232 |
672 | 233 void |
234 SchedTask::start_profile() { | |
235 scheduler->start_profile(); | |
236 } | |
237 | |
387
b6fce69839b5
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
238 MemorySegment * SchedTask::get_segment(memaddr addr, MemList *m) { |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
239 return scheduler->get_segment(addr,m); |
387
b6fce69839b5
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
240 } |
b6fce69839b5
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
241 |
b6fce69839b5
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
242 void SchedTask::put_segment(MemorySegment *s) { |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
243 scheduler->put_segment(s); |
387
b6fce69839b5
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
244 } |
b6fce69839b5
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
245 |
b6fce69839b5
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
246 void SchedTask::wait_segment(MemorySegment *s) { |
483
5f4ffff2c2aa
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
468
diff
changeset
|
247 scheduler->wait_segment(s); |
387
b6fce69839b5
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
248 } |
b6fce69839b5
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
249 |
619 | 250 |
634 | 251 HTaskPtr |
252 SchedTask::create_task(int cmd) | |
619 | 253 { |
254 return scheduler->create_task(cmd); | |
255 } | |
256 | |
634 | 257 HTaskPtr |
258 SchedTask::create_task(int cmd, memaddr r, long rs, memaddr w, long ws) | |
259 { | |
260 return scheduler->create_task(cmd,r,rs,w,ws); | |
261 } | |
262 | |
263 | |
619 | 264 void SchedTask::set_task_depend(HTaskPtr master, HTaskPtr slave) |
265 { | |
266 scheduler->set_task_depend(master, slave); | |
267 } | |
268 | |
269 void SchedTask::spawn_task(HTaskPtr t) | |
270 { | |
271 scheduler->spawn_task(t); | |
272 } | |
273 | |
274 void SchedTask::set_task_cpu(HTaskPtr t, CPU_TYPE cpu) | |
275 { | |
276 scheduler->set_task_cpu(t, cpu); | |
277 } | |
278 | |
279 void* SchedTask::allocate(int size) | |
280 { | |
281 return scheduler->allocate(size) ; | |
282 } | |
283 | |
284 void* SchedTask::allocate(int size,int align) | |
285 { | |
286 return scheduler->allocate(size,align) ; | |
287 } | |
288 | |
289 Scheduler* SchedTask::get_scheduler() | |
290 { | |
291 return scheduler; | |
292 } | |
293 | |
466
c73aff02db67
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
294 /* system call */ |
c73aff02db67
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
295 |
c73aff02db67
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
296 int |
c73aff02db67
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
297 SchedTask::printf(const char * format, ...) |
c73aff02db67
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
298 { |
c73aff02db67
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
299 va_list ap; |
c73aff02db67
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
300 va_start(ap,format); |
736 | 301 int ret= scheduler->vprintf(format, ap); |
466
c73aff02db67
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
302 va_end(ap); |
c73aff02db67
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
303 return ret; |
c73aff02db67
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
304 } |
c73aff02db67
prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
305 |
387
b6fce69839b5
no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
306 |
308 | 307 /* end */ |