aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2006-08-15 19:59:40 -0400
committerRalf Baechle <ralf@linux-mips.org>2006-09-27 08:37:35 -0400
commitdc41fb43966ae1318fe34a8e5f959924a7c05d81 (patch)
tree4dbca3a63776353c118877c417d0f9a23d11b61e /arch/mips
parent73b76c78fdf3a25faecbffb52c925950d46152b6 (diff)
[MIPS] Fix 32-bit kernel by replacing 64-bit-only code.
dclz() expects its 64-bit argument being passed as a single register but on 32-bit kernels it'll actually be in a register pair. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/sibyte/bcm1480/irq.c19
-rw-r--r--arch/mips/sibyte/sb1250/irq.c17
2 files changed, 3 insertions, 33 deletions
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c
index ed325f0ab28a..a0222fa4416c 100644
--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -469,21 +469,6 @@ void bcm1480_kgdb_interrupt(struct pt_regs *regs)
469 469
470#endif /* CONFIG_KGDB */ 470#endif /* CONFIG_KGDB */
471 471
472static inline int dclz(unsigned long long x)
473{
474 int lz;
475
476 __asm__ (
477 " .set push \n"
478 " .set mips64 \n"
479 " dclz %0, %1 \n"
480 " .set pop \n"
481 : "=r" (lz)
482 : "r" (x));
483
484 return lz;
485}
486
487extern void bcm1480_timer_interrupt(struct pt_regs *regs); 472extern void bcm1480_timer_interrupt(struct pt_regs *regs);
488extern void bcm1480_mailbox_interrupt(struct pt_regs *regs); 473extern void bcm1480_mailbox_interrupt(struct pt_regs *regs);
489extern void bcm1480_kgdb_interrupt(struct pt_regs *regs); 474extern void bcm1480_kgdb_interrupt(struct pt_regs *regs);
@@ -536,9 +521,9 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
536 521
537 if (mask_h) { 522 if (mask_h) {
538 if (mask_h ^ 1) 523 if (mask_h ^ 1)
539 do_IRQ(63 - dclz(mask_h), regs); 524 do_IRQ(fls64(mask_h) - 1, regs);
540 else 525 else
541 do_IRQ(127 - dclz(mask_l), regs); 526 do_IRQ(63 + fls64(mask_l), regs);
542 } 527 }
543 } 528 }
544} 529}
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index 1de71adec6c6..a451b4c7732d 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -419,21 +419,6 @@ static void sb1250_kgdb_interrupt(struct pt_regs *regs)
419 419
420#endif /* CONFIG_KGDB */ 420#endif /* CONFIG_KGDB */
421 421
422static inline int dclz(unsigned long long x)
423{
424 int lz;
425
426 __asm__ (
427 " .set push \n"
428 " .set mips64 \n"
429 " dclz %0, %1 \n"
430 " .set pop \n"
431 : "=r" (lz)
432 : "r" (x));
433
434 return lz;
435}
436
437extern void sb1250_timer_interrupt(struct pt_regs *regs); 422extern void sb1250_timer_interrupt(struct pt_regs *regs);
438extern void sb1250_mailbox_interrupt(struct pt_regs *regs); 423extern void sb1250_mailbox_interrupt(struct pt_regs *regs);
439extern void sb1250_kgdb_interrupt(struct pt_regs *regs); 424extern void sb1250_kgdb_interrupt(struct pt_regs *regs);
@@ -490,6 +475,6 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
490 mask = __raw_readq(IOADDR(A_IMR_REGISTER(smp_processor_id(), 475 mask = __raw_readq(IOADDR(A_IMR_REGISTER(smp_processor_id(),
491 R_IMR_INTERRUPT_STATUS_BASE))); 476 R_IMR_INTERRUPT_STATUS_BASE)));
492 if (mask) 477 if (mask)
493 do_IRQ(63 - dclz(mask), regs); 478 do_IRQ(fls64(mask) - 1, regs);
494 } 479 }
495} 480}