Mercurial > hg > Game > Cerium
annotate TaskManager/Fifo/FifoDmaManager.cc @ 1417:70f461442b0f draft
null DMA clean up
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 19 Feb 2012 21:01:06 +0900 |
parents | 88d1b95e5f8d |
children | bde20cca45ae |
rev | line source |
---|---|
109 | 1 #include <stdio.h> |
2 #include <stdlib.h> | |
3 #include <string.h> | |
4 #include "FifoDmaManager.h" | |
1213
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
5 #include "Scheduler.h" |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
6 #include "TaskManagerImpl.h" |
1400 | 7 #include "gettime.h" |
109 | 8 |
1213
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
9 void * |
1417 | 10 FifoDmaManager::dma_load(Scheduler *s, memaddr addr, uint32 size, uint32 mask) |
11 { | |
12 void *buf = 0; | |
13 if (size == 0) return buf; | |
14 | |
15 unsigned long long wait = 0; | |
16 (this->*start_dmawait_profile)(); | |
17 | |
18 buf = s->manager->allocate(size); | |
19 memcpy(buf, (void*)addr, size); | |
20 | |
21 (this->*end_dmawait_profile)(&wait); | |
22 global_load_time += wait; | |
23 dma_load_time += wait; | |
24 | |
25 return buf; | |
26 } | |
27 | |
28 void * | |
29 FifoDmaManager::dma_load1(void *buf, memaddr addr, uint32 size, uint32 mask) | |
109 | 30 { |
1213
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
31 if (size == 0) return buf; |
1309 | 32 |
1417 | 33 unsigned long long wait = 0; |
34 (this->*start_dmawait_profile)(); | |
1309 | 35 |
109 | 36 memcpy(buf, (void*)addr, size); |
1309 | 37 |
1417 | 38 (this->*end_dmawait_profile)(&wait); |
39 global_load_time += wait; | |
40 dma_load_time += wait; | |
1213
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
41 return buf; |
109 | 42 } |
43 | |
1417 | 44 |
1213
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
45 void * |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
46 FifoDmaManager::get_writebuf(Scheduler *s,memaddr addr, uint32 size) |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
47 { |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
48 void *b = s->manager->allocate(size); |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
49 return b; |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
50 } |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
51 |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
52 void * |
603
57ec231bc8ac
long -> memaddr (64 or 32)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
602
diff
changeset
|
53 FifoDmaManager::dma_store(void *buf, memaddr addr, uint32 size, uint32 mask) |
109 | 54 { |
1213
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
55 if (size == 0) return buf; |
1309 | 56 |
1417 | 57 unsigned long long wait = 0; |
58 (this->*start_dmawait_profile)(); | |
1309 | 59 |
1417 | 60 memcpy((void*)addr, buf, size); |
1309 | 61 |
1417 | 62 (this->*end_dmawait_profile)(&wait); |
63 global_store_time += wait; | |
64 dma_store_time += wait; | |
1309 | 65 |
1213
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
66 return buf; |
109 | 67 } |
68 | |
69 /** | |
321 | 70 * mask で設定した DMA 転送の完了を待つ |
109 | 71 */ |
72 void | |
73 FifoDmaManager::dma_wait(uint32 mask) | |
74 { | |
75 } | |
76 | |
77 | |
1213
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
78 void * |
1417 | 79 FifoDmaManager::dma_loadList(Scheduler *s, ListDataPtr list, uint32 mask) |
109 | 80 { |
1417 | 81 unsigned long long wait = 0; |
82 (this->*start_dmawait_profile)(); | |
1309 | 83 |
109 | 84 int list_size = list->length; |
602
92b0d490e839
64bit mode try... not worked.
e075740@nw0740.st.ie.u-ryukyu.ac.jp
parents:
321
diff
changeset
|
85 long bound; |
109 | 86 |
1417 | 87 void *buff = s->manager->allocate(list->size); |
602
92b0d490e839
64bit mode try... not worked.
e075740@nw0740.st.ie.u-ryukyu.ac.jp
parents:
321
diff
changeset
|
88 bound = (long)(buff); |
109 | 89 |
90 for (int i = 0; i < list_size; i++) { | |
1401 | 91 ListElementPtr elm = &list->element[i]; |
92 memcpy((void*)bound, (void*)elm->addr, elm->size); | |
93 bound += elm->size; | |
109 | 94 } |
1309 | 95 |
1417 | 96 (this->*end_dmawait_profile)(&wait); |
97 global_load_time += wait; | |
98 dma_loadList_time += wait; | |
1309 | 99 |
1213
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
100 return buff; |
109 | 101 } |
102 | |
103 void | |
104 FifoDmaManager::dma_storeList(ListDataPtr list, void *buff, uint32 mask) | |
105 { | |
1417 | 106 unsigned long long wait = 0; |
107 (this->*start_dmawait_profile)(); | |
1309 | 108 |
109 | 109 int list_size = list->length; |
603
57ec231bc8ac
long -> memaddr (64 or 32)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
602
diff
changeset
|
110 memaddr bound; |
109 | 111 |
603
57ec231bc8ac
long -> memaddr (64 or 32)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
602
diff
changeset
|
112 bound = (memaddr)(buff); |
109 | 113 |
114 for (int i = 0; i < list_size; i++) { | |
1401 | 115 ListElementPtr elm = &list->element[i]; |
116 memcpy((void*)elm->addr, (void*)bound, elm->size); | |
117 bound += elm->size; | |
1111 | 118 } |
1309 | 119 |
1417 | 120 (this->*end_dmawait_profile)(&wait); |
121 global_store_time += wait; | |
122 dma_storeList_time += wait; | |
1309 | 123 } |
124 | |
125 void | |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
126 FifoDmaManager::mail_write(memaddr data) |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
127 { |
1417 | 128 unsigned long long wait = 0; |
129 (this->*start_dmawait_profile)(); | |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
130 |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
131 mail_queue1->send(data); |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
132 |
1417 | 133 (this->*end_dmawait_profile)(&wait); |
134 global_mail_time += wait; | |
135 mail_write_time += wait; | |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
136 } |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
137 |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
138 void |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
139 FifoDmaManager::mail_write_finish_list(memaddr data) |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
140 { |
1417 | 141 unsigned long long wait = 0; |
142 (this->*start_dmawait_profile)(); | |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
143 |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
144 mail_queue1->send(data); |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
145 |
1417 | 146 (this->*end_dmawait_profile)(&wait); |
147 global_mail_time += wait; | |
148 mail_write_time += wait; | |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
149 } |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
150 |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
151 memaddr |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
152 FifoDmaManager::mail_read() |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
153 { |
1417 | 154 unsigned long long wait = 0; |
155 (this->*start_dmawait_profile)(); | |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
156 |
1417 | 157 memaddr data; |
158 data = mail_queue2->recv(); | |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
159 |
1417 | 160 (this->*end_dmawait_profile)(&wait); |
161 global_mail_time += wait; | |
162 mail_read_time += wait; | |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
163 |
1417 | 164 return data; |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
165 } |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
166 |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
167 memaddr |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
168 FifoDmaManager::task_list_mail_read() |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
169 { |
1417 | 170 unsigned long long wait = 0; |
171 (this->*start_dmawait_profile)(); | |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
172 |
1417 | 173 memaddr data; |
174 data = mail_queue2->recv(); | |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
175 |
1417 | 176 (this->*end_dmawait_profile)(&wait); |
177 global_mail_time += wait; | |
178 mail_read_time += wait; | |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
179 |
1417 | 180 return data; |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
181 } |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
182 |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
183 void |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
184 FifoDmaManager::mail_write_from_host(memaddr data) |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
185 { |
1417 | 186 unsigned long long wait = 0; |
187 (this->*start_dmawait_profile)(); | |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
188 |
1417 | 189 mail_queue2->send(data); |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
190 |
1417 | 191 (this->*end_dmawait_profile)(&wait); |
192 global_mail_time += wait; | |
193 mail_write_from_host_time += wait; | |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
194 } |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
195 |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
196 memaddr |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
197 FifoDmaManager::mail_read_from_host() |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
198 { |
1417 | 199 unsigned long long wait = 0; |
200 (this->*start_dmawait_profile)(); | |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
201 |
1417 | 202 memaddr data; |
203 data = mail_queue1->recv(); | |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
204 |
1417 | 205 (this->*end_dmawait_profile)(&wait); |
206 global_mail_time += wait; | |
207 mail_read_from_host_time += wait; | |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
208 |
1417 | 209 return data; |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
210 } |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
211 |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
212 int |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
213 FifoDmaManager::has_mail_from_host() |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
214 { |
1401 | 215 return mail_queue1->count(); |
1371
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
216 } |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
217 |
66ae94572433
add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1369
diff
changeset
|
218 void |
1309 | 219 FifoDmaManager::start_profile() |
220 { | |
1417 | 221 global_busy_time = 0; |
222 global_load_time = 0; | |
223 global_store_time = 0; | |
224 global_mail_time = 0; | |
225 dma_load_time = 0; | |
226 dma_store_time = 0; | |
227 dma_loadList_time = 0; | |
228 dma_storeList_time = 0; | |
229 mail_read_time = 0; | |
230 mail_write_time = 0; | |
231 mail_read_from_host_time = 0; | |
232 mail_write_from_host_time = 0; | |
1309 | 233 |
1417 | 234 start_dmawait_profile = &FifoDmaManager::do_start_dmawait_profile; |
235 end_dmawait_profile = &FifoDmaManager::do_end_dmawait_profile; | |
1309 | 236 |
1417 | 237 stop_time = gettime(); |
1309 | 238 } |
239 | |
240 void | |
241 FifoDmaManager::stop_profile() | |
242 { | |
1417 | 243 start_time = gettime(); |
244 global_busy_time += start_time - stop_time; | |
1309 | 245 |
1417 | 246 start_dmawait_profile = &FifoDmaManager::null_start_dmawait_profile; |
247 end_dmawait_profile = &FifoDmaManager::null_end_dmawait_profile; | |
1309 | 248 } |
249 | |
250 void | |
251 FifoDmaManager::do_start_dmawait_profile() | |
252 { | |
1417 | 253 start_time = gettime(); |
254 global_busy_time += start_time - stop_time; | |
1309 | 255 } |
256 | |
257 void | |
258 FifoDmaManager::do_end_dmawait_profile(unsigned long long *counter) | |
259 { | |
1417 | 260 stop_time = gettime(); |
261 *counter += stop_time - start_time; | |
1309 | 262 } |
263 | |
264 void FifoDmaManager::null_start_dmawait_profile() {} | |
265 void FifoDmaManager::null_end_dmawait_profile(unsigned long long *counter) {} | |
266 | |
267 void | |
268 FifoDmaManager::show_dma_wait(Scheduler *s, int cpu) | |
269 { | |
1417 | 270 unsigned long long all_time = global_busy_time + global_load_time + |
271 global_store_time + global_mail_time; | |
1309 | 272 |
1417 | 273 double busy = ((double)global_busy_time)/((double)all_time)*100.0; |
274 double load = ((double)global_load_time)/((double)all_time)*100.0; | |
275 double store = ((double)global_store_time)/((double)all_time)*100.0; | |
276 double mail = ((double)global_mail_time)/((double)all_time)*100.0; | |
277 double read = ((double)mail_read_time)/((double)all_time)*100.0; | |
278 double write = ((double)mail_write_time)/((double)all_time)*100.0; | |
279 double read_from_host = ((double)mail_read_from_host_time)/((double)all_time)*100.0; | |
280 double write_from_host = ((double)mail_write_from_host_time)/((double)all_time)*100.0; | |
1309 | 281 |
282 | |
1417 | 283 s->printf("cpu%d:\n busy_time = %lld(%.3g%%)\n" |
284 " load_time = %lld(%.3g%%), " | |
285 " store_time = %lld(%.3g%%), " | |
286 " mail_time = %lld(%.3g%%) \n" | |
287 " mail_read_time = %lld(%.3g%%), " | |
288 " mail_write_time = %lld(%.3g%%)\n" | |
289 " mail_read_from_host_time = %lld(%.3g%%), " | |
290 " mail_write_from_host_time = %lld(%.3g%%)\n" | |
291 ,cpu, global_busy_time, busy, | |
292 global_load_time, load, | |
293 global_store_time, store, | |
294 global_mail_time, mail, | |
295 mail_read_time, read, | |
296 mail_write_time, write, | |
297 mail_read_from_host_time, read_from_host, | |
298 mail_write_from_host_time, write_from_host); | |
1309 | 299 |
1417 | 300 global_busy_time = 0; |
301 global_load_time = 0; | |
302 global_store_time = 0; | |
303 global_mail_time = 0; | |
304 dma_load_time = 0; | |
305 dma_store_time = 0; | |
306 dma_loadList_time = 0; | |
307 dma_storeList_time = 0; | |
308 mail_read_time = 0; | |
309 mail_write_time = 0; | |
310 mail_read_from_host_time = 0; | |
311 mail_write_from_host_time = 0; | |
109 | 312 } |
643 | 313 |
1213
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
314 uint32 |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
315 FifoDmaManager::get_tag() |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
316 { |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
317 static int tag = 16; |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
318 tag ++; |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
319 tag &= 0x0f; |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
320 return tag+16; |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
321 } |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
322 |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
323 /** |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
324 * DMA buffer offset in rbuf |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
325 */ |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
326 void |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
327 FifoDmaManager::bound(ListData *list) |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
328 { |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
329 ListElement *elm = list->element; |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
330 int *bound = list->bound; |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
331 int offset=0; |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
332 for(int i=0;i<list->length;i++) { |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
333 bound[i] = offset; |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
334 offset += elm[i].size; |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
335 } |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
336 } |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1111
diff
changeset
|
337 |
643 | 338 /* end */ |