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