Changeset 697 for soft/giet_vm/giet_kernel
- Timestamp:
- Aug 7, 2015, 5:42:06 PM (9 years ago)
- Location:
- soft/giet_vm/giet_kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/ctx_handler.c
r696 r697 30 30 static_scheduler_t* psched = (static_scheduler_t*)_get_sched(); 31 31 32 // pretend the task to kill is scheduled (required for sys_handler calls) 33 unsigned int cur_task = psched->current; 34 psched->current = ltid; 35 32 36 // release private TTY terminal if required 33 37 if ( psched->context[ltid][CTX_TTY_ID] < NB_TTY_CHANNELS ) 34 38 { 35 psched->context[ltid][CTX_TTY_ID] = 0xFFFFFFFF;36 39 _sys_tty_release(); 40 psched->context[ltid][CTX_TTY_ID] = -1; 37 41 } 38 42 … … 40 44 if ( psched->context[ltid][CTX_TIM_ID] < NB_TIM_CHANNELS ) 41 45 { 42 psched->context[ltid][CTX_TIM_ID] = 0xFFFFFFFF;43 46 _sys_tim_release(); 47 psched->context[ltid][CTX_TIM_ID] = -1; 44 48 } 45 49 … … 47 51 if ( psched->context[ltid][CTX_NIC_RX_ID] < NB_NIC_CHANNELS ) 48 52 { 49 psched->context[ltid][CTX_NIC_RX_ID] = 0xFFFFFFFF;50 53 _sys_nic_release( 1 ); 54 psched->context[ltid][CTX_NIC_RX_ID] = -1; 51 55 } 52 56 … … 54 58 if ( psched->context[ltid][CTX_NIC_TX_ID] < NB_NIC_CHANNELS ) 55 59 { 56 psched->context[ltid][CTX_NIC_TX_ID] = 0xFFFFFFFF;57 60 _sys_nic_release( 0 ); 58 } 61 psched->context[ltid][CTX_NIC_TX_ID] = -1; 62 } 63 64 // restore scheduled task 65 psched->current = cur_task; 59 66 60 67 // set NORUN_MASK_TASK bit -
soft/giet_vm/giet_kernel/irq_handler.c
r648 r697 206 206 //////////////////////////////////////////// 207 207 void _ext_irq_release( unsigned int isr_type, 208 unsigned int isr_channel ,209 unsigned int wti_index ) 210 { 208 unsigned int isr_channel ) 209 { 210 unsigned int wti_id; // allocated WTI mailbox index in XCU 211 211 unsigned int irq_id; // external IRQ index in PIC (input) 212 212 … … 230 230 } 231 231 232 // find WTI index 233 static_scheduler_t* psched = (static_scheduler_t*)_get_sched(); 234 for ( wti_id = 0 ; wti_id < 32 ; wti_id++ ) 235 { 236 if ( psched->wti_vector[wti_id] == (isr_channel<<16 | isr_type) ) 237 break; 238 } 239 if ( wti_id == 32 ) 240 { 241 _printf("\n[GIET ERROR] in _ext_irq_release() : isr not found\n"); 242 return; 243 } 244 232 245 // desactivates dynamically allocated PIC entry 233 246 irq_id = _ext_irq_index[isr_type][isr_channel]; … … 235 248 236 249 // releases dynamically allocated WTI mailbox 237 if ( wti_i ndex== p + NB_PROCS_MAX ) _wti_alloc_one[x][y][p] = 0;238 else if ( wti_i ndex== p + 2*NB_PROCS_MAX ) _wti_alloc_two[x][y][p] = 0;239 else if ( wti_i ndex== p + 3*NB_PROCS_MAX ) _wti_alloc_ter[x][y][p] = 0;250 if ( wti_id == p + NB_PROCS_MAX ) _wti_alloc_one[x][y][p] = 0; 251 else if ( wti_id == p + 2*NB_PROCS_MAX ) _wti_alloc_two[x][y][p] = 0; 252 else if ( wti_id == p + 3*NB_PROCS_MAX ) _wti_alloc_ter[x][y][p] = 0; 240 253 else 241 254 { -
soft/giet_vm/giet_kernel/irq_handler.h
r629 r697 96 96 97 97 extern void _ext_irq_release( unsigned int isr_type, 98 unsigned int isr_channel, 99 unsigned int wti_index ); 98 unsigned int isr_channel ); 100 99 101 100 /////////////////////////////////////////////////////////////////////////// -
soft/giet_vm/giet_kernel/sys_handler.c
r696 r697 797 797 int _sys_tty_release() 798 798 { 799 // release WTI mailbox 800 if ( USE_PIC ) _ext_irq_release( ISR_TTY_RX , _get_context_slot( CTX_TTY_ID ) ); 801 799 802 // release one TTY terminal 800 803 _atomic_increment( &_tty_channel_allocator , 0xFFFFFFFF );
Note: See TracChangeset
for help on using the changeset viewer.