]> git.sur5r.net Git - u-boot/blobdiff - lib_m68k/interrupts.c
Blackfin: TWI/I2C: implement bus speed get/set functions
[u-boot] / lib_m68k / interrupts.c
index 6b3ce8975dbb2e85e234ff08f6e107124f6747b0..133494f6dcc3268ed8e62d1924570cefbf656e9c 100644 (file)
@@ -2,7 +2,7 @@
  * (C) Copyright 2000-2004
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * (C) Copyright 2007
+ * (C) Copyright 2007 Freescale Semiconductor Inc
  * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
  *
  * See file CREDITS for list of people who contributed to this
@@ -27,9 +27,9 @@
 #include <common.h>
 #include <watchdog.h>
 #include <asm/processor.h>
+#include <asm/immap.h>
 
-#ifdef CONFIG_MCFINTC
-#define        NR_IRQS         (CFG_NUM_IRQS)
+#define        NR_IRQS         (CONFIG_SYS_NUM_IRQS)
 
 /*
  * Interrupt vector functions.
@@ -61,7 +61,7 @@ static __inline__ void set_sr (unsigned short sr)
  */
 void irq_install_handler (int vec, interrupt_handler_t * handler, void *arg)
 {
-       if ((vec < 0) || (vec > NR_IRQS)) {
+       if ((vec < 0) || (vec >= NR_IRQS)) {
                printf ("irq_install_handler: wrong interrupt vector %d\n",
                        vec);
                return;
@@ -73,7 +73,7 @@ void irq_install_handler (int vec, interrupt_handler_t * handler, void *arg)
 
 void irq_free_handler (int vec)
 {
-       if ((vec < 0) || (vec > NR_IRQS)) {
+       if ((vec < 0) || (vec >= NR_IRQS)) {
                return;
        }
 
@@ -106,8 +106,6 @@ void int_handler (struct pt_regs *fp)
        vec = (fp->vector >> 2) & 0xff;
        if (vec > 0x40)
                vec -= 0x40;
-       else
-               return;
 
        if (irq_vecs[vec].handler != NULL) {
                irq_vecs[vec].handler (irq_vecs[vec].arg);
@@ -115,4 +113,3 @@ void int_handler (struct pt_regs *fp)
                printf ("\nBogus External Interrupt Vector %d\n", vec);
        }
 }
-#endif /* CONFIG_MCFINTC */
\ No newline at end of file