annotate TaskManager/kernel/schedule/SchedTask.cc @ 1175:d7486d6a5e37 draft

minor change
author Yutaka_Kinjyo
date Tue, 07 Jun 2011 17:55:20 +0900
parents cce350bed940
children a49c02dffe6f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
736
1b225972ae88 cut printf
hiroki@localhost.localdomain
parents: 718
diff changeset
1
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
2 #include <stdlib.h>
b85b920628e2 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
29bd0882272a TaskArray on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 688
diff changeset
5 #include "SysFunc.h"
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
6 #include "SchedTaskList.h"
695
29bd0882272a TaskArray on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 688
diff changeset
7 #include "SchedTaskArrayLoad.h"
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
8 #include "SchedNop2Ready.h"
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
9 #include "DmaManager.h"
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
10 #include "error.h"
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
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
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 699
diff changeset
14 #include "SchedTaskArray.h"
688
77c89477daa8 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
15 #define Task SimpleTask
77c89477daa8 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
16 #define TaskPtr SimpleTaskPtr
77c89477daa8 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
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
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
19
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
20
423
609758f9f350 Code load implementation... (not yet tested)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 403
diff changeset
21
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
22 SchedTask::SchedTask()
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
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
205e4a4af635 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: 547
diff changeset
34
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
35 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
36
403
e2f29e912d0b clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
37 SchedTask::~SchedTask()
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
38 {
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
39 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
40
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
41 void
972
Yutaka Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents: 970
diff changeset
42 SchedTask::init(TaskListPtr _list, TaskPtr _task, int index, Scheduler* sc, int tag)
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
43 {
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
44 list = _list;
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
45 task = _task;
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
46 scheduler = sc;
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
47 cur_index = index;
972
Yutaka Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents: 970
diff changeset
48 this->tag = tag;
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
49
800
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
50 // scheduler->mainMem_wait(); // これはなんで?
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
51 manager = sc->manager;
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
52
888
b6c45005a3bc call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
53 #ifdef TASK_LIST_MAIL
b6c45005a3bc call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
54 if (list)
b6c45005a3bc call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
55 waiter = (memaddr) list->waiter;
b6c45005a3bc call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
56 #else
b6c45005a3bc call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
57 if (task)
b6c45005a3bc call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
58 waiter = (memaddr) task->self;
b6c45005a3bc call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
59 #endif
b6c45005a3bc call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
60
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
61 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
62
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
63
502
fdc3e30de9d3 Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
64 void
fdc3e30de9d3 Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
65 SchedTask::read()
fdc3e30de9d3 Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
66 {
538
5641d121818e code_load in read()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 502
diff changeset
67 __debug("[SchedTask:%s]\n", __FUNCTION__);
5641d121818e code_load in read()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 502
diff changeset
68
5641d121818e code_load in read()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 502
diff changeset
69 // object creation をSchedTask生成時にやらないので、
5641d121818e code_load in read()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 502
diff changeset
70 // exec の直前のread で十分に間に合う
704
ec6c897448ca Compatibility mode works.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 703
diff changeset
71 loadSchedTask(scheduler, task->command);
713
97adb3fe85c6 remove SIMPLE_TASK conditional
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 708
diff changeset
72
634
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 631
diff changeset
73 // 読むデータが一つもなければ無視
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 631
diff changeset
74 if (task->r_size == 0) return;
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 631
diff changeset
75 // load Input Data
800
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
76 readbuf = manager->allocate(task->r_size);
972
Yutaka Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents: 970
diff changeset
77 scheduler->dma_load(readbuf, task->rbuf,task->r_size, DMA_READ + this->tag);
538
5641d121818e code_load in read()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 502
diff changeset
78
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
79
502
fdc3e30de9d3 Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
80 }
fdc3e30de9d3 Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
81
1099
3b3b535baa51 add resize wbuff example.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 1015
diff changeset
82 void
3b3b535baa51 add resize wbuff example.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 1015
diff changeset
83 SchedTask::setup_outputData()
3b3b535baa51 add resize wbuff example.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 1015
diff changeset
84 {
3b3b535baa51 add resize wbuff example.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 1015
diff changeset
85 writebuf = manager->allocate(task->w_size);
3b3b535baa51 add resize wbuff example.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 1015
diff changeset
86 }
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
87
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
88 void
403
e2f29e912d0b clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
89 SchedTask::exec()
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
90 {
871
d30617ef4b20 fix get segment dma tag zero problem
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 833
diff changeset
91 task_list[task->command].wait(scheduler,task->command);
895
b662e9dd26b0 add alignment of classes in SPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 888
diff changeset
92 TaskObjectRun run = task_list[task->command].run;
699
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 698
diff changeset
93 if (task->w_size > 0) {
1099
3b3b535baa51 add resize wbuff example.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 1015
diff changeset
94 setup_outputData();
699
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 698
diff changeset
95 }
972
Yutaka Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents: 970
diff changeset
96 scheduler->dma_wait(DMA_READ + this->tag);
895
b662e9dd26b0 add alignment of classes in SPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 888
diff changeset
97 run(this, readbuf, writebuf);
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
98 free(readbuf);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
99
547
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
100 // 書き込む領域がなければ無視
713
97adb3fe85c6 remove SIMPLE_TASK conditional
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 708
diff changeset
101
635
c56f6847fb87 SimpleTask worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 634
diff changeset
102 if (task->w_size > 0) {
637
20665e4060ea not yet worked...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 635
diff changeset
103 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
104 }
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
105 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
106
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
107 void
403
e2f29e912d0b clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
108 SchedTask::write()
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
109 {
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
110 __debug("[SchedTask:%s]\n", __FUNCTION__);
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
111
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
112 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
113 free(writebuf);
888
b6c45005a3bc call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
114 #ifdef TASK_LIST_MAIL
b6c45005a3bc call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
115 if (!(cur_index < list->length) )
b6c45005a3bc call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
116 scheduler->mail_write(waiter);
1007
00c01f416e3a add mail_queue
yutaka@localhost.localdomain
parents: 972
diff changeset
117
1009
16afbf03e5d2 not yet....
yutaka@localhost.localdomain
parents: 1007
diff changeset
118 #else
1007
00c01f416e3a add mail_queue
yutaka@localhost.localdomain
parents: 972
diff changeset
119
1009
16afbf03e5d2 not yet....
yutaka@localhost.localdomain
parents: 1007
diff changeset
120 #ifdef MAIL_QUEUE
1007
00c01f416e3a add mail_queue
yutaka@localhost.localdomain
parents: 972
diff changeset
121 scheduler->mail_write_queue(waiter);
888
b6c45005a3bc call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
122 #else
b6c45005a3bc call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
123 scheduler->mail_write(waiter);
830
af2fb2e641eb return TaskList->self
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 805
diff changeset
124 #endif
1009
16afbf03e5d2 not yet....
yutaka@localhost.localdomain
parents: 1007
diff changeset
125 #endif
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
126 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
127
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
128 SchedTaskBase*
403
e2f29e912d0b clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
129 SchedTask::next(Scheduler *scheduler, SchedTaskBase *p)
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
130 {
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
131 __debug("[SchedTask:%s]\n", __FUNCTION__);
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
132
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
133 if (cur_index < list->length) {
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
134 // Task List が残っているので、次を準備
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
135
888
b6c45005a3bc call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
136 TaskPtr nextTask = &list->tasks[cur_index];
1015
29355ae40e6c debug mail timing.
yutaka@localhost.localdomain
parents: 1009
diff changeset
137
708
d41c62201b1e cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
138 SchedTask *nextSched = new SchedTask();
972
Yutaka Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents: 970
diff changeset
139 nextSched->init(list, nextTask, cur_index+1, scheduler, this->tag^1);
717
dfb3518d8694 TaskList load timing...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
140 // この時点で、TaskList は down load が済んでないことがある
dfb3518d8694 TaskList load timing...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
141 // 最初のTaskの種類に関しては、別な情報で渡す方が良い
dfb3518d8694 TaskList load timing...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
142 // あるいはTaskListの最初には、TaskArray1/TaskArray を置かない?
713
97adb3fe85c6 remove SIMPLE_TASK conditional
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 708
diff changeset
143
703
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 699
diff changeset
144 if (nextTask->command==TaskArray1) {
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 699
diff changeset
145 // compatibility
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 699
diff changeset
146 return new SchedTaskArray(scheduler, nextSched);
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 699
diff changeset
147 }
695
29bd0882272a TaskArray on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 688
diff changeset
148 if (nextTask->command==TaskArray) {
29bd0882272a TaskArray on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 688
diff changeset
149 // Start Task Array
970
1a4849b2acad change pipeline and TaskArray fast
Yutaka Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents: 945
diff changeset
150 int dma_tag_switch = 0;
1a4849b2acad change pipeline and TaskArray fast
Yutaka Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents: 945
diff changeset
151 return new SchedTaskArrayLoad(scheduler, nextSched, dma_tag_switch);
695
29bd0882272a TaskArray on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 688
diff changeset
152 }
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
153 return nextSched;
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
154 } else {
603
57ec231bc8ac long -> memaddr (64 or 32)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 602
diff changeset
155 memaddr nextList = (memaddr)list->next;
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
156 if (nextList == 0) {
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
157 // もう何もする必要がない
1015
29355ae40e6c debug mail timing.
yutaka@localhost.localdomain
parents: 1009
diff changeset
158
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
159 return new SchedNop2Ready(scheduler);
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
160 } else {
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
161 // 新しいリストに取り掛かる
972
Yutaka Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents: 970
diff changeset
162 int dma_tag_switch = 0;
Yutaka Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents: 970
diff changeset
163 return new SchedTaskList(nextList, scheduler, dma_tag_switch);
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
164 }
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
165 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
166 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
167
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
168
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
169 int
403
e2f29e912d0b clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
170 SchedTask::get_cpuid()
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
171 {
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
172 return scheduler->id;
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
173 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
174
708
d41c62201b1e cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
175 void SchedTask::free_(void *p) {
d41c62201b1e cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
176 scheduler->free_(p);
d41c62201b1e cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
177 }
d41c62201b1e cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
178
945
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
179 /**
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
180 * SimpleTask has one parameter , one input, one output
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
181 */
698
72b2da99e875 no compile error for Task Array
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 695
diff changeset
182
945
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
183 void* SchedTask::get_input(void *buff, int index) { return readbuf; }
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
184 memaddr SchedTask::get_inputAddr(int index) { return task->rbuf; }
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
185 int SchedTask::get_inputSize(int index) {return task->r_size; }
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
186 void* SchedTask::get_output(void *buff, int index) {return writebuf; }
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
187 memaddr SchedTask::get_outputAddr(int index) { return task->wbuf; }
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
188 int SchedTask::get_outputSize(int index) { return task->w_size; }
1099
3b3b535baa51 add resize wbuff example.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 1015
diff changeset
189 void SchedTask::set_outputSize(int index, int size){task->w_size = size;}
945
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
190 memaddr SchedTask::get_param(int index) { return task->param; }
698
72b2da99e875 no compile error for Task Array
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 695
diff changeset
191
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
192
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
193 void*
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
194 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
195 return scheduler->global_alloc(id, size);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
196 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
197
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
198 void*
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
199 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
200 return scheduler->global_get(id);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
201 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
202
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
203 void
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
204 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
205 scheduler->global_set(id, addr);
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
206 }
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
207
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
208 void
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
209 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
210 scheduler->global_free(id);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
211 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
212
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
213 MemList*
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
214 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
215 return scheduler->createMemList(size, count);
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
216 }
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
217
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
218 void
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
219 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
220 scheduler->mainMem_alloc(id, size);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
221 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
222
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
223 void
403
e2f29e912d0b clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
224 SchedTask::mainMem_wait() {
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
225 scheduler->mainMem_wait();
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
226 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
227
631
30dd8a3deb4a Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 625
diff changeset
228 memaddr
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
229 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
230 return scheduler->mainMem_get(id);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
231 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
232
467
839e34d0cc3c fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 466
diff changeset
233
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
234 void
625
94d82f2c842f 64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
235 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
236 scheduler->dma_load(buf, addr, size, mask);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
237 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
238
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
239 void
625
94d82f2c842f 64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
240 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
241 scheduler->dma_store(buf, addr, size, mask);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
242 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
243
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
244 void
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
245 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
246 scheduler->dma_wait(mask);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
247 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
248
334
7bc5cbc5fe04 [in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents: 321
diff changeset
249 void
7bc5cbc5fe04 [in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents: 321
diff changeset
250 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
251 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
252 }
7bc5cbc5fe04 [in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents: 321
diff changeset
253
1124
c43f49400c22 add mail profile
yutaka@localhost.localdomain
parents: 1099
diff changeset
254
674
07351a5a51c9 fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 672
diff changeset
255 long
07351a5a51c9 fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 672
diff changeset
256 SchedTask::get_random() {
07351a5a51c9 fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 672
diff changeset
257 return scheduler->get_random();
07351a5a51c9 fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 672
diff changeset
258 }
07351a5a51c9 fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 672
diff changeset
259
672
27fec8c70c9c add profiling code
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
260 void
27fec8c70c9c add profiling code
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
261 SchedTask::start_profile() {
27fec8c70c9c add profiling code
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
262 scheduler->start_profile();
27fec8c70c9c add profiling code
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
263 }
27fec8c70c9c add profiling code
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
264
387
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
265 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
266 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
267 }
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
268
1173
cce350bed940 add MemIterator. (no test)
Yutaka_Kinjyo
parents: 1156
diff changeset
269 MemorySegment * SchedTask::get_free_segment(memaddr addr, MemList *m) {
cce350bed940 add MemIterator. (no test)
Yutaka_Kinjyo
parents: 1156
diff changeset
270 return scheduler->get_free_segment(addr,m);
cce350bed940 add MemIterator. (no test)
Yutaka_Kinjyo
parents: 1156
diff changeset
271 }
cce350bed940 add MemIterator. (no test)
Yutaka_Kinjyo
parents: 1156
diff changeset
272
1175
d7486d6a5e37 minor change
Yutaka_Kinjyo
parents: 1173
diff changeset
273 void SchedTask::overwrite_segment(MemorySegment *s, memaddr addr) {
d7486d6a5e37 minor change
Yutaka_Kinjyo
parents: 1173
diff changeset
274 return scheduler->overwrite_segment(s,addr);
d7486d6a5e37 minor change
Yutaka_Kinjyo
parents: 1173
diff changeset
275 }
d7486d6a5e37 minor change
Yutaka_Kinjyo
parents: 1173
diff changeset
276
1173
cce350bed940 add MemIterator. (no test)
Yutaka_Kinjyo
parents: 1156
diff changeset
277
387
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
278 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
279 scheduler->put_segment(s);
387
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
280 }
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
281
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
282 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
283 scheduler->wait_segment(s);
387
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
284 }
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
285
917
fa21f48ba580 add get_tag ( no one use it though )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 897
diff changeset
286 uint32 SchedTask::get_tag() {
fa21f48ba580 add get_tag ( no one use it though )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 897
diff changeset
287 return scheduler->get_tag();
fa21f48ba580 add get_tag ( no one use it though )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 897
diff changeset
288 }
fa21f48ba580 add get_tag ( no one use it though )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 897
diff changeset
289
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
290
634
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 631
diff changeset
291 HTaskPtr
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 631
diff changeset
292 SchedTask::create_task(int cmd)
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
293 {
897
6bd218d3f643 add return address in SimpleTask for debugging.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 895
diff changeset
294 return manager->create_task(cmd, __builtin_return_address(0));
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
295 }
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
296
634
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 631
diff changeset
297 HTaskPtr
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 631
diff changeset
298 SchedTask::create_task(int cmd, memaddr r, long rs, memaddr w, long ws)
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 631
diff changeset
299 {
897
6bd218d3f643 add return address in SimpleTask for debugging.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 895
diff changeset
300 return manager->create_task(cmd,r,rs,w,ws, __builtin_return_address(0));
800
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
301 }
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
302
801
eb6add789a24 global id
yutaka@localhost.localdomain
parents: 777
diff changeset
303 HTaskPtr
eb6add789a24 global id
yutaka@localhost.localdomain
parents: 777
diff changeset
304 SchedTask::create_task_array(int id, int num_task, int num_param, int num_inData, int num_outData)
eb6add789a24 global id
yutaka@localhost.localdomain
parents: 777
diff changeset
305 {
897
6bd218d3f643 add return address in SimpleTask for debugging.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 895
diff changeset
306 return manager->create_task_array(id, num_task, num_param, num_inData, num_outData, __builtin_return_address(0));
801
eb6add789a24 global id
yutaka@localhost.localdomain
parents: 777
diff changeset
307 }
eb6add789a24 global id
yutaka@localhost.localdomain
parents: 777
diff changeset
308
941
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 917
diff changeset
309 void SchedTask::free_htask(HTask *p) {
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 917
diff changeset
310 #if !defined(__SPU__)
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 917
diff changeset
311 manager->free_htask(p);
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 917
diff changeset
312 #endif
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 917
diff changeset
313 }
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 917
diff changeset
314
634
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 631
diff changeset
315
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
316 void SchedTask::set_task_depend(HTaskPtr master, HTaskPtr slave)
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
317 {
800
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
318 manager->set_task_depend(master, slave);
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
319 }
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
320
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
321 void SchedTask::spawn_task(HTaskPtr t)
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
322 {
800
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
323 manager->spawn_task(t);
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
324 }
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
325
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
326 void SchedTask::set_task_cpu(HTaskPtr t, CPU_TYPE cpu)
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
327 {
800
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
328 manager->set_task_cpu(t, cpu);
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
329 }
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
330
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
331 void* SchedTask::allocate(int size)
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
332 {
800
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
333 return manager->allocate(size) ;
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
334 }
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
335
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
336 void* SchedTask::allocate(int size,int align)
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
337 {
800
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
338 return manager->allocate(size,align) ;
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
339 }
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
340
833
577bde5d0cec poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
341 void SchedTask::polling()
577bde5d0cec poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
342 {
577bde5d0cec poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
343 manager->polling();
577bde5d0cec poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
344 }
577bde5d0cec poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
345
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
346 Scheduler* SchedTask::get_scheduler()
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
347 {
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
348 return scheduler;
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
349 }
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
350
466
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
351 /* system call */
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
352
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
353 int
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
354 SchedTask::printf(const char * format, ...)
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
355 {
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
356 va_list ap;
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
357 va_start(ap,format);
743
55ccf5f6d9af continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 736
diff changeset
358 int ret= scheduler->vprintf0(format, ap);
466
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
359 va_end(ap);
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
360 return ret;
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
361 }
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
362
387
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
363
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
364 /* end */