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