1 | # 1 "consumer.c" |
---|
2 | # 1 "<built-in>" |
---|
3 | # 1 "<command-line>" |
---|
4 | # 1 "consumer.c" |
---|
5 | # 1 "consumer_proto.h" 1 |
---|
6 | # 18 "consumer_proto.h" |
---|
7 | # 1 "numsplit_common.h" 1 |
---|
8 | |
---|
9 | |
---|
10 | |
---|
11 | |
---|
12 | |
---|
13 | |
---|
14 | # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" 1 |
---|
15 | # 10 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" |
---|
16 | # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_public_types.h" 1 |
---|
17 | # 10 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_public_types.h" |
---|
18 | typedef unsigned long uint_t; |
---|
19 | typedef signed long sint_t; |
---|
20 | |
---|
21 | typedef unsigned char uint8_t; |
---|
22 | typedef signed char sint8_t; |
---|
23 | typedef signed short int int8_t; |
---|
24 | |
---|
25 | typedef unsigned short int uint16_t; |
---|
26 | typedef signed short int sint16_t; |
---|
27 | typedef signed short int int16_t; |
---|
28 | |
---|
29 | typedef unsigned int uint32_t; |
---|
30 | typedef signed int sint32_t; |
---|
31 | typedef signed int int32_t; |
---|
32 | |
---|
33 | typedef sint32_t error_t; |
---|
34 | typedef uint_t bool_t; |
---|
35 | |
---|
36 | typedef void *srl_buffer_t; |
---|
37 | # 11 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" 2 |
---|
38 | |
---|
39 | |
---|
40 | # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_lock.h" 1 |
---|
41 | # 23 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_lock.h" |
---|
42 | # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_public_types.h" 1 |
---|
43 | # 24 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_lock.h" 2 |
---|
44 | # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/stdio.h" 1 |
---|
45 | # 11 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/stdio.h" |
---|
46 | # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/xml/mapping_info.h" 1 |
---|
47 | # 57 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/xml/mapping_info.h" |
---|
48 | enum |
---|
49 | { |
---|
50 | ELF = 0, |
---|
51 | PTAB, |
---|
52 | PERI, |
---|
53 | MWMR, |
---|
54 | LOCK, |
---|
55 | BUFFER, |
---|
56 | BARRIER |
---|
57 | }; |
---|
58 | |
---|
59 | |
---|
60 | |
---|
61 | typedef struct mapping_header_s |
---|
62 | { |
---|
63 | unsigned int signature; |
---|
64 | unsigned int clusters; |
---|
65 | unsigned int psegs; |
---|
66 | unsigned int ttys; |
---|
67 | unsigned int globals; |
---|
68 | unsigned int vspaces; |
---|
69 | unsigned int vsegs; |
---|
70 | unsigned int vobjs; |
---|
71 | unsigned int tasks; |
---|
72 | char name[32]; |
---|
73 | } mapping_header_t; |
---|
74 | |
---|
75 | |
---|
76 | typedef struct mapping_cluster_s |
---|
77 | { |
---|
78 | unsigned int procs; |
---|
79 | unsigned int timers; |
---|
80 | unsigned int dmas; |
---|
81 | } mapping_cluster_t; |
---|
82 | |
---|
83 | |
---|
84 | typedef struct mapping_pseg_s |
---|
85 | { |
---|
86 | char name[32]; |
---|
87 | unsigned int base; |
---|
88 | unsigned int length; |
---|
89 | unsigned int next_free_page; |
---|
90 | } mapping_pseg_t; |
---|
91 | |
---|
92 | |
---|
93 | typedef struct mapping_vspace_s |
---|
94 | { |
---|
95 | char name[32]; |
---|
96 | unsigned int funcs_offset; |
---|
97 | unsigned int vsegs; |
---|
98 | unsigned int vobjs; |
---|
99 | unsigned int tasks; |
---|
100 | unsigned int ttys; |
---|
101 | unsigned int vseg_offset; |
---|
102 | unsigned int vobj_offset; |
---|
103 | unsigned int task_offset; |
---|
104 | } mapping_vspace_t; |
---|
105 | |
---|
106 | |
---|
107 | typedef struct mapping_vseg_s |
---|
108 | { |
---|
109 | char name[32]; |
---|
110 | unsigned int vbase; |
---|
111 | unsigned int pbase; |
---|
112 | unsigned int length; |
---|
113 | unsigned int psegid; |
---|
114 | unsigned char mode; |
---|
115 | unsigned char ident; |
---|
116 | unsigned int vobjs; |
---|
117 | unsigned int vobj_offset; |
---|
118 | unsigned char reserved; |
---|
119 | } mapping_vseg_t; |
---|
120 | |
---|
121 | |
---|
122 | typedef struct mapping_task_s |
---|
123 | { |
---|
124 | char name[32]; |
---|
125 | unsigned int clusterid; |
---|
126 | unsigned int proclocid; |
---|
127 | unsigned int vobjlocid; |
---|
128 | unsigned int startid; |
---|
129 | unsigned int ttylocid; |
---|
130 | } mapping_task_t; |
---|
131 | |
---|
132 | |
---|
133 | typedef struct mapping_vobj_s |
---|
134 | { |
---|
135 | char name[32]; |
---|
136 | char binpath[64]; |
---|
137 | unsigned int type; |
---|
138 | unsigned int length; |
---|
139 | unsigned int align; |
---|
140 | unsigned int vaddr; |
---|
141 | unsigned int paddr; |
---|
142 | } mapping_vobj_t; |
---|
143 | # 12 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/stdio.h" 2 |
---|
144 | |
---|
145 | |
---|
146 | unsigned int procid(); |
---|
147 | unsigned int proctime(); |
---|
148 | unsigned int procnumber(); |
---|
149 | |
---|
150 | |
---|
151 | unsigned int tty_putc(char byte); |
---|
152 | unsigned int tty_puts(char *buf); |
---|
153 | unsigned int tty_putw(unsigned int val); |
---|
154 | unsigned int tty_getc(char *byte); |
---|
155 | unsigned int tty_getc_irq(char *byte); |
---|
156 | unsigned int tty_gets_irq(char *buf, unsigned int bufsize); |
---|
157 | unsigned int tty_getw_irq(unsigned int *val); |
---|
158 | unsigned int tty_printf(char *format,...); |
---|
159 | |
---|
160 | |
---|
161 | unsigned int timer_set_mode(unsigned int mode); |
---|
162 | unsigned int timer_set_period(unsigned int period); |
---|
163 | unsigned int timer_reset_irq(); |
---|
164 | unsigned int timer_get_time(unsigned int *time); |
---|
165 | |
---|
166 | |
---|
167 | unsigned int gcd_set_opa(unsigned int val); |
---|
168 | unsigned int gcd_set_opb(unsigned int val); |
---|
169 | unsigned int gcd_start(); |
---|
170 | unsigned int gcd_get_result(unsigned int *val); |
---|
171 | unsigned int gcd_get_status(unsigned int *val); |
---|
172 | |
---|
173 | |
---|
174 | unsigned int ioc_read(unsigned int lba, void *buffer, unsigned int count); |
---|
175 | unsigned int ioc_write(unsigned int lba, void *buffer, unsigned int count); |
---|
176 | unsigned int ioc_completed(); |
---|
177 | |
---|
178 | |
---|
179 | unsigned int fb_sync_read(unsigned int offset, void *buffer, unsigned int length); |
---|
180 | unsigned int fb_sync_write(unsigned int offset, void *buffer, unsigned int length); |
---|
181 | unsigned int fb_read(unsigned int offset, void *buffer, unsigned int length); |
---|
182 | unsigned int fb_write(unsigned int offset, void *buffer, unsigned int length); |
---|
183 | unsigned int fb_completed(); |
---|
184 | |
---|
185 | |
---|
186 | unsigned int barrier_init(unsigned int index, unsigned int count); |
---|
187 | unsigned int barrier_wait(unsigned int index); |
---|
188 | |
---|
189 | |
---|
190 | void exit(); |
---|
191 | unsigned int rand(); |
---|
192 | unsigned int ctx_switch(); |
---|
193 | unsigned int vobj_get_vbase( char* vspace_name, char* vobj_name, |
---|
194 | unsigned int vobj_type, unsigned int* vobj_buffer); |
---|
195 | # 73 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/stdio.h" |
---|
196 | static inline void *memcpy(void *_dst, const void *_src, unsigned int size) |
---|
197 | { |
---|
198 | unsigned int *dst = _dst; |
---|
199 | const unsigned int *src = _src; |
---|
200 | |
---|
201 | |
---|
202 | |
---|
203 | if (!((unsigned int)dst & 3) && !((unsigned int)src & 3)) |
---|
204 | while (size > 3) { |
---|
205 | *dst++ = *src++; |
---|
206 | size -= 4; |
---|
207 | } |
---|
208 | |
---|
209 | unsigned char *cdst = (unsigned char*)dst; |
---|
210 | unsigned char *csrc = (unsigned char*)src; |
---|
211 | |
---|
212 | |
---|
213 | while (size--) { |
---|
214 | *cdst++ = *csrc++; |
---|
215 | } |
---|
216 | return _dst; |
---|
217 | } |
---|
218 | # 25 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_lock.h" 2 |
---|
219 | |
---|
220 | typedef struct { |
---|
221 | unsigned int lock; |
---|
222 | }srl_lock_t; |
---|
223 | # 37 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_lock.h" |
---|
224 | int srl_lock_lock( srl_lock_t lock ); |
---|
225 | |
---|
226 | |
---|
227 | |
---|
228 | |
---|
229 | |
---|
230 | |
---|
231 | void srl_lock_unlock( srl_lock_t lock ); |
---|
232 | # 53 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_lock.h" |
---|
233 | int srl_lock_try_lock( srl_lock_t lock ); |
---|
234 | # 14 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" 2 |
---|
235 | # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_mwmr.h" 1 |
---|
236 | |
---|
237 | |
---|
238 | |
---|
239 | # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/mwmr.h" 1 |
---|
240 | # 17 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/mwmr.h" |
---|
241 | typedef struct mwmr_channel_s { |
---|
242 | unsigned int ptr; |
---|
243 | unsigned int ptw; |
---|
244 | unsigned int sts; |
---|
245 | unsigned int depth; |
---|
246 | unsigned int lock; |
---|
247 | unsigned int data[1019]; |
---|
248 | } mwmr_channel_t; |
---|
249 | |
---|
250 | |
---|
251 | |
---|
252 | |
---|
253 | |
---|
254 | |
---|
255 | void mwmr_write( mwmr_channel_t* mwmr, |
---|
256 | unsigned int* buffer, |
---|
257 | unsigned int nwords ); |
---|
258 | |
---|
259 | void mwmr_read( mwmr_channel_t* mwmr, |
---|
260 | unsigned int* buffer, |
---|
261 | unsigned int nwords ); |
---|
262 | # 5 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_mwmr.h" 2 |
---|
263 | # 15 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" 2 |
---|
264 | # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_log.h" 1 |
---|
265 | # 24 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_log.h" |
---|
266 | # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/giet_config.h" 1 |
---|
267 | # 25 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_log.h" 2 |
---|
268 | # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_hw_helpers.h" 1 |
---|
269 | # 12 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_hw_helpers.h" |
---|
270 | typedef struct __ldscript_symbol_s __ldscript_symbol_t; |
---|
271 | # 56 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_hw_helpers.h" |
---|
272 | void srl_sleep_cycles( unsigned int time ); |
---|
273 | # 66 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_hw_helpers.h" |
---|
274 | static inline unsigned int srl_cycle_count() |
---|
275 | { |
---|
276 | return proctime(); |
---|
277 | } |
---|
278 | |
---|
279 | |
---|
280 | |
---|
281 | |
---|
282 | |
---|
283 | static inline void srl_abort() |
---|
284 | { |
---|
285 | asm volatile ("break 0"); |
---|
286 | while(1); |
---|
287 | } |
---|
288 | # 26 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_log.h" 2 |
---|
289 | |
---|
290 | |
---|
291 | enum __srl_verbosity { |
---|
292 | VERB_NONE, |
---|
293 | VERB_TRACE, |
---|
294 | VERB_DEBUG, |
---|
295 | VERB_MAX, |
---|
296 | }; |
---|
297 | |
---|
298 | |
---|
299 | void _srl_log(const char *); |
---|
300 | void _srl_log_printf(const char *, ...); |
---|
301 | # 16 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" 2 |
---|
302 | # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_barrier.h" 1 |
---|
303 | # 24 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_barrier.h" |
---|
304 | # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_log.h" 1 |
---|
305 | # 25 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_barrier.h" 2 |
---|
306 | # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_sched_wait.h" 1 |
---|
307 | # 27 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_sched_wait.h" |
---|
308 | void srl_sched_wait_eq(void *addr, sint32_t val ); |
---|
309 | void srl_sched_wait_ne(void *addr, sint32_t val ); |
---|
310 | void srl_sched_wait_le(void *addr, sint32_t val ); |
---|
311 | void srl_sched_wait_ge(void *addr, sint32_t val ); |
---|
312 | void srl_sched_wait_lt(void *addr, sint32_t val ); |
---|
313 | void srl_sched_wait_gt(void *addr, sint32_t val ); |
---|
314 | |
---|
315 | |
---|
316 | |
---|
317 | |
---|
318 | void srl_sleep_cycles( unsigned int n ); |
---|
319 | # 26 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_barrier.h" 2 |
---|
320 | |
---|
321 | |
---|
322 | typedef struct srl_abstract_barrier_s |
---|
323 | { |
---|
324 | unsigned int init_val; |
---|
325 | unsigned int count; |
---|
326 | |
---|
327 | } srl_barrier_s; |
---|
328 | |
---|
329 | |
---|
330 | |
---|
331 | typedef srl_barrier_s *srl_barrier_t; |
---|
332 | |
---|
333 | void srl_barrier_wait( srl_barrier_t barrier ); |
---|
334 | # 17 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" 2 |
---|
335 | # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_memspace.h" 1 |
---|
336 | # 13 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_memspace.h" |
---|
337 | typedef struct srl_memspace_s { |
---|
338 | void *buffer; |
---|
339 | uint32_t size; |
---|
340 | } srl_memspace_s; |
---|
341 | |
---|
342 | |
---|
343 | |
---|
344 | |
---|
345 | typedef struct srl_memspace_s *srl_memspace_t; |
---|
346 | # 18 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" 2 |
---|
347 | |
---|
348 | # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_hw_helpers.h" 1 |
---|
349 | # 20 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" 2 |
---|
350 | # 8 "numsplit_common.h" 2 |
---|
351 | # 19 "consumer_proto.h" 2 |
---|
352 | # 2 "consumer.c" 2 |
---|
353 | |
---|
354 | __attribute__((constructor))void consumer_func_cons_func () |
---|
355 | { |
---|
356 | mwmr_channel_t* input = ({ mwmr_channel_t* _mwmr; if( vobj_get_vbase( "APP_NAME" , "port", MWMR, (unsigned int*)&_mwmr ) ) { do { if (VERB_NONE <= VERB_TRACE) { tty_printf("\n[ERROR] in TASK task :\n"); } } while (0); do { if (VERB_NONE <= VERB_TRACE) { tty_printf(" undefined <port> channel: %d\n", _mwmr); } } while (0); do { if (VERB_TRACE <= VERB_TRACE) { tty_printf("*** &port = %x\n\n", (unsigned int)_mwmr); } } while (0); exit(); }else do { if (VERB_DEBUG <= VERB_TRACE) { tty_printf("%s:%d: arg of %s: %s\n", "consumer.c", 5, "APP_NAME", "port"); } } while (0); _mwmr;}); |
---|
357 | char buf[32]; |
---|
358 | mwmr_read(input, (unsigned *)buf, 8); |
---|
359 | do { if (VERB_NONE <= VERB_TRACE) { tty_printf("Consumer : %s\n\n", buf); } } while (0); |
---|
360 | } |
---|