Changeset 695 for soft/giet_vm/giet_kernel/sys_handler.c
- Timestamp:
- Aug 7, 2015, 5:42:06 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/sys_handler.c
r690 r695 232 232 if ( _strcmp( vspace[vspace_id].name, name ) == 0 ) 233 233 { 234 // check if pplication can be killed234 // check if application can be killed 235 235 if ( vspace[vspace_id].active ) return -2; 236 236 … … 249 249 static_scheduler_t* psched = (static_scheduler_t*)_schedulers[x][y][p]; 250 250 251 // release private TTY terminal if required 252 if ( psched->context[ltid][CTX_TTY_ID] < NB_TTY_CHANNELS ) 253 { 254 psched->context[ltid][CTX_TTY_ID] = 0xFFFFFFFF; 255 _atomic_increment( &_tty_channel_allocator , 0xFFFFFFFF ); 256 } 257 258 // release private TIM channel if required 259 if ( psched->context[ltid][CTX_TIM_ID] < NB_TIM_CHANNELS ) 260 { 261 psched->context[ltid][CTX_TIM_ID] = 0xFFFFFFFF; 262 _atomic_increment( &_tim_channel_allocator , 0xFFFFFFFF ); 263 } 264 265 // release private NIC_RX channel if required 266 if ( psched->context[ltid][CTX_NIC_RX_ID] < NB_NIC_CHANNELS ) 267 { 268 psched->context[ltid][CTX_NIC_RX_ID] = 0xFFFFFFFF; 269 _atomic_increment( &_nic_rx_channel_allocator , 0xFFFFFFFF ); 270 } 271 272 // release private NIC_TX channel if required 273 if ( psched->context[ltid][CTX_NIC_TX_ID] < NB_NIC_CHANNELS ) 274 { 275 psched->context[ltid][CTX_NIC_TX_ID] = 0xFFFFFFFF; 276 _atomic_increment( &_nic_tx_channel_allocator , 0xFFFFFFFF ); 277 } 278 279 // set NORUN_MASK_TASK bit 280 unsigned int* ptr = &psched->context[ltid][CTX_NORUN_ID]; 281 _atomic_or( ptr , NORUN_MASK_TASK ); 251 // set KILL signal bit 252 _atomic_or( &psched->context[ltid][CTX_SIG_ID] , SIG_MASK_KILL ); 282 253 } 283 254 284 255 #if GIET_DEBUG_EXEC 285 256 if ( _get_proctime() > GIET_DEBUG_EXEC ) 286 _printf("\n[DEBUG EXEC] exit _sys_kill_application() : %s desactivated\n", name );257 _printf("\n[DEBUG EXEC] exit _sys_kill_application() : %s will be killed\n", name ); 287 258 #endif 288 259 … … 848 819 } 849 820 821 ///////////////////////////////////////// 822 // NOTE: not a syscall 823 int _sys_tty_release() 824 { 825 // release one TTY terminal 826 _atomic_increment( &_tty_channel_allocator , 0xFFFFFFFF ); 827 828 return 0; 829 } 830 850 831 ///////////////////////////////////////////////// 851 832 int _sys_tty_write( const char* buffer, … … 942 923 return 0; 943 924 } 925 } 926 927 //////////////////// 928 // NOTE: not a syscall 929 int _sys_tim_release() 930 { 931 // release one timer 932 _atomic_increment( &_tim_channel_allocator, 0xFFFFFFFF ); 933 934 return 0; 944 935 } 945 936 … … 1225 1216 return nic_channel; 1226 1217 } // end _sys_nic_alloc() 1218 1219 1220 //////////////////////////////////////// 1221 // NOTE: not a syscall 1222 int _sys_nic_release( unsigned int is_rx ) 1223 { 1224 if ( is_rx ) 1225 _atomic_increment( &_nic_rx_channel_allocator , 0xFFFFFFFF ); 1226 else 1227 _atomic_increment( &_nic_tx_channel_allocator , 0xFFFFFFFF ); 1228 1229 return 0; 1230 } 1227 1231 1228 1232
Note: See TracChangeset
for help on using the changeset viewer.