Mercurial > hg > Game > Cerium
annotate include/TaskManager/SchedTask.h @ 182:8e9ada0c1ed0 draft
add get_inputAddr, get_outputAddr
author | gongo@gendarme.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Tue, 23 Dec 2008 16:27:07 +0900 |
parents | e3b7776b1420 |
children | a19d3ed4ce5b |
rev | line source |
---|---|
42 | 1 #ifndef INCLUDED_SCHED_TASK |
2 #define INCLUDED_SCHED_TASK | |
3 | |
109 | 4 #ifndef INCLUDED_BASE_H_ |
5 # include "base.h" | |
6 #endif | |
7 | |
42 | 8 #ifndef INCLUDED_SCHEDULER |
9 # include "Scheduler.h" | |
10 #endif | |
11 | |
12 #ifndef INCLUDED_SCHED_TASK_BASE | |
13 # include "SchedTaskBase.h" | |
14 #endif | |
15 | |
109 | 16 #ifndef INCLUDED_LIST_DATA |
17 # include "ListData.h" | |
18 #endif | |
19 | |
20 #ifndef INCLUDED_TASK_GROUP | |
21 # include "TaskGroup.h" | |
22 #endif | |
23 | |
24 | |
42 | 25 class SchedTask : public SchedTaskBase { |
26 public: | |
109 | 27 /* constructor */ |
28 SchedTask(TaskListPtr, TaskPtr, ListDataPtr, ListDataPtr, Scheduler*); | |
29 ~SchedTask(void); | |
88 | 30 |
109 | 31 BASE_NEW_DELETE(SchedTask); |
42 | 32 |
33 /* variables */ | |
180
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
34 |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
35 // Task ¹Ԥ륹塼鼫 |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
36 Scheduler *__scheduler; |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
37 |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
38 // ߥ塼餬¹ԤƤ TaskList ȡΥб Task |
109 | 39 TaskListPtr __list; |
40 TaskPtr __task; | |
41 | |
42 // read/write Ѥ ListData | |
43 ListDataPtr __inListData; | |
44 ListDataPtr __outListData; | |
42 | 45 |
180
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
46 /** |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
47 * read ǡwrite ѤΥХåե |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
48 * readbuf ˤ ϿꤷϥǡäƤ롣 |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
49 * writebuf ˥ǡǤȡ |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
50 * Ͽꤷ˽ |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
51 */ |
109 | 52 void *__readbuf; |
53 void *__writebuf; | |
54 | |
180
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
55 // 줿Υ롼 |
109 | 56 TaskGroup *__taskGroup; |
57 | |
180
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
58 // Υ줿ο |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
59 int __renew_flag; |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
60 |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
61 // Υ SPE 줿ݤ 1: Yes, 0: No |
109 | 62 int __flag_renewTask; |
42 | 63 |
180
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
64 // ᥤ¦줿Τ |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
65 // SPE 줿ΤˤäơǡΰѤäƤ롣 |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
66 // Τ if (__flag_renewTask) ϢȯΤϤ褯ʤΤ |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
67 // ؿݥǻäƤ |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
68 void (SchedTask::*ex_read)(void); |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
69 void (SchedTask::*ex_exec)(void); |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
70 void (SchedTask::*ex_write)(void); |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
71 |
42 | 72 /* functions */ |
109 | 73 void __init__(void); |
74 | |
42 | 75 // override |
76 void read(void); | |
77 void exec(void); | |
78 void write(void); | |
180
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
79 SchedTaskBase* next(Scheduler *, SchedTaskBase *); |
82 | 80 |
109 | 81 // 桼Ѿ |
82 // 줾ΥбҤ | |
82 | 83 virtual int run(void* r, void *w) { return 0; } |
109 | 84 |
180
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
85 /** |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
86 * PPE 줿Ф롢read,exec,write °(?) |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
87 */ |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
88 void ex_read_normal(void); |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
89 void ex_exec_normal(void); |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
90 void ex_write_normal(void); |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
91 |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
92 /** |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
93 * SPE 줿Ф롢read,exec,write °(?) |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
94 */ |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
95 void ex_read_renew(void); |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
96 void ex_exec_renew(void); |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
97 void ex_write_renew(void); |
e3b7776b1420
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
109
diff
changeset
|
98 |
109 | 99 void* get_input(void *buff, int index); |
100 void* get_output(void *buff, int index); | |
182
8e9ada0c1ed0
add get_inputAddr, get_outputAddr
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
180
diff
changeset
|
101 uint32 get_inputAddr(int index); |
8e9ada0c1ed0
add get_inputAddr, get_outputAddr
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
180
diff
changeset
|
102 uint32 get_outputAddr(int index); |
109 | 103 int get_param(int index); |
104 | |
105 TaskPtr create_task(int cmd); | |
106 void wait_task(TaskPtr waitTask); | |
107 | |
108 void* global_alloc(int id, int size); | |
109 void* global_get(int id); | |
110 void global_free(int id); | |
111 | |
112 void mainMem_alloc(int id, int size); | |
113 void mainMem_wait(void); | |
114 void* mainMem_get(int id); | |
115 | |
116 void *allocate(int size); | |
117 | |
118 void dma_load(void *buf, uint32 addr, uint32 size, uint32 mask); | |
119 void dma_store(void *buf,uint32 addr, uint32 size, uint32 mask); | |
120 void dma_wait(uint32 mask); | |
121 | |
122 class STaskManager { | |
123 public: | |
124 STaskManager(SchedTask *_t) { | |
125 outer = _t; | |
126 } | |
127 | |
128 BASE_NEW_DELETE(STaskManager); | |
129 | |
130 SchedTask *outer; | |
131 | |
132 void* get_input(int index) { | |
133 return outer->get_input(outer->__readbuf, index); | |
134 } | |
135 | |
136 void* get_output(int index) { | |
137 return outer->get_output(outer->__writebuf, index); | |
138 } | |
139 | |
182
8e9ada0c1ed0
add get_inputAddr, get_outputAddr
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
180
diff
changeset
|
140 uint32 get_inputAddr(int index) { |
8e9ada0c1ed0
add get_inputAddr, get_outputAddr
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
180
diff
changeset
|
141 return outer->get_inputAddr(index); |
8e9ada0c1ed0
add get_inputAddr, get_outputAddr
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
180
diff
changeset
|
142 } |
8e9ada0c1ed0
add get_inputAddr, get_outputAddr
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
180
diff
changeset
|
143 |
8e9ada0c1ed0
add get_inputAddr, get_outputAddr
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
180
diff
changeset
|
144 uint32 get_outputAddr(int index) { |
8e9ada0c1ed0
add get_inputAddr, get_outputAddr
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
180
diff
changeset
|
145 return outer->get_outputAddr(index); |
8e9ada0c1ed0
add get_inputAddr, get_outputAddr
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
180
diff
changeset
|
146 } |
8e9ada0c1ed0
add get_inputAddr, get_outputAddr
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
180
diff
changeset
|
147 |
109 | 148 int get_param(int index) { |
149 return outer->get_param(index); | |
150 } | |
151 | |
152 TaskPtr create_task(int cmd) { | |
153 return outer->create_task(cmd); | |
154 } | |
155 | |
156 void wait_task(TaskPtr waitTask) { | |
157 outer->wait_task(waitTask); | |
158 } | |
159 | |
160 void* global_alloc(int id, int size) { | |
161 return outer->global_alloc(id, size); | |
162 } | |
163 | |
164 void* global_get(int id) { | |
165 return outer->global_get(id); | |
166 } | |
167 | |
168 void global_free(int id) { | |
169 outer->global_free(id); | |
170 } | |
171 | |
172 void mainMem_alloc(int id, int size) { | |
173 outer->mainMem_alloc(id, size); | |
174 } | |
175 | |
176 void mainMem_wait(void) { | |
177 outer->mainMem_wait(); | |
178 } | |
179 | |
180 void* mainMem_get(int id) { | |
181 return outer->mainMem_get(id); | |
182 } | |
183 | |
184 void *allocate(int size) { | |
185 return outer->allocate(size); | |
186 } | |
187 | |
188 void dma_load(void *buf, uint32 addr, uint32 size, uint32 mask) { | |
189 outer->dma_load(buf, addr, size, mask); | |
190 } | |
191 | |
192 void dma_store(void *buf,uint32 addr, uint32 size, uint32 mask) { | |
193 outer->dma_store(buf, addr, size, mask); | |
194 } | |
195 | |
196 void dma_wait(uint32 mask) { | |
197 outer->dma_wait(mask); | |
198 } | |
199 }; | |
200 | |
201 STaskManager *smanager; | |
42 | 202 }; |
203 | |
204 #endif | |
109 | 205 |
206 extern SchedTask* CreateSchedTask(TaskListPtr, Scheduler *); |