Changeset 213 for soft/giet_vm
- Timestamp:
- Aug 26, 2012, 8:16:34 PM (12 years ago)
- Location:
- soft/giet_vm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/libs/libsrl/srl_args.h
r178 r213 4 4 5 5 6 #define SRL_GET_MWMR(port) APP_GET_ARG(port, VOBJ_TYPE_MWMR)6 #define SRL_GET_MWMR(port) (srl_mwmr_t) APP_GET_ARG(port, VOBJ_TYPE_MWMR) 7 7 #define SRL_GET_BARRIER(port) APP_GET_ARG(port, VOBJ_TYPE_BARRIER) 8 8 #define SRL_GET_LOCK(port) APP_GET_ARG(port, VOBJ_TYPE_LOCK) 9 #define SRL_GET_BUFFER(port) APP_GET_ARG(port, VOBJ_TYPE_BUFFER) 9 //#define SRL_GET_MEMSPACE(port) APP_GET_ARG(port, VOBJ_TYPE_BUFFER) TODO 10 #define SRL_GET_MEMSPACE #error "SRL_GET_MEMSPACE is not implemented"// 10 11 11 12 12 /* port, APP_NAME, TASK, #task_name, alias */ 13 # define SRL_GET_ARG(task_name, port, type) \ 13 # define SRL_GET_VBASE(task_name, port, type) \ 14 14 ({ \ 15 srl_mwmr_t _mwmr;\16 if( giet_vobj_get_vbase( APP_NAME , alias_##task_name.port, type, (unsigned int*)&_mwmr ) )\15 unsigned int vbase; \ 16 if( giet_vobj_get_vbase( APP_NAME , alias_##task_name.port, type, &vbase ) ) \ 17 17 { \ 18 18 srl_log_printf( NONE, "\n[ERROR] in "#task_name" task :\n"); \ 19 19 srl_log_printf( NONE, " undefined port <"#port"> for channel(%s): %d\n", \ 20 alias_##task_name.port, _mwmr); \21 srl_log_printf( TRACE, "*** &"#port" = %x\n\n", (unsigned int)_mwmr );\20 alias_##task_name.port,vbase); \ 21 srl_log_printf( TRACE, "*** &"#port" = %x\n\n", vbase ); \ 22 22 srl_exit(); \ 23 23 }else \ 24 24 srl_log_printf( TRACE, "%s:%d: arg of %s for %s,from %s; &"#port" = %x\n\n", \ 25 __FILE__, __LINE__, APP_NAME, #task_name,#port, (unsigned int)_mwmr );\26 _mwmr;\25 __FILE__, __LINE__, APP_NAME, #task_name,#port, vbase ); \ 26 vbase;\ 27 27 }) 28 28 -
soft/giet_vm/libs/libsrl/srl_mwmr.h
r178 r213 6 6 typedef mwmr_channel_t* srl_mwmr_t; 7 7 8 #define srl_mwmr_write(a, b, c) mwmr_write(a, b,c)9 #define srl_mwmr_read(a, b, c) mwmr_read(a, b,c)8 #define srl_mwmr_write(a, b, c) mwmr_write(a, (unsigned int*) b, (unsigned int)c) 9 #define srl_mwmr_read(a, b, c) mwmr_read(a, (unsigned int*) b, (unsigned int)c) 10 10 11 11 -
soft/giet_vm/sys/drivers.c
r207 r213 715 715 716 716 //+1: for the case where the NB_DMAS_MAX == 0 717 in_unckdata unsigned int _dma_lock[(NB_DMAS_MAX+1) * NB_CLUSTERS] 718 = { [0 ... ((NB_DMAS_MAX+1) * NB_CLUSTERS)-1] = 0 }; 719 720 in_unckdata volatile unsigned int _dma_done[(NB_DMAS_MAX+1) * NB_CLUSTERS] 721 = { [0 ... ((NB_DMAS_MAX+1) * NB_CLUSTERS)-1] = 0 }; 722 723 in_unckdata volatile unsigned int _dma_status[(NB_DMAS_MAX+1) * NB_CLUSTERS]; 717 #if NB_DMAS_MAX > 0 718 in_unckdata unsigned int _dma_lock[NB_DMAS_MAX * NB_CLUSTERS] 719 = { [0 ... ((NB_DMAS_MAX) * NB_CLUSTERS)-1] = 0 }; 720 721 in_unckdata volatile unsigned int _dma_done[NB_DMAS_MAX * NB_CLUSTERS] 722 = { [0 ... (NB_DMAS_MAX * NB_CLUSTERS)-1] = 0 }; 723 724 in_unckdata volatile unsigned int _dma_status[NB_DMAS_MAX * NB_CLUSTERS]; 724 725 725 726 in_unckdata unsigned int _dma_iommu_ix1 = 1; 726 727 727 in_unckdata unsigned int _dma_iommu_npages[(NB_DMAS_MAX+1) * NB_CLUSTERS]; 728 in_unckdata unsigned int _dma_iommu_npages[NB_DMAS_MAX * NB_CLUSTERS]; 729 #endif 728 730 729 731 ////////////////////////////////////////////////////////////////////////////////// … … 733 735 unsigned int channel_id ) 734 736 { 737 #if NB_DMAS_MAX > 0 735 738 // parameters checking 736 739 if ( cluster_id >= NB_CLUSTERS ) return 1; … … 743 746 dma_address[channel_id*DMA_SPAN + DMA_RESET] = 0; 744 747 return 0; 748 #else 749 return -1; 750 #endif 745 751 } 746 752 ////////////////////////////////////////////////////////////////////////////////// … … 751 757 unsigned int* status ) 752 758 { 759 #if NB_DMAS_MAX > 0 753 760 // parameters checking 754 761 if ( cluster_id >= NB_CLUSTERS ) return 1; … … 761 768 *status = dma_address[channel_id*DMA_SPAN + DMA_LEN]; 762 769 return 0; 770 #else 771 return -1; 772 #endif 763 773 } 764 774 … … 852 862 unsigned int length ) 853 863 { 864 #if NB_DMAS_MAX > 0 854 865 unsigned int ko; // unsuccessfull V2P translation 855 866 unsigned int flags; // protection flags … … 996 1007 997 1008 return 0; 1009 1010 #else //NB_DMAS_MAX == 0 1011 return -1; 1012 #endif 998 1013 } 999 1014 ////////////////////////////////////////////////////////////////////////////////// … … 1042 1057 unsigned int _fb_completed() 1043 1058 { 1059 #if NB_DMAS_MAX > 0 1044 1060 unsigned int task_id = _get_current_task_id(); 1045 1061 unsigned int dma_id = _get_context_slot( task_id, CTX_FBDMA_ID ); … … 1079 1095 1080 1096 return _dma_status[dma_id]; 1081 } 1082 1097 1098 #else //NB_DMAS_MAX == 0 1099 1100 return -1; 1101 1102 #endif 1103 } 1104 -
soft/giet_vm/sys/irq_handler.c
r207 r213 90 90 void _isr_dma( unsigned int channel_id ) 91 91 { 92 #if NB_DMAS_MAX > 0 92 93 // compute cluster_id 93 94 unsigned int cluster_id = _procid()/NB_PROCS_MAX; … … 119 120 // release DMA channel 120 121 _dma_done[dma_global_id] = 1; 122 #else 123 _puts("[GIET ERROR] NB_DMAS_MAX is set to zero\n"); 124 125 #endif 121 126 } 122 127
Note: See TracChangeset
for help on using the changeset viewer.