Changeset 165 for soft/giet_vm/sys/irq_handler.c
- Timestamp:
- Jul 4, 2012, 2:51:18 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/sys/irq_handler.c
r160 r165 29 29 // This functions uses an external ICU component (Interrupt Controler Unit) 30 30 // that concentrates up to 32 input interrupts lines. This component 31 // can support up to NB_PROCS _MAXoutput IRQ.31 // can support up to NB_PROCS output IRQ. 32 32 // 33 33 // This component returns the highest priority active interrupt index (smaller … … 38 38 // The interrupt vector (32 ISR addresses array stored at _interrupt_vector 39 39 // address) is initialised with the default ISR address. The actual ISR 40 // addresses are supposed to be written in the interrupt vector array by the41 // boot code.40 // addresses are supposed to be written in the interrupt vector array 41 // during system initialisation. 42 42 /////////////////////////////////////////////////////////////////////////////////// 43 43 void _int_demux(void) 44 44 { 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 ) ) 53 54 { 54 /* no interrupt is active */ 55 if (interrupt_index == -1) 55 if (interrupt_index == -1) // no interrupt is active 56 56 return; 57 57 58 /* call the ISR corresponding to this index */59 58 isr = _interrupt_vector[interrupt_index]; 60 59 isr(); 61 60 } 61 else 62 { 63 _puts("\n[GIET ERROR] In _demux function : wrong arguments in _icu_read()\n"); 64 _exit(); 65 } 62 66 } 63 67 /////////////////////////////////////////////////////////////////////////////////// … … 70 74 _puts("\n\n!!! Default ISR !!!\n"); 71 75 } 76 72 77 /////////////////////////////////////////////////////////////////////////////////// 73 78 // _isr_dma() 74 // This ISR acknowledges the interrupt from the dma controller, depending on75 // the proc_id. It reset the global variable _dma_busy[i] for software76 // signaling, after copying the DMAstatus 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 /////////////////////////////////////////////////////////////////////////////////// 83 void _isr_dma_indexed( unsigned int dma_id ) 79 84 { 80 85 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 95 void _isr_dma_0() { _isr_dma_indexed(0); } 96 void _isr_dma_1() { _isr_dma_indexed(1); } 97 void _isr_dma_2() { _isr_dma_indexed(2); } 98 void _isr_dma_3() { _isr_dma_indexed(3); } 99 void _isr_dma_4() { _isr_dma_indexed(4); } 100 void _isr_dma_5() { _isr_dma_indexed(5); } 101 void _isr_dma_6() { _isr_dma_indexed(6); } 102 void _isr_dma_7() { _isr_dma_indexed(7); } 103 90 104 /////////////////////////////////////////////////////////////////////////////////// 91 105 // _isr_ioc() … … 103 117 _ioc_done = 1; /* signals completion */ 104 118 } 119 105 120 /////////////////////////////////////////////////////////////////////////////////// 106 121 // _isr_timer_* (* = 0,1,2,3,4,5,6,7)
Note: See TracChangeset
for help on using the changeset viewer.