Ignore:
Timestamp:
Jul 4, 2012, 2:51:18 PM (12 years ago)
Author:
alain
Message:

Introducing various modifications in kernel initialisation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/sys/irq_handler.c

    r160 r165  
    2929// This functions uses an external ICU component (Interrupt Controler Unit)
    3030// that concentrates up to 32 input interrupts lines. This component
    31 // can support up to NB_PROCS_MAX output IRQ.
     31// can support up to NB_PROCS output IRQ.
    3232//
    3333// This component returns the highest priority active interrupt index (smaller
     
    3838// The interrupt vector (32 ISR addresses array stored at _interrupt_vector
    3939// address) is initialised with the default ISR address. The actual ISR
    40 // addresses are supposed to be written in the interrupt vector array by the
    41 // boot code.
     40// addresses are supposed to be written in the interrupt vector array
     41// during system initialisation.
    4242///////////////////////////////////////////////////////////////////////////////////
    4343void _int_demux(void)
    4444{
    45     int interrupt_index;
    46     _isr_func_t isr;
    47 
    48     // interrupt vector initialisation
    49 
    50 
    51     /* retrieves the highest priority active interrupt index */
    52     if (!_icu_read(ICU_IT_VECTOR, (unsigned int*)&interrupt_index))
     45    int                         interrupt_index;
     46    _isr_func_t         isr;
     47    unsigned int        pid = _procid();
     48
     49    // retrieves the highest priority active interrupt index
     50    if (!_icu_read( pid / NB_PROCS,
     51                    pid % NB_PROCS,
     52                    ICU_IT_VECTOR,
     53                    (unsigned int*)&interrupt_index ) )
    5354    {
    54         /* no interrupt is active */
    55         if (interrupt_index == -1)
     55        if (interrupt_index == -1)      // no interrupt is active
    5656            return;
    5757
    58         /* call the ISR corresponding to this index */
    5958        isr = _interrupt_vector[interrupt_index];
    6059        isr();
    6160    }
     61    else
     62    {
     63        _puts("\n[GIET ERROR] In _demux function : wrong arguments in _icu_read()\n");
     64        _exit();
     65    }
    6266}
    6367///////////////////////////////////////////////////////////////////////////////////
     
    7074    _puts("\n\n!!! Default ISR !!!\n");
    7175}
     76
    7277///////////////////////////////////////////////////////////////////////////////////
    7378//      _isr_dma()
    74 // This ISR acknowledges the interrupt from the dma controller, depending on
    75 // the proc_id. It reset the global variable _dma_busy[i] for software
    76 // signaling, after copying the DMA status into the _dma_status[i] variable.
    77 ///////////////////////////////////////////////////////////////////////////////////
    78 void _isr_dma()
     79// This ISR handles up to 8 IRQs generated by 8 independant channels of the
     80// multi_dma component. It acknowledges the interrupt and reset the synchronisation
     81// variable _dma_busy[i], after copying the status into the _dma_status[i] variable.
     82///////////////////////////////////////////////////////////////////////////////////
     83void _isr_dma_indexed( unsigned int dma_id )
    7984{
    8085    volatile unsigned int* dma_address;
    81     unsigned int proc_id;
    82 
    83     proc_id = _procid();
    84     dma_address = (unsigned int*)&seg_dma_base + (proc_id * DMA_SPAN);
    85 
    86     _dma_status[proc_id] = dma_address[DMA_LEN]; /* save status */
    87     _dma_busy[proc_id] = 0;                      /* release DMA */
    88     dma_address[DMA_RESET] = 0;                  /* reset IRQ */
    89 }
     86
     87    dma_address = (unsigned int*)&seg_dma_base + (dma_id * DMA_SPAN);
     88
     89    dma_address[DMA_RESET] = 0;                                 /* reset IRQ */
     90
     91    _dma_status[dma_id] = dma_address[DMA_LEN]; /* save status */
     92    _dma_busy[dma_id] = 0;                      /* release DMA */
     93}
     94
     95void _isr_dma_0() { _isr_dma_indexed(0); }
     96void _isr_dma_1() { _isr_dma_indexed(1); }
     97void _isr_dma_2() { _isr_dma_indexed(2); }
     98void _isr_dma_3() { _isr_dma_indexed(3); }
     99void _isr_dma_4() { _isr_dma_indexed(4); }
     100void _isr_dma_5() { _isr_dma_indexed(5); }
     101void _isr_dma_6() { _isr_dma_indexed(6); }
     102void _isr_dma_7() { _isr_dma_indexed(7); }
     103
    90104///////////////////////////////////////////////////////////////////////////////////
    91105//      _isr_ioc()
     
    103117    _ioc_done   = 1;                                /* signals completion */
    104118}
     119
    105120///////////////////////////////////////////////////////////////////////////////////
    106121//      _isr_timer_* (* = 0,1,2,3,4,5,6,7)
Note: See TracChangeset for help on using the changeset viewer.