Changeset 207 for soft/giet_vm/sys/drivers.c
- Timestamp:
- Aug 16, 2012, 6:36:16 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/sys/drivers.c
r205 r207 231 231 _get_lock(&_tty_put_lock); 232 232 _puts("\n[GIET ERROR] TTY index too large for task "); 233 _put w( task_id );233 _putd( task_id ); 234 234 _puts(" on processor "); 235 _put w( proc_id );235 _putd( proc_id ); 236 236 _puts("\n"); 237 237 _release_lock(&_tty_put_lock); … … 316 316 //////////////////////////////////////////////////////////////////////////////// 317 317 unsigned int _tty_get_char( unsigned int tty_id, 318 char*buffer )318 unsigned char* buffer ) 319 319 { 320 320 // checking argument … … 731 731 ////////////////////////////////////////////////////////////////////////////////// 732 732 unsigned int _dma_reset_irq( unsigned int cluster_id, 733 unsigned int local_id )733 unsigned int channel_id ) 734 734 { 735 735 // parameters checking 736 736 if ( cluster_id >= NB_CLUSTERS ) return 1; 737 if ( local_id >= NB_DMAS_MAX )return 1;737 if ( channel_id >= NB_DMAS_MAX ) return 1; 738 738 739 739 // compute DMA base address … … 741 741 (cluster_id * (unsigned)CLUSTER_SIZE) ); 742 742 743 dma_address[ local_id*DMA_SPAN + DMA_RESET] = 0;743 dma_address[channel_id*DMA_SPAN + DMA_RESET] = 0; 744 744 return 0; 745 745 } … … 748 748 ////////////////////////////////////////////////////////////////////////////////// 749 749 unsigned int _dma_get_status( unsigned int cluster_id, 750 unsigned int local_id,750 unsigned int channel_id, 751 751 unsigned int* status ) 752 752 { 753 753 // parameters checking 754 754 if ( cluster_id >= NB_CLUSTERS ) return 1; 755 if ( local_id >= NB_DMAS_MAX )return 1;755 if ( channel_id >= NB_DMAS_MAX ) return 1; 756 756 757 757 // compute DMA base address 758 758 unsigned int* dma_address = (unsigned int*)( (char*)&seg_dma_base + 759 759 (cluster_id * (unsigned)CLUSTER_SIZE) ); 760 761 *status = dma_address[ local_id*DMA_SPAN + DMA_LEN];760 761 *status = dma_address[channel_id*DMA_SPAN + DMA_LEN]; 762 762 return 0; 763 763 } … … 839 839 // - user_vaddr : virtual base address of the memory buffer. 840 840 // - length : number of bytes to be transfered. 841 // The memorybuffer must be mapped in user address space and word-aligned.841 // The user buffer must be mapped in user address space and word-aligned. 842 842 // The user buffer length must be multiple of 4 bytes. 843 843 // Me must compute the physical base addresses for both the frame buffer 844 844 // and the user buffer before programming the DMA transfer. 845 // The GIET being fully static, we don't need to split the transfer in 4 Kbytes845 // The GIET being fully static, we don't need to split the transfer in 4 Kbytes 846 846 // pages, because the user buffer is contiguous in physical space. 847 847 // Returns 0 if success, > 0 if error. … … 871 871 { 872 872 _get_lock(&_tty_put_lock); 873 _puts(" [GIET ERROR] in _fbdma_access() : user buffer not word aligned\n");873 _puts("\n[GIET ERROR] in _fbdma_access() : user buffer not word aligned\n"); 874 874 _release_lock(&_tty_put_lock); 875 875 return 1; … … 880 880 881 881 // compute frame buffer pbase address 882 unsigned int fb_vaddr = (unsigned int)&seg_fbf_base + offset; 882 unsigned int fb_vaddr = (unsigned int)&seg_fbf_base + 883 (CLUSTER_IO_ID * (unsigned int)CLUSTER_SIZE) + offset; 883 884 884 885 ko = _v2p_translate( (page_table_t*)user_ptab, … … 891 892 { 892 893 _get_lock(&_tty_put_lock); 893 _puts(" [GIET ERROR] in _fbdma_access() : frame buffer unmapped\n");894 _puts("\n[GIET ERROR] in _fbdma_access() : frame buffer unmapped\n"); 894 895 _release_lock(&_tty_put_lock); 895 896 return 2; … … 906 907 { 907 908 _get_lock(&_tty_put_lock); 908 _puts(" [GIET ERROR] in _fbdma_access() : user buffer unmapped\n");909 _puts("\n[GIET ERROR] in _fbdma_access() : user buffer unmapped\n"); 909 910 _release_lock(&_tty_put_lock); 910 911 return 3; … … 920 921 { 921 922 _get_lock(&_tty_put_lock); 922 _puts(" [GIET ERROR] in _fbdma_access() : user buffer not writable\n");923 _puts("\n[GIET ERROR] in _fbdma_access() : user buffer not writable\n"); 923 924 _release_lock(&_tty_put_lock); 924 925 return 5;
Note: See TracChangeset
for help on using the changeset viewer.