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/irq_handler.c

    r648 r697  
    206206////////////////////////////////////////////
    207207void _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
    211211    unsigned int irq_id;        // external IRQ index in PIC (input)
    212212
     
    230230    }
    231231
     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
    232245    // desactivates dynamically allocated PIC entry
    233246    irq_id = _ext_irq_index[isr_type][isr_channel];
     
    235248
    236249    // releases dynamically allocated WTI mailbox
    237     if      ( wti_index == p +   NB_PROCS_MAX ) _wti_alloc_one[x][y][p] = 0;
    238     else if ( wti_index == p + 2*NB_PROCS_MAX ) _wti_alloc_two[x][y][p] = 0;
    239     else if ( wti_index == 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;
    240253    else
    241254    {
Note: See TracChangeset for help on using the changeset viewer.