fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / sparc / kernel / sun4c_irq.c
index ca790d4..009e891 100644 (file)
@@ -9,7 +9,6 @@
  *  Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk)
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/linkage.h>
 #include <linux/kernel_stat.h>
@@ -50,7 +49,7 @@ static struct resource sun4c_intr_eb = { "sun4c_intr" };
  *
  * so don't go making it static, like I tried. sigh.
  */
-unsigned char *interrupt_enable = 0;
+unsigned char *interrupt_enable = NULL;
 
 static int sun4c_pil_map[] = { 0, 1, 2, 3, 5, 7, 8, 9 };
 
@@ -155,7 +154,7 @@ static void sun4c_load_profile_irq(int cpu, unsigned int limit)
        /* Errm.. not sure how to do this.. */
 }
 
-static void __init sun4c_init_timers(irqreturn_t (*counter_fn)(int, void *, struct pt_regs *))
+static void __init sun4c_init_timers(irq_handler_t counter_fn)
 {
        int irq;
 
@@ -180,7 +179,7 @@ static void __init sun4c_init_timers(irqreturn_t (*counter_fn)(int, void *, stru
 
        irq = request_irq(TIMER_IRQ,
                          counter_fn,
-                         (SA_INTERRUPT | SA_STATIC_ALLOC),
+                         (IRQF_DISABLED | SA_STATIC_ALLOC),
                          "timer", NULL);
        if (irq) {
                prom_printf("time_init: unable to attach IRQ%d\n",TIMER_IRQ);
@@ -198,8 +197,6 @@ static void __init sun4c_init_timers(irqreturn_t (*counter_fn)(int, void *, stru
 static void sun4c_nop(void) {}
 #endif
 
-extern char *sun4m_irq_itoa(unsigned int irq);
-
 void __init sun4c_init_IRQ(void)
 {
        struct linux_prom_registers int_regs[2];
@@ -217,13 +214,18 @@ void __init sun4c_init_IRQ(void)
                        panic("Cannot find /interrupt-enable node");
 
                /* Depending on the "address" property is bad news... */
-               prom_getproperty(ie_node, "reg", (char *) int_regs, sizeof(int_regs));
-               memset(&phyres, 0, sizeof(struct resource));
-               phyres.flags = int_regs[0].which_io;
-               phyres.start = int_regs[0].phys_addr;
-               interrupt_enable = (char *) sbus_ioremap(&phyres, 0,
-                   int_regs[0].reg_size, "sun4c_intr");
+               interrupt_enable = NULL;
+               if (prom_getproperty(ie_node, "reg", (char *) int_regs,
+                                    sizeof(int_regs)) != -1) {
+                       memset(&phyres, 0, sizeof(struct resource));
+                       phyres.flags = int_regs[0].which_io;
+                       phyres.start = int_regs[0].phys_addr;
+                       interrupt_enable = (char *) sbus_ioremap(&phyres, 0,
+                           int_regs[0].reg_size, "sun4c_intr");
+               }
        }
+       if (!interrupt_enable)
+               panic("Cannot map interrupt_enable");
 
        BTFIXUPSET_CALL(sbint_to_irq, sun4c_sbint_to_irq, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(enable_irq, sun4c_enable_irq, BTFIXUPCALL_NORM);
@@ -233,7 +235,6 @@ void __init sun4c_init_IRQ(void)
        BTFIXUPSET_CALL(clear_clock_irq, sun4c_clear_clock_irq, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(clear_profile_irq, sun4c_clear_profile_irq, BTFIXUPCALL_NOP);
        BTFIXUPSET_CALL(load_profile_irq, sun4c_load_profile_irq, BTFIXUPCALL_NOP);
-       BTFIXUPSET_CALL(__irq_itoa, sun4m_irq_itoa, BTFIXUPCALL_NORM);
        sparc_init_timers = sun4c_init_timers;
 #ifdef CONFIG_SMP
        BTFIXUPSET_CALL(set_cpu_int, sun4c_nop, BTFIXUPCALL_NOP);