Ignore:
Timestamp:
Aug 7, 2015, 5:42:06 PM (9 years ago)
Author:
guerin
Message:

kernel: release WTI mailbox associated with TTY

We don't block on giet_tty_alloc() anymore when launching the same app
again and again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_kernel/ctx_handler.c

    r696 r697  
    3030    static_scheduler_t* psched = (static_scheduler_t*)_get_sched();
    3131
     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
    3236    // release private TTY terminal if required
    3337    if ( psched->context[ltid][CTX_TTY_ID] < NB_TTY_CHANNELS )
    3438    {
    35         psched->context[ltid][CTX_TTY_ID] = 0xFFFFFFFF;
    3639        _sys_tty_release();
     40        psched->context[ltid][CTX_TTY_ID] = -1;
    3741    }
    3842
     
    4044    if ( psched->context[ltid][CTX_TIM_ID] < NB_TIM_CHANNELS )
    4145    {
    42         psched->context[ltid][CTX_TIM_ID] = 0xFFFFFFFF;
    4346        _sys_tim_release();
     47        psched->context[ltid][CTX_TIM_ID] = -1;
    4448    }
    4549
     
    4751    if ( psched->context[ltid][CTX_NIC_RX_ID] < NB_NIC_CHANNELS )
    4852    {
    49         psched->context[ltid][CTX_NIC_RX_ID] = 0xFFFFFFFF;
    5053        _sys_nic_release( 1 );
     54        psched->context[ltid][CTX_NIC_RX_ID] = -1;
    5155    }
    5256
     
    5458    if ( psched->context[ltid][CTX_NIC_TX_ID] < NB_NIC_CHANNELS )
    5559    {
    56         psched->context[ltid][CTX_NIC_TX_ID] = 0xFFFFFFFF;
    5760        _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;
    5966
    6067    // set NORUN_MASK_TASK bit
Note: See TracChangeset for help on using the changeset viewer.