summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2010-04-16 11:51:59 +0200
committerMichal Simek <monstr@monstr.eu>2010-04-16 12:15:34 +0200
commit8125c980cc282000cbddb415f8ddbebf96e4edb4 (patch)
treec60dcc9074a8a51de707f0db533d09c7695639e4 /arch
parentb26640971a7ba8800f0eb32af145ff0727fe21fe (diff)
downloadu-boot-imx-8125c980cc282000cbddb415f8ddbebf96e4edb4.zip
u-boot-imx-8125c980cc282000cbddb415f8ddbebf96e4edb4.tar.gz
u-boot-imx-8125c980cc282000cbddb415f8ddbebf96e4edb4.tar.bz2
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: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch')
-rw-r--r--arch/microblaze/cpu/interrupts.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/arch/microblaze/cpu/interrupts.c b/arch/microblaze/cpu/interrupts.c
index 0fe9f5c..7a9d022 100644
--- a/arch/microblaze/cpu/interrupts.c
+++ b/arch/microblaze/cpu/interrupts.c
@@ -141,8 +141,8 @@ int interrupts_init (void)
void interrupt_handler (void)
{
- int irqs = (intc->isr & intc->ier); /* find active interrupt */
- int i = 1;
+ int irqs = intc->ivr; /* find active interrupt */
+ int mask = 1;
#ifdef DEBUG_INT
int value;
printf ("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
@@ -150,23 +150,17 @@ void interrupt_handler (void)
R14(value);
printf ("Interrupt handler on %x line, r14 %x\n", irqs, value);
#endif
- struct irq_action *act = vecs;
- while (irqs) {
- if (irqs & 1) {
+ struct irq_action *act = vecs + irqs;
+
+ intc->iar = mask << irqs;
+
#ifdef DEBUG_INT
- printf
- ("Jumping to interrupt handler rutine addr %x,count %x,arg %x\n",
- act->handler, act->count, act->arg);
+ printf
+ ("Jumping to interrupt handler rutine addr %x,count %x,arg %x\n",
+ act->handler, act->count, act->arg);
#endif
- act->handler (act->arg);
- act->count++;
- intc->iar = i;
- return;
- }
- irqs >>= 1;
- act++;
- i <<= 1;
- }
+ act->handler (act->arg);
+ act->count++;
#ifdef DEBUG_INT
printf ("Dump INTC reg, isr %x, ier %x, iar %x, mer %x\n", intc->isr,