# 1 "consumer.c" # 1 "" # 1 "" # 1 "consumer.c" # 1 "consumer_proto.h" 1 # 18 "consumer_proto.h" # 1 "numsplit_common.h" 1 # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" 1 # 10 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_public_types.h" 1 # 10 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_public_types.h" typedef unsigned long uint_t; typedef signed long sint_t; typedef unsigned char uint8_t; typedef signed char sint8_t; typedef signed short int int8_t; typedef unsigned short int uint16_t; typedef signed short int sint16_t; typedef signed short int int16_t; typedef unsigned int uint32_t; typedef signed int sint32_t; typedef signed int int32_t; typedef sint32_t error_t; typedef uint_t bool_t; typedef void *srl_buffer_t; # 11 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" 2 # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_lock.h" 1 # 23 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_lock.h" # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_public_types.h" 1 # 24 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_lock.h" 2 # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/stdio.h" 1 # 11 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/stdio.h" # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/xml/mapping_info.h" 1 # 57 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/xml/mapping_info.h" enum { ELF = 0, PTAB, PERI, MWMR, LOCK, BUFFER, BARRIER }; typedef struct mapping_header_s { unsigned int signature; unsigned int clusters; unsigned int psegs; unsigned int ttys; unsigned int globals; unsigned int vspaces; unsigned int vsegs; unsigned int vobjs; unsigned int tasks; char name[32]; } mapping_header_t; typedef struct mapping_cluster_s { unsigned int procs; unsigned int timers; unsigned int dmas; } mapping_cluster_t; typedef struct mapping_pseg_s { char name[32]; unsigned int base; unsigned int length; unsigned int next_free_page; } mapping_pseg_t; typedef struct mapping_vspace_s { char name[32]; unsigned int funcs_offset; unsigned int vsegs; unsigned int vobjs; unsigned int tasks; unsigned int ttys; unsigned int vseg_offset; unsigned int vobj_offset; unsigned int task_offset; } mapping_vspace_t; typedef struct mapping_vseg_s { char name[32]; unsigned int vbase; unsigned int pbase; unsigned int length; unsigned int psegid; unsigned char mode; unsigned char ident; unsigned int vobjs; unsigned int vobj_offset; unsigned char reserved; } mapping_vseg_t; typedef struct mapping_task_s { char name[32]; unsigned int clusterid; unsigned int proclocid; unsigned int vobjlocid; unsigned int startid; unsigned int ttylocid; } mapping_task_t; typedef struct mapping_vobj_s { char name[32]; char binpath[64]; unsigned int type; unsigned int length; unsigned int align; unsigned int vaddr; unsigned int paddr; } mapping_vobj_t; # 12 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/stdio.h" 2 unsigned int procid(); unsigned int proctime(); unsigned int procnumber(); unsigned int tty_putc(char byte); unsigned int tty_puts(char *buf); unsigned int tty_putw(unsigned int val); unsigned int tty_getc(char *byte); unsigned int tty_getc_irq(char *byte); unsigned int tty_gets_irq(char *buf, unsigned int bufsize); unsigned int tty_getw_irq(unsigned int *val); unsigned int tty_printf(char *format,...); unsigned int timer_set_mode(unsigned int mode); unsigned int timer_set_period(unsigned int period); unsigned int timer_reset_irq(); unsigned int timer_get_time(unsigned int *time); unsigned int gcd_set_opa(unsigned int val); unsigned int gcd_set_opb(unsigned int val); unsigned int gcd_start(); unsigned int gcd_get_result(unsigned int *val); unsigned int gcd_get_status(unsigned int *val); unsigned int ioc_read(unsigned int lba, void *buffer, unsigned int count); unsigned int ioc_write(unsigned int lba, void *buffer, unsigned int count); unsigned int ioc_completed(); unsigned int fb_sync_read(unsigned int offset, void *buffer, unsigned int length); unsigned int fb_sync_write(unsigned int offset, void *buffer, unsigned int length); unsigned int fb_read(unsigned int offset, void *buffer, unsigned int length); unsigned int fb_write(unsigned int offset, void *buffer, unsigned int length); unsigned int fb_completed(); unsigned int barrier_init(unsigned int index, unsigned int count); unsigned int barrier_wait(unsigned int index); void exit(); unsigned int rand(); unsigned int ctx_switch(); unsigned int vobj_get_vbase( char* vspace_name, char* vobj_name, unsigned int vobj_type, unsigned int* vobj_buffer); # 73 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/stdio.h" static inline void *memcpy(void *_dst, const void *_src, unsigned int size) { unsigned int *dst = _dst; const unsigned int *src = _src; if (!((unsigned int)dst & 3) && !((unsigned int)src & 3)) while (size > 3) { *dst++ = *src++; size -= 4; } unsigned char *cdst = (unsigned char*)dst; unsigned char *csrc = (unsigned char*)src; while (size--) { *cdst++ = *csrc++; } return _dst; } # 25 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_lock.h" 2 typedef struct { unsigned int lock; }srl_lock_t; # 37 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_lock.h" int srl_lock_lock( srl_lock_t lock ); void srl_lock_unlock( srl_lock_t lock ); # 53 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_lock.h" int srl_lock_try_lock( srl_lock_t lock ); # 14 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" 2 # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_mwmr.h" 1 # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/mwmr.h" 1 # 17 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/mwmr.h" typedef struct mwmr_channel_s { unsigned int ptr; unsigned int ptw; unsigned int sts; unsigned int depth; unsigned int lock; unsigned int data[1019]; } mwmr_channel_t; void mwmr_write( mwmr_channel_t* mwmr, unsigned int* buffer, unsigned int nwords ); void mwmr_read( mwmr_channel_t* mwmr, unsigned int* buffer, unsigned int nwords ); # 5 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_mwmr.h" 2 # 15 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" 2 # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_log.h" 1 # 24 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_log.h" # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/giet_config.h" 1 # 25 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_log.h" 2 # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_hw_helpers.h" 1 # 12 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_hw_helpers.h" typedef struct __ldscript_symbol_s __ldscript_symbol_t; # 56 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_hw_helpers.h" void srl_sleep_cycles( unsigned int time ); # 66 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_hw_helpers.h" static inline unsigned int srl_cycle_count() { return proctime(); } static inline void srl_abort() { asm volatile ("break 0"); while(1); } # 26 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_log.h" 2 enum __srl_verbosity { VERB_NONE, VERB_TRACE, VERB_DEBUG, VERB_MAX, }; void _srl_log(const char *); void _srl_log_printf(const char *, ...); # 16 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" 2 # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_barrier.h" 1 # 24 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_barrier.h" # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_log.h" 1 # 25 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_barrier.h" 2 # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_sched_wait.h" 1 # 27 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_sched_wait.h" void srl_sched_wait_eq(void *addr, sint32_t val ); void srl_sched_wait_ne(void *addr, sint32_t val ); void srl_sched_wait_le(void *addr, sint32_t val ); void srl_sched_wait_ge(void *addr, sint32_t val ); void srl_sched_wait_lt(void *addr, sint32_t val ); void srl_sched_wait_gt(void *addr, sint32_t val ); void srl_sleep_cycles( unsigned int n ); # 26 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_barrier.h" 2 typedef struct srl_abstract_barrier_s { unsigned int init_val; unsigned int count; } srl_barrier_s; typedef srl_barrier_s *srl_barrier_t; void srl_barrier_wait( srl_barrier_t barrier ); # 17 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" 2 # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_memspace.h" 1 # 13 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_memspace.h" typedef struct srl_memspace_s { void *buffer; uint32_t size; } srl_memspace_s; typedef struct srl_memspace_s *srl_memspace_t; # 18 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" 2 # 1 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/libsrl/srl_hw_helpers.h" 1 # 20 "/users/cao/karaoui/soc/myplateform/caba_vgsb_almo_mmu_vloader/soft/libs/srl.h" 2 # 8 "numsplit_common.h" 2 # 19 "consumer_proto.h" 2 # 2 "consumer.c" 2 __attribute__((constructor))void consumer_func_cons_func () { 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 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;}); char buf[32]; mwmr_read(input, (unsigned *)buf, 8); do { if (VERB_NONE <= VERB_TRACE) { tty_printf("Consumer : %s\n\n", buf); } } while (0); }