Changeset 213 for soft/giet_vm/sys/drivers.c
- Timestamp:
- Aug 26, 2012, 8:16:34 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.