Mercurial > hg > Members > kono > Cerium
annotate TaskManager/kernel/schedule/SchedTask.cc @ 180:5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
author | gongo@localhost.localdomain |
---|---|
date | Mon, 22 Dec 2008 16:09:57 +0900 |
parents | 5c194c71eca8 |
children | df3cfc04e796 |
rev | line source |
---|---|
109 | 1 #include <stdlib.h> |
2 #include <string.h> | |
42 | 3 #include "SchedTask.h" |
4 #include "SchedTaskList.h" | |
5 #include "SchedNop2Ready.h" | |
6 #include "DmaManager.h" | |
7 #include "error.h" | |
8 #include "TaskManager.h" | |
109 | 9 |
10 extern Scheduler::TaskObject task_list[MAX_TASK_OBJECT]; | |
42 | 11 |
109 | 12 SchedTask* |
13 CreateSchedTask(TaskListPtr taskList, Scheduler *sched) | |
14 { | |
15 TaskPtr task = &taskList->tasks[sched->curIndex_taskList++]; | |
16 | |
17 return task_list[task->command](taskList, task, sched->get_curReadBuf(), | |
18 sched->get_curWriteBuf(), sched); | |
19 } | |
42 | 20 |
109 | 21 SchedTask::SchedTask(TaskListPtr _list, TaskPtr _task, ListDataPtr rbuf, |
22 ListDataPtr wbuf, Scheduler* sc) | |
42 | 23 { |
109 | 24 __list = _list; |
25 __task = _task; | |
26 __inListData = rbuf; | |
27 __outListData = wbuf; | |
28 __readbuf = NULL; | |
29 __writebuf = NULL; | |
30 __scheduler = sc; | |
31 __taskGroup = NULL; | |
32 __renew_flag = 0; | |
33 | |
34 smanager = new STaskManager(this); | |
42 | 35 } |
36 | |
109 | 37 SchedTask::~SchedTask(void) |
38 { | |
39 if (__flag_renewTask) { | |
40 /** | |
41 * __inListData __outListData ϥȤΤΤʤΤ | |
42 * ä¨ free 롣 | |
43 */ | |
44 free(__inListData); | |
45 free(__outListData); | |
46 | |
47 /** | |
48 * __list != NULL ξ硢 | |
49 * Task __list κǸ Task ˤʤΤ (SchedTask::next ) | |
50 * Υߥ __list | |
51 * (free Ϥ륢ɥ쥹ΤȤʤ) | |
52 * ʳ Task Ǥʤ | |
53 * __list == NULL ʤΤǡfree ϤƤ̵ | |
54 */ | |
55 free(__list); | |
56 } | |
57 | |
58 delete smanager; | |
59 } | |
60 | |
61 void | |
62 SchedTask::__init__(void) | |
63 { | |
64 /** | |
65 * task->inData task->outData | |
66 * PPE ΤΤSPE ΤΤä | |
67 * ɥ쥹ȽǤгڤˤʤȻפ | |
68 */ | |
69 if (__flag_renewTask == 0) { | |
70 __scheduler->dma_load(__inListData, (uint32)__task->inData, | |
71 sizeof(ListData), DMA_READ_IN_LIST); | |
72 __scheduler->dma_load(__outListData, (uint32)__task->outData, | |
73 sizeof(ListData), DMA_READ_OUT_LIST); | |
74 | |
75 __taskGroup = new TaskGroup; | |
76 __taskGroup->command = __task->self; | |
180
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
77 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
78 ex_read = &SchedTask::ex_read_normal; |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
79 ex_exec = &SchedTask::ex_exec_normal; |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
80 ex_write = &SchedTask::ex_write_normal; |
109 | 81 } else { |
82 __inListData = __task->inData; | |
83 __outListData = __task->outData; | |
84 __taskGroup = (TaskGroupPtr)__task->self; | |
180
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
85 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
86 ex_read = &SchedTask::ex_read_renew; |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
87 ex_exec = &SchedTask::ex_exec_renew; |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
88 ex_write = &SchedTask::ex_write_renew; |
109 | 89 } |
90 } | |
91 | |
92 | |
93 /** | |
94 * [Todo] | |
95 * ǡɤ߹߾ readbuf ǤϤʤ | |
96 * 桼ȤǷ褦ˤʤȤ⤷ʤ | |
97 * | |
98 * # TaskManager ˾äȤʤ | |
99 * # 桼 SPE ˻³뤳ȤǤ뤿ᡣ | |
100 * # ϥ桼Ǥ櫓 | |
101 */ | |
42 | 102 void |
103 SchedTask::read(void) | |
104 { | |
105 __debug("[SchedTask:%s]\n", __FUNCTION__); | |
106 | |
109 | 107 // wait for load inListData |
108 __scheduler->dma_wait(DMA_READ_IN_LIST); | |
109 | |
110 // ɤǡĤʤ̵ | |
111 if (__inListData->length < 1 || __inListData->size == 0) return; | |
112 | |
113 // load Input Data | |
114 __readbuf = __scheduler->allocate(__inListData->size); | |
115 __scheduler->dma_loadList(__inListData, __readbuf, DMA_READ); | |
180
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
116 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
117 (this->*ex_read)(); |
42 | 118 } |
119 | |
120 void | |
121 SchedTask::exec(void) | |
122 { | |
123 __debug("[SchedTask:%s]\n", __FUNCTION__); | |
124 | |
109 | 125 // wait for load outListData |
126 __scheduler->dma_wait(DMA_READ_OUT_LIST); | |
127 __writebuf = __scheduler->allocate(__outListData->size); | |
42 | 128 |
109 | 129 __debug(" task->command = %d\n", __task->command); |
130 __debug(" task->in_size = %d\n", __task->in_size); | |
131 __debug(" task->in_addr = 0x%x\n", __task->in_addr); | |
132 __debug(" task->out_addr = 0x%x\n", __task->out_addr); | |
133 __debug(" list->next = 0x%x\n", (unsigned int)__list->next); | |
134 __debug(" list->length = 0x%x\n", (unsigned int)__list->length); | |
42 | 135 |
180
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
136 __scheduler->dma_wait(DMA_READ); |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
137 |
109 | 138 run(__readbuf, __writebuf); |
139 | |
180
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
140 free(__readbuf); |
42 | 141 |
109 | 142 if (__taskGroup->status() != 0) { |
143 __task->self = __taskGroup->command; | |
144 delete __taskGroup; | |
145 __taskGroup = NULL; | |
146 } | |
147 | |
180
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
148 // ΰ褬פʤ̵ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
149 if (__outListData->size > 0 || __outListData->length > 0) { |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
150 __scheduler->dma_storeList(__outListData, __writebuf, DMA_WRITE); |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
151 // SchedTask::write(void) Ǥ wait ݤƤɡ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
152 // ºݤˤϤ wait ʤȤȽޤƤʤ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
153 // wait ϤƤϤʤʡ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
154 __scheduler->dma_wait(DMA_WRITE); |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
155 } |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
156 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
157 (this->*ex_exec)(); |
42 | 158 } |
159 | |
160 void | |
161 SchedTask::write(void) | |
162 { | |
163 __debug("[SchedTask:%s]\n", __FUNCTION__); | |
164 | |
180
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
165 //__scheduler->dma_wait(DMA_WRITE); |
109 | 166 free(__writebuf); |
167 | |
168 /** | |
180
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
169 * ΥSPE줿 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
170 * ΥνλԤɬפϤʤȤ꤬Ƥ뤿ᡢ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
171 * (wait_task() ƤФƤʤ) |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
172 * ǽλ롣ex_write ϼ¹Ԥʤ |
109 | 173 */ |
174 if (__task->self == MY_SPE_NOP) return; | |
175 | |
180
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
176 (this->*ex_write)(); |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
177 } |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
178 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
179 /** |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
180 * PPE 줿 ex_read() |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
181 */ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
182 void |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
183 SchedTask::ex_read_normal(void) |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
184 { |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
185 } |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
186 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
187 /** |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
188 * SPE 줿 ex_read() |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
189 */ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
190 void |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
191 SchedTask::ex_read_renew(void) |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
192 { |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
193 } |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
194 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
195 /** |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
196 * PPE 줿 ex_exec() |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
197 */ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
198 void |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
199 SchedTask::ex_exec_normal(void) |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
200 { |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
201 } |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
202 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
203 /** |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
204 * SPE 줿 ex_exec() |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
205 */ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
206 void |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
207 SchedTask::ex_exec_renew(void) |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
208 { |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
209 } |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
210 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
211 |
109 | 212 |
180
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
213 /** |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
214 * PPE 줿 ex_write() |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
215 * |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
216 * Υǿ˥졢 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
217 * ĤΥνλԤɬפ硢 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
218 * PPE ˽λȤΤ餻ʤ(command ʤ) |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
219 */ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
220 void |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
221 SchedTask::ex_write_normal(void) |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
222 { |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
223 /** |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
224 * Υǿ˥ʤä |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
225 * or 줿ΥνλԤɬפ̵ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
226 */ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
227 if (__renew_flag == 0) { |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
228 __scheduler->mail_write(__task->self); |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
229 } |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
230 } |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
231 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
232 /** |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
233 * SPE 줿 ex_write() |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
234 * |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
235 * A <- ƥ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
236 * | \ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
237 * B C <- SPE 줿 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
238 * |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
239 * A SPE B, C Ȥ롣 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
240 * B C λ顢A PPE Ϥäޥɤ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
241 * ҥ˰ѤƤΤǡǸ˼¹Ԥ줿ҥ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
242 * PPE mail 롣 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
243 */ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
244 void |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
245 SchedTask::ex_write_renew(void) |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
246 { |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
247 uint32 cmd; |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
248 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
249 __taskGroup->remove(__task); |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
250 cmd = __taskGroup->status(); |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
251 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
252 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
253 // Ǻ줿ƤΥλ |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
254 if (cmd != 0) { |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
255 delete __taskGroup; |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
256 __scheduler->mail_write(cmd); |
109 | 257 } |
42 | 258 } |
109 | 259 |
42 | 260 SchedTaskBase* |
261 SchedTask::next(Scheduler *m, SchedTaskBase *p) | |
262 { | |
263 __debug("[SchedTask:%s]\n", __FUNCTION__); | |
264 | |
265 delete p; | |
109 | 266 |
267 if (__scheduler->curIndex_taskList < __list->length) { | |
268 SchedTask* schedTask = CreateSchedTask(__list, __scheduler); | |
269 schedTask->__flag_renewTask = this->__flag_renewTask; | |
270 schedTask->__init__(); | |
271 | |
272 /** | |
273 * ͳ SchedTask:~SchedTask() | |
274 */ | |
275 __list = NULL; | |
276 | |
277 return schedTask; | |
278 } else { | |
279 uint32 nextList = (uint32)__list->next; | |
280 | |
281 if (nextList == 0) { | |
282 return new SchedNop2Ready(__scheduler); | |
42 | 283 } else { |
109 | 284 return new SchedTaskList(nextList, __scheduler); |
42 | 285 } |
109 | 286 } |
287 } | |
42 | 288 |
109 | 289 /** |
290 * task->add_input Ϳ줿֤б index (0n-1) ǡ | |
291 * buffer бǡ֤ | |
292 */ | |
293 void* | |
294 SchedTask::get_input(void *buff, int index) | |
295 { | |
296 if (buff != NULL) { | |
297 return (void*)((int)buff + __inListData->bound[index]); | |
298 } else { | |
299 return NULL; | |
300 } | |
301 } | |
302 | |
303 /** | |
304 * write buffer ΰ֤ | |
305 */ | |
306 void* | |
307 SchedTask::get_output(void *buff, int index) | |
308 { | |
309 if (buff != NULL) { | |
310 return (void*)((int)buff + __outListData->bound[index]); | |
311 } else { | |
312 return NULL; | |
42 | 313 } |
314 } | |
315 | |
109 | 316 int |
317 SchedTask::get_param(int index) | |
318 { | |
319 return __task->param[index]; | |
320 } | |
321 | |
322 TaskPtr | |
323 SchedTask::create_task(int cmd) | |
324 { | |
325 TaskListPtr taskList = __scheduler->get_renewListBuf(); | |
326 TaskPtr p = &taskList->tasks[taskList->length++]; | |
327 p->command = cmd; | |
328 | |
329 p->inData = (ListData*)__scheduler->allocate(sizeof(ListData)); | |
330 p->outData = (ListData*)__scheduler->allocate(sizeof(ListData)); | |
331 | |
332 p->inData->clear(); | |
333 p->outData->clear(); | |
334 | |
335 p->self = MY_SPE_NOP; | |
336 p->param_size = 0; | |
337 | |
338 return p; | |
339 } | |
340 | |
341 /** | |
180
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
342 * λƤ顢ᥤ塼(PPE) |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
343 * λݤΤ餻롣 |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
344 * |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
345 * @param[in] waitTask |
109 | 346 */ |
347 void | |
348 SchedTask::wait_task(TaskPtr waitTask) | |
42 | 349 { |
109 | 350 waitTask->self = (uint32)__taskGroup; |
351 | |
352 __scheduler->add_groupTask(__taskGroup, waitTask); | |
353 | |
354 __renew_flag++; | |
355 } | |
356 | |
357 void* | |
358 SchedTask::global_alloc(int id, int size) { | |
359 return __scheduler->global_alloc(id, size); | |
360 } | |
361 | |
362 void* | |
363 SchedTask::global_get(int id) { | |
364 return __scheduler->global_get(id); | |
365 } | |
366 | |
367 void | |
368 SchedTask::global_free(int id) { | |
369 __scheduler->global_free(id); | |
370 } | |
371 | |
372 void | |
373 SchedTask::mainMem_alloc(int id, int size) { | |
374 __scheduler->mainMem_alloc(id, size); | |
375 } | |
42 | 376 |
109 | 377 void |
378 SchedTask::mainMem_wait(void) { | |
379 __scheduler->mainMem_wait(); | |
380 } | |
381 | |
382 void* | |
383 SchedTask::mainMem_get(int id) { | |
384 return __scheduler->mainMem_get(id); | |
385 } | |
386 | |
387 void* | |
388 SchedTask::allocate(int size) { | |
389 return __scheduler->allocate(size); | |
42 | 390 } |
109 | 391 |
392 void | |
393 SchedTask::dma_load(void *buf, uint32 addr, uint32 size, uint32 mask) { | |
394 __scheduler->dma_load(buf, addr, size, mask); | |
395 } | |
396 | |
397 void | |
398 SchedTask::dma_store(void *buf,uint32 addr, uint32 size, uint32 mask) { | |
399 __scheduler->dma_store(buf, addr, size, mask); | |
400 } | |
401 | |
402 void | |
403 SchedTask::dma_wait(uint32 mask) { | |
404 __scheduler->dma_wait(mask); | |
405 } |