annotate TaskManager/kernel/schedule/SchedTask.cc @ 888:586ed400413a

call savedTask->write() in TaskArray finish. TASK_LIST_MAIL is working now.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 14 Jul 2010 23:54:36 +0900
parents ab3cd3aeacff
children bed529c55eda
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
736
31d0a5baafdf cut printf
hiroki@localhost.localdomain
parents: 718
diff changeset
1
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
2 #include <stdlib.h>
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
3 #include <string.h>
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
4 #include "SchedTask.h"
695
cbcf0182635e TaskArray on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 683
diff changeset
5 #include "SysFunc.h"
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
6 #include "SchedTaskList.h"
695
cbcf0182635e TaskArray on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 683
diff changeset
7 #include "SchedTaskArrayLoad.h"
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
8 #include "SchedNop2Ready.h"
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
9 #include "DmaManager.h"
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
10 #include "error.h"
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
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
61b59376aec5 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 699
diff changeset
14 #include "SchedTaskArray.h"
683
9a6cb2439593 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
15 #define Task SimpleTask
9a6cb2439593 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
16 #define TaskPtr SimpleTaskPtr
9a6cb2439593 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
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
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
19
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
20
421
cd77224d4224 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
21
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
22 SchedTask::SchedTask()
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
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
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
33
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 519
diff changeset
34
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
35 }
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
36
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
37 /**
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
38 * dma_store の wait を行う
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
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
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
41 {
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
42 }
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
43
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
44
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
45 void
708
56487849ea2d cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
46 SchedTask::init(TaskListPtr _list, TaskPtr _task, int index, Scheduler* sc)
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
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
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 519
diff changeset
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
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
55
888
586ed400413a call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
56 #ifdef TASK_LIST_MAIL
586ed400413a call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
57 if (list)
586ed400413a call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
58 waiter = (memaddr) list->waiter;
586ed400413a call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
59 #else
586ed400413a call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
60 if (task)
586ed400413a call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
61 waiter = (memaddr) task->self;
586ed400413a call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
62 #endif
586ed400413a call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
63
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 519
diff changeset
64 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 519
diff changeset
65
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
66
502
36b323130b1b Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
67 void
36b323130b1b Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
68 SchedTask::read()
36b323130b1b Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
69 {
506
1d4a8a86f26b code_load in read()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 502
diff changeset
70 __debug("[SchedTask:%s]\n", __FUNCTION__);
1d4a8a86f26b code_load in read()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 502
diff changeset
71
1d4a8a86f26b code_load in read()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 502
diff changeset
72 // object creation をSchedTask生成時にやらないので、
1d4a8a86f26b code_load in read()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 502
diff changeset
73 // exec の直前のread で十分に間に合う
704
6d497c098455 Compatibility mode works.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 703
diff changeset
74 loadSchedTask(scheduler, task->command);
713
f725c6455d19 remove SIMPLE_TASK conditional
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 708
diff changeset
75
634
0558abba673c SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 629
diff changeset
76 // 読むデータが一つもなければ無視
0558abba673c SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 629
diff changeset
77 if (task->r_size == 0) return;
0558abba673c SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 629
diff changeset
78 // load Input Data
800
2708c4a7bade run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
79 readbuf = manager->allocate(task->r_size);
634
0558abba673c SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 629
diff changeset
80 scheduler->dma_load(readbuf, task->rbuf,task->r_size, DMA_READ);
506
1d4a8a86f26b code_load in read()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 502
diff changeset
81
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 519
diff changeset
82
502
36b323130b1b Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
83 }
36b323130b1b Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
84
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
85
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
86 void
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
87 SchedTask::exec()
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
88 {
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
89 __debug("[SchedTask:%s]\n", __FUNCTION__);
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
90
871
ab3cd3aeacff fix get segment dma tag zero problem
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 832
diff changeset
91 task_list[task->command].wait(scheduler,task->command);
699
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 698
diff changeset
92 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
93 writebuf = manager->allocate(task->w_size);
699
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 698
diff changeset
94 }
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 519
diff changeset
95 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
96 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
97 free(readbuf);
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
98
519
5c76db2a07fa continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 518
diff changeset
99 // 書き込む領域がなければ無視
713
f725c6455d19 remove SIMPLE_TASK conditional
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 708
diff changeset
100
635
8cc609285bbe SimpleTask worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 634
diff changeset
101 if (task->w_size > 0) {
637
5530fa36d42e not yet worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 635
diff changeset
102 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
103 }
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
104 }
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
105
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
106 void
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
107 SchedTask::write()
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
108 {
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
109 __debug("[SchedTask:%s]\n", __FUNCTION__);
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
110
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 519
diff changeset
111 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
112 free(writebuf);
888
586ed400413a call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
113 #ifdef TASK_LIST_MAIL
586ed400413a call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
114 if (!(cur_index < list->length) )
586ed400413a call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
115 scheduler->mail_write(waiter);
586ed400413a call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
116 #else
586ed400413a call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
117 scheduler->mail_write(waiter);
830
c7905ead974f return TaskList->self
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
118 #endif
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
119 }
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
120
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
121 SchedTaskBase*
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
122 SchedTask::next(Scheduler *scheduler, SchedTaskBase *p)
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
123 {
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
124 __debug("[SchedTask:%s]\n", __FUNCTION__);
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
125
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 519
diff changeset
126 if (cur_index < list->length) {
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
127 // Task List が残っているので、次を準備
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 519
diff changeset
128
888
586ed400413a call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
129 TaskPtr nextTask = &list->tasks[cur_index];
708
56487849ea2d cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
130 SchedTask *nextSched = new SchedTask();
888
586ed400413a call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
131 nextSched->init(list, nextTask, cur_index+1, scheduler);
717
4c12f679a0fa TaskList load timing...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
132 // この時点で、TaskList は down load が済んでないことがある
4c12f679a0fa TaskList load timing...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
133 // 最初のTaskの種類に関しては、別な情報で渡す方が良い
4c12f679a0fa TaskList load timing...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
134 // あるいはTaskListの最初には、TaskArray1/TaskArray を置かない?
713
f725c6455d19 remove SIMPLE_TASK conditional
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 708
diff changeset
135
703
61b59376aec5 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 699
diff changeset
136 if (nextTask->command==TaskArray1) {
61b59376aec5 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 699
diff changeset
137 // compatibility
61b59376aec5 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 699
diff changeset
138 return new SchedTaskArray(scheduler, nextSched);
61b59376aec5 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 699
diff changeset
139 }
695
cbcf0182635e TaskArray on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 683
diff changeset
140 if (nextTask->command==TaskArray) {
cbcf0182635e TaskArray on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 683
diff changeset
141 // Start Task Array
708
56487849ea2d cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
142 return new SchedTaskArrayLoad(scheduler, nextSched);
695
cbcf0182635e TaskArray on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 683
diff changeset
143 }
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
144 return nextSched;
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
145 } else {
603
42c94f85c779 long -> memaddr (64 or 32)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 602
diff changeset
146 memaddr nextList = (memaddr)list->next;
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 519
diff changeset
147 if (nextList == 0) {
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
148 // もう何もする必要がない
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 519
diff changeset
149 return new SchedNop2Ready(scheduler);
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 519
diff changeset
150 } else {
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
151 // 新しいリストに取り掛かる
708
56487849ea2d cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
152 return new SchedTaskList(nextList, scheduler);
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 519
diff changeset
153 }
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
154 }
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
155 }
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
156
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
157
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
158 int
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
159 SchedTask::get_cpuid()
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
160 {
483
0b933bef0328 renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
161 return scheduler->id;
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
162 }
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
163
708
56487849ea2d cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
164 void SchedTask::free_(void *p) {
56487849ea2d cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
165 scheduler->free_(p);
56487849ea2d cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
166 }
56487849ea2d cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
167
698
dcaa40ec963d no compile error for Task Array
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 695
diff changeset
168
dcaa40ec963d no compile error for Task Array
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 695
diff changeset
169 void* SchedTask::get_input(void *buff, int index) {
736
31d0a5baafdf cut printf
hiroki@localhost.localdomain
parents: 718
diff changeset
170 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
171 return NULL; }
706
e4d2b823903c no compile error on Cell. Regression Test.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 704
diff changeset
172 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
173 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
174 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
175 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
176 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
177 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
178
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
179
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
180 void*
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
181 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
182 return scheduler->global_alloc(id, size);
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
183 }
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
184
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
185 void*
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
186 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
187 return scheduler->global_get(id);
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
188 }
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
189
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
190 void
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
191 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
192 scheduler->global_set(id, addr);
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
193 }
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
194
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
195 void
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
196 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
197 scheduler->global_free(id);
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
198 }
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
199
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
200 MemList*
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
201 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
202 return scheduler->createMemList(size, count);
373
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
203 }
eab18aa0c7f6 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
204
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
205 void
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
206 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
207 scheduler->mainMem_alloc(id, size);
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
208 }
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
209
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
210 void
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
211 SchedTask::mainMem_wait() {
483
0b933bef0328 renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
212 scheduler->mainMem_wait();
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
213 }
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
214
629
8843edf37c0e Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 625
diff changeset
215 memaddr
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
216 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
217 return scheduler->mainMem_get(id);
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
218 }
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
219
467
44c0bce54dcf fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 466
diff changeset
220
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
221 void
625
60aa3f241b10 64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
222 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
223 scheduler->dma_load(buf, addr, size, mask);
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
224 }
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
225
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
226 void
625
60aa3f241b10 64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
227 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
228 scheduler->dma_store(buf, addr, size, mask);
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
229 }
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
230
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
231 void
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
232 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
233 scheduler->dma_wait(mask);
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
234 }
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
235
334
20f2459041cb [in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents: 321
diff changeset
236 void
20f2459041cb [in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents: 321
diff changeset
237 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
238 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
239 }
20f2459041cb [in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents: 321
diff changeset
240
674
bde5f13adf10 fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 672
diff changeset
241 long
bde5f13adf10 fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 672
diff changeset
242 SchedTask::get_random() {
bde5f13adf10 fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 672
diff changeset
243 return scheduler->get_random();
bde5f13adf10 fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 672
diff changeset
244 }
bde5f13adf10 fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 672
diff changeset
245
672
3b6290c05f9f add profiling code
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
246 void
3b6290c05f9f add profiling code
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
247 SchedTask::start_profile() {
3b6290c05f9f add profiling code
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
248 scheduler->start_profile();
3b6290c05f9f add profiling code
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
249 }
3b6290c05f9f add profiling code
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
250
387
5e2d30bfbf23 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
251 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
252 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
253 }
5e2d30bfbf23 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
254
5e2d30bfbf23 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
255 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
256 scheduler->put_segment(s);
387
5e2d30bfbf23 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
257 }
5e2d30bfbf23 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
258
5e2d30bfbf23 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
259 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
260 scheduler->wait_segment(s);
387
5e2d30bfbf23 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
261 }
5e2d30bfbf23 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
262
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
263
634
0558abba673c SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 629
diff changeset
264 HTaskPtr
0558abba673c SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 629
diff changeset
265 SchedTask::create_task(int cmd)
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
266 {
800
2708c4a7bade run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
267 return manager->create_task(cmd);
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
268 }
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
269
634
0558abba673c SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 629
diff changeset
270 HTaskPtr
0558abba673c SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 629
diff changeset
271 SchedTask::create_task(int cmd, memaddr r, long rs, memaddr w, long ws)
0558abba673c SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 629
diff changeset
272 {
800
2708c4a7bade run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
273 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
274 }
2708c4a7bade run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
275
802
496a8159e840 global id
yutaka@localhost.localdomain
parents: 777
diff changeset
276 HTaskPtr
496a8159e840 global id
yutaka@localhost.localdomain
parents: 777
diff changeset
277 SchedTask::create_task_array(int id, int num_task, int num_param, int num_inData, int num_outData)
496a8159e840 global id
yutaka@localhost.localdomain
parents: 777
diff changeset
278 {
806
32584e896fe7 add word_count_run16array
yutaka@localhost.localdomain
parents: 805
diff changeset
279 return manager->create_task_array(id, num_task, num_param, num_inData, num_outData);
802
496a8159e840 global id
yutaka@localhost.localdomain
parents: 777
diff changeset
280 }
496a8159e840 global id
yutaka@localhost.localdomain
parents: 777
diff changeset
281
634
0558abba673c SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 629
diff changeset
282
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
283 void SchedTask::set_task_depend(HTaskPtr master, HTaskPtr slave)
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
284 {
800
2708c4a7bade run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
285 manager->set_task_depend(master, slave);
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
286 }
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
287
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
288 void SchedTask::spawn_task(HTaskPtr t)
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
289 {
800
2708c4a7bade run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
290 manager->spawn_task(t);
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
291 }
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
292
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
293 void SchedTask::set_task_cpu(HTaskPtr t, CPU_TYPE cpu)
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
294 {
800
2708c4a7bade run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
295 manager->set_task_cpu(t, cpu);
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
296 }
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
297
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
298 void* SchedTask::allocate(int size)
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
299 {
800
2708c4a7bade run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
300 return manager->allocate(size) ;
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
301 }
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
302
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
303 void* SchedTask::allocate(int size,int align)
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
304 {
800
2708c4a7bade run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
305 return manager->allocate(size,align) ;
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
306 }
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
307
832
29094b48d966 poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
308 void SchedTask::polling()
29094b48d966 poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
309 {
29094b48d966 poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
310 manager->polling();
29094b48d966 poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
311 }
29094b48d966 poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
312
619
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
313 Scheduler* SchedTask::get_scheduler()
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
314 {
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
315 return scheduler;
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
316 }
0decff4e867b RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
317
466
4fa8760e18c2 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
318 /* system call */
4fa8760e18c2 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
319
4fa8760e18c2 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
320 int
4fa8760e18c2 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
321 SchedTask::printf(const char * format, ...)
4fa8760e18c2 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
322 {
4fa8760e18c2 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
323 va_list ap;
4fa8760e18c2 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
324 va_start(ap,format);
742
4c2e6493b008 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 736
diff changeset
325 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
326 va_end(ap);
4fa8760e18c2 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
327 return ret;
4fa8760e18c2 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
328 }
4fa8760e18c2 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
329
387
5e2d30bfbf23 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
330
308
2ac66db4dd11 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
331 /* end */