Skip to content
Snippets Groups Projects
Commit 8125c980 authored by Michal Simek's avatar Michal Simek
Browse files

microblaze: Fix interrupt handler code


It is better to read ivr and react on it than do long parsing from
two regs. Interrupt controller returs actual irq number.

Signed-off-by: default avatarMichal Simek <monstr@monstr.eu>
parent b2664097
No related branches found
No related tags found
No related merge requests found
...@@ -141,8 +141,8 @@ int interrupts_init (void) ...@@ -141,8 +141,8 @@ int interrupts_init (void)
void interrupt_handler (void) void interrupt_handler (void)
{ {
int irqs = (intc->isr & intc->ier); /* find active interrupt */ int irqs = intc->ivr; /* find active interrupt */
int i = 1; int mask = 1;
#ifdef DEBUG_INT #ifdef DEBUG_INT
int value; int value;
printf ("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier, printf ("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
...@@ -150,23 +150,17 @@ void interrupt_handler (void) ...@@ -150,23 +150,17 @@ void interrupt_handler (void)
R14(value); R14(value);
printf ("Interrupt handler on %x line, r14 %x\n", irqs, value); printf ("Interrupt handler on %x line, r14 %x\n", irqs, value);
#endif #endif
struct irq_action *act = vecs; struct irq_action *act = vecs + irqs;
while (irqs) {
if (irqs & 1) { intc->iar = mask << irqs;
#ifdef DEBUG_INT #ifdef DEBUG_INT
printf printf
("Jumping to interrupt handler rutine addr %x,count %x,arg %x\n", ("Jumping to interrupt handler rutine addr %x,count %x,arg %x\n",
act->handler, act->count, act->arg); act->handler, act->count, act->arg);
#endif #endif
act->handler (act->arg); act->handler (act->arg);
act->count++; act->count++;
intc->iar = i;
return;
}
irqs >>= 1;
act++;
i <<= 1;
}
#ifdef DEBUG_INT #ifdef DEBUG_INT
printf ("Dump INTC reg, isr %x, ier %x, iar %x, mer %x\n", intc->isr, printf ("Dump INTC reg, isr %x, ier %x, iar %x, mer %x\n", intc->isr,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment