244,6 → 244,7 |
void external_interrupt(uint64_t vector, istate_t *istate) |
{ |
cr_ivr_t ivr; |
irq_t *irq; |
|
ivr.value = ivr_read(); |
srlz_d(); |
263,34 → 264,28 |
#endif |
|
case INTERRUPT_TIMER: |
{ |
|
irq_t *irq = irq_dispatch_and_lock(ivr.vector); |
irq = irq_dispatch_and_lock(ivr.vector); |
if (irq) { |
irq->handler(irq, irq->arg); |
spinlock_unlock(&irq->lock); |
} else { |
panic("\nUnhandled Internal Timer Interrupt (%d)\n",ivr.vector); |
panic("\nUnhandled Internal Timer Interrupt (%d)\n", |
ivr.vector); |
} |
} |
break; |
|
default: |
{ |
|
int ack=false; |
irq_t *irq = irq_dispatch_and_lock(ivr.vector); |
irq = irq_dispatch_and_lock(ivr.vector); |
if (irq) { |
/* |
* The IRQ handler was found. |
*/ |
|
if (irq->preack) { |
/* Send EOI before processing the interrupt */ |
end_of_local_irq(); |
ack=true; |
} |
irq->handler(irq, irq->arg); |
if (!irq->preack) |
end_of_local_irq(); |
spinlock_unlock(&irq->lock); |
} else { |
/* |
297,16 → 292,11 |
* Unhandled interrupt. |
*/ |
end_of_local_irq(); |
ack=true; |
#ifdef CONFIG_DEBUG |
printf("\nUnhandled External Interrupt Vector %d\n",ivr.vector); |
printf("\nUnhandled External Interrupt Vector %d\n", |
ivr.vector); |
#endif |
} |
if(!ack) end_of_local_irq(); |
|
} |
|
|
break; |
} |
} |