- Timestamp:
- Aug 7, 2015, 5:42:07 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/sys_handler.c
r698 r699 96 96 97 97 __attribute__((section(".kdata"))) 98 unsigned int _cma_channel _allocator = 0;98 unsigned int _cma_channel[NB_CMA_CHANNELS] = {0}; 99 99 100 100 __attribute__((section(".kdata"))) … … 819 819 if ( channel == -1 ) 820 820 { 821 _printf("\n[GIET_ERROR] in _sys_tty_ alloc() : TTY channel already released\n");821 _printf("\n[GIET_ERROR] in _sys_tty_release() : TTY channel already released\n"); 822 822 return -1; 823 823 } … … 1039 1039 1040 1040 // get a CMA channel index 1041 cma_channel = _atomic_increment( &_cma_channel_allocator, 1 ); 1041 for ( cma_channel = 0 ; cma_channel < NB_CMA_CHANNELS ; cma_channel++ ) 1042 { 1043 if ( !_cma_channel[cma_channel] ) 1044 { 1045 _cma_channel[cma_channel] = 1; 1046 break; 1047 } 1048 } 1042 1049 1043 1050 if ( cma_channel >= NB_CMA_CHANNELS ) … … 1649 1656 int _sys_fbf_cma_alloc() 1650 1657 { 1651 // get a new CMA channel index 1652 unsigned int channel = _atomic_increment( &_cma_channel_allocator, 1 ); 1658 if ( _get_context_slot( CTX_CMA_FB_ID ) < NB_CMA_CHANNELS ) 1659 { 1660 _printf("\n[GIET ERROR] in _sys_fbf_cma_alloc() : CMA channel already allocated\n"); 1661 return 0; 1662 } 1663 1664 // get a new CMA channel index 1665 unsigned int channel; 1666 1667 for ( channel = 0 ; channel < NB_CMA_CHANNELS ; channel++ ) 1668 { 1669 if ( !_cma_channel[channel] ) 1670 { 1671 _cma_channel[channel] = 1; 1672 break; 1673 } 1674 } 1653 1675 1654 1676 if ( channel >= NB_CMA_CHANNELS ) 1655 1677 { 1656 _printf("\n[GIET ERROR] in _sys_fbf_cma_alloc() : no t enough CMA channels\n");1678 _printf("\n[GIET ERROR] in _sys_fbf_cma_alloc() : no CMA channel available\n"); 1657 1679 return -1; 1658 1680 }
Note: See TracChangeset
for help on using the changeset viewer.