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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #include <stdio.h>
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #include <stdlib.h>
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3 #include <string.h>
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
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
3152bb4429da add gettime
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1371
diff changeset
7 #include "gettime.h"
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
9 void *
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
10 FifoDmaManager::dma_load(Scheduler *s, memaddr addr, uint32 size, uint32 mask)
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
11 {
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
12 void *buf = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
13 if (size == 0) return buf;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
14
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
15 unsigned long long wait = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
16 (this->*start_dmawait_profile)();
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
17
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
18 buf = s->manager->allocate(size);
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
19 memcpy(buf, (void*)addr, size);
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
20
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
21 (this->*end_dmawait_profile)(&wait);
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
22 global_load_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
23 dma_load_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
24
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
25 return buf;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
26 }
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
27
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
28 void *
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
29 FifoDmaManager::dma_load1(void *buf, memaddr addr, uint32 size, uint32 mask)
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
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
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
32
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
33 unsigned long long wait = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
34 (this->*start_dmawait_profile)();
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
35
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
36 memcpy(buf, (void*)addr, size);
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
37
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
38 (this->*end_dmawait_profile)(&wait);
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
39 global_load_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
42 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
43
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
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
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
56
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
57 unsigned long long wait = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
58 (this->*start_dmawait_profile)();
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
59
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
60 memcpy((void*)addr, buf, size);
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
61
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
62 (this->*end_dmawait_profile)(&wait);
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
63 global_store_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
64 dma_store_time += wait;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
65
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
66 return buf;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
67 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
68
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
69 /**
321
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
70 * mask で設定した DMA 転送の完了を待つ
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
71 */
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
72 void
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
73 FifoDmaManager::dma_wait(uint32 mask)
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
74 {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
75 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
76
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
77
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
78 void *
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
79 FifoDmaManager::dma_loadList(Scheduler *s, ListDataPtr list, uint32 mask)
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
80 {
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
81 unsigned long long wait = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
82 (this->*start_dmawait_profile)();
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
83
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
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
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
86
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
89
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
90 for (int i = 0; i < list_size; i++) {
1401
2187bd10f16d remove mail_write_queue
sugi
parents: 1400
diff changeset
91 ListElementPtr elm = &list->element[i];
2187bd10f16d remove mail_write_queue
sugi
parents: 1400
diff changeset
92 memcpy((void*)bound, (void*)elm->addr, elm->size);
2187bd10f16d remove mail_write_queue
sugi
parents: 1400
diff changeset
93 bound += elm->size;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
94 }
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
95
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
96 (this->*end_dmawait_profile)(&wait);
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
97 global_load_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
98 dma_loadList_time += wait;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
99
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
100 return buff;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
101 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
102
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
103 void
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
104 FifoDmaManager::dma_storeList(ListDataPtr list, void *buff, uint32 mask)
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
105 {
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
106 unsigned long long wait = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
107 (this->*start_dmawait_profile)();
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
108
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
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
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
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
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
113
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
114 for (int i = 0; i < list_size; i++) {
1401
2187bd10f16d remove mail_write_queue
sugi
parents: 1400
diff changeset
115 ListElementPtr elm = &list->element[i];
2187bd10f16d remove mail_write_queue
sugi
parents: 1400
diff changeset
116 memcpy((void*)elm->addr, (void*)bound, elm->size);
2187bd10f16d remove mail_write_queue
sugi
parents: 1400
diff changeset
117 bound += elm->size;
1111
c9d0683c9b39 add non screen mode.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 647
diff changeset
118 }
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
119
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
120 (this->*end_dmawait_profile)(&wait);
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
121 global_store_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
122 dma_storeList_time += wait;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
123 }
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
124
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
128 unsigned long long wait = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
133 (this->*end_dmawait_profile)(&wait);
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
134 global_mail_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
141 unsigned long long wait = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
146 (this->*end_dmawait_profile)(&wait);
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
147 global_mail_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
154 unsigned long long wait = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
157 memaddr data;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
160 (this->*end_dmawait_profile)(&wait);
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
161 global_mail_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
170 unsigned long long wait = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
173 memaddr data;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
176 (this->*end_dmawait_profile)(&wait);
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
177 global_mail_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
186 unsigned long long wait = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
191 (this->*end_dmawait_profile)(&wait);
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
192 global_mail_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
199 unsigned long long wait = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
202 memaddr data;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
205 (this->*end_dmawait_profile)(&wait);
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
206 global_mail_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
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
2187bd10f16d remove mail_write_queue
sugi
parents: 1400
diff changeset
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
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
219 FifoDmaManager::start_profile()
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
220 {
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
221 global_busy_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
222 global_load_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
223 global_store_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
224 global_mail_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
225 dma_load_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
226 dma_store_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
227 dma_loadList_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
228 dma_storeList_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
229 mail_read_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
230 mail_write_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
231 mail_read_from_host_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
232 mail_write_from_host_time = 0;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
233
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
234 start_dmawait_profile = &FifoDmaManager::do_start_dmawait_profile;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
235 end_dmawait_profile = &FifoDmaManager::do_end_dmawait_profile;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
236
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
237 stop_time = gettime();
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
238 }
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
239
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
240 void
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
241 FifoDmaManager::stop_profile()
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
242 {
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
243 start_time = gettime();
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
244 global_busy_time += start_time - stop_time;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
245
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
246 start_dmawait_profile = &FifoDmaManager::null_start_dmawait_profile;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
247 end_dmawait_profile = &FifoDmaManager::null_end_dmawait_profile;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
248 }
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
249
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
250 void
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
251 FifoDmaManager::do_start_dmawait_profile()
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
252 {
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
253 start_time = gettime();
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
254 global_busy_time += start_time - stop_time;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
255 }
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
256
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
257 void
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
258 FifoDmaManager::do_end_dmawait_profile(unsigned long long *counter)
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
259 {
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
260 stop_time = gettime();
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
261 *counter += stop_time - start_time;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
262 }
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
263
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
264 void FifoDmaManager::null_start_dmawait_profile() {}
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
265 void FifoDmaManager::null_end_dmawait_profile(unsigned long long *counter) {}
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
266
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
267 void
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
268 FifoDmaManager::show_dma_wait(Scheduler *s, int cpu)
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
269 {
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
270 unsigned long long all_time = global_busy_time + global_load_time +
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
271 global_store_time + global_mail_time;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
272
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
273 double busy = ((double)global_busy_time)/((double)all_time)*100.0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
274 double load = ((double)global_load_time)/((double)all_time)*100.0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
275 double store = ((double)global_store_time)/((double)all_time)*100.0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
276 double mail = ((double)global_mail_time)/((double)all_time)*100.0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
277 double read = ((double)mail_read_time)/((double)all_time)*100.0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
278 double write = ((double)mail_write_time)/((double)all_time)*100.0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
279 double read_from_host = ((double)mail_read_from_host_time)/((double)all_time)*100.0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
280 double write_from_host = ((double)mail_write_from_host_time)/((double)all_time)*100.0;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
281
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
282
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
283 s->printf("cpu%d:\n busy_time = %lld(%.3g%%)\n"
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
284 " load_time = %lld(%.3g%%), "
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
285 " store_time = %lld(%.3g%%), "
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
286 " mail_time = %lld(%.3g%%) \n"
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
287 " mail_read_time = %lld(%.3g%%), "
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
288 " mail_write_time = %lld(%.3g%%)\n"
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
289 " mail_read_from_host_time = %lld(%.3g%%), "
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
290 " mail_write_from_host_time = %lld(%.3g%%)\n"
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
291 ,cpu, global_busy_time, busy,
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
292 global_load_time, load,
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
293 global_store_time, store,
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
294 global_mail_time, mail,
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
295 mail_read_time, read,
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
296 mail_write_time, write,
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
297 mail_read_from_host_time, read_from_host,
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
298 mail_write_from_host_time, write_from_host);
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
299
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
300 global_busy_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
301 global_load_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
302 global_store_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
303 global_mail_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
304 dma_load_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
305 dma_store_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
306 dma_loadList_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
307 dma_storeList_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
308 mail_read_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
309 mail_write_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
310 mail_read_from_host_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
311 mail_write_from_host_time = 0;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
312 }
643
2a611e8d8788 minor fix.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 640
diff changeset
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
2a611e8d8788 minor fix.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 640
diff changeset
338 /* end */