Changes in kernel/arch/ia32/src/interrupt.c [d19b3fc:fd67c9f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/interrupt.c
rd19b3fc rfd67c9f 39 39 #include <debug.h> 40 40 #include <panic.h> 41 #include < arch/drivers/i8259.h>41 #include <genarch/drivers/i8259/i8259.h> 42 42 #include <halt.h> 43 43 #include <cpu.h> … … 63 63 void (*disable_irqs_function)(uint16_t irqmask) = NULL; 64 64 void (*enable_irqs_function)(uint16_t irqmask) = NULL; 65 void (*eoi_function)( void) = NULL;65 void (*eoi_function)(unsigned int) = NULL; 66 66 const char *irqs_info = NULL; 67 67 … … 90 90 } 91 91 92 static void trap_virtual_eoi( void)92 static void trap_virtual_eoi(unsigned int inum) 93 93 { 94 94 if (eoi_function) 95 eoi_function( );95 eoi_function(inum); 96 96 else 97 97 panic("No eoi_function."); … … 179 179 istate_t *istate __attribute__((unused))) 180 180 { 181 trap_virtual_eoi( );181 trap_virtual_eoi(0); 182 182 tlb_shootdown_ipi_recv(); 183 183 } … … 192 192 bool ack = false; 193 193 assert(inum < IRQ_COUNT); 194 assert( (inum != IRQ_PIC_SPUR) && (inum != IRQ_PIC1));194 assert(inum != IRQ_PIC1); 195 195 196 196 irq_t *irq = irq_dispatch_and_lock(inum); … … 202 202 if (irq->preack) { 203 203 /* Send EOI before processing the interrupt */ 204 trap_virtual_eoi( );204 trap_virtual_eoi(inum); 205 205 ack = true; 206 206 } … … 208 208 irq_spinlock_unlock(&irq->lock, false); 209 209 } else { 210 /*211 * Spurious interrupt.212 */213 210 #ifdef CONFIG_DEBUG 214 printf("cpu%u: spurious interrupt (inum=%u)\n", CPU->id, inum); 211 log(LF_ARCH, LVL_DEBUG, "cpu%u: unhandled IRQ %u", CPU->id, 212 inum); 215 213 #endif 216 214 } 217 215 218 216 if (!ack) 219 trap_virtual_eoi(); 217 trap_virtual_eoi(inum); 218 } 219 220 static void pic_spurious(unsigned int n, istate_t *istate) 221 { 222 unsigned int inum = n - IVT_IRQBASE; 223 if (!pic_is_spurious(inum)) { 224 /* This is actually not a spurious IRQ, so proceed as usual. */ 225 irq_interrupt(n, istate); 226 return; 227 } 228 pic_handle_spurious(n); 229 #ifdef CONFIG_DEBUG 230 log(LF_ARCH, LVL_DEBUG, "cpu%u: PIC spurious interrupt %u", CPU->id, 231 inum); 232 #endif 220 233 } 221 234 … … 228 241 229 242 for (i = 0; i < IRQ_COUNT; i++) { 230 if ((i != IRQ_PIC_SPUR) && (i != IRQ_PIC1)) 243 if ((i != IRQ_PIC0_SPUR) && (i != IRQ_PIC1_SPUR) && 244 (i != IRQ_PIC1)) 231 245 exc_register(IVT_IRQBASE + i, "irq", true, 232 246 (iroutine_t) irq_interrupt); … … 239 253 exc_register(VECTOR_GP, "gp_fault", true, (iroutine_t) gp_fault); 240 254 exc_register(VECTOR_XM, "simd_fp", true, (iroutine_t) simd_fp_exception); 255 exc_register(VECTOR_PIC0_SPUR, "pic0_spurious", true, 256 (iroutine_t) pic_spurious); 257 exc_register(VECTOR_PIC1_SPUR, "pic1_spurious", true, 258 (iroutine_t) pic_spurious); 241 259 242 260 #ifdef CONFIG_SMP
Note:
See TracChangeset
for help on using the changeset viewer.