Merge to Fedora kernel-2.6.18-1.2255_FC5 patched with stable patch-2.6.18.5-vs2.0...
[linux-2.6.git] / arch / sparc / kernel / sun4d_irq.c
index 5e9a705..74eed97 100644 (file)
@@ -6,7 +6,6 @@
  *  Heavily based on arch/sparc/kernel/irq.c.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/linkage.h>
 #include <linux/kernel_stat.h>
@@ -54,7 +53,7 @@ unsigned char cpu_leds[32];
 unsigned char sbus_tid[32];
 #endif
 
-extern struct irqaction *irq_action[];
+static struct irqaction *irq_action[NR_IRQS];
 extern spinlock_t irq_action_lock;
 
 struct sbus_action {
@@ -72,7 +71,7 @@ static int sbus_to_pil[] = {
 
 static int nsbi;
 #ifdef CONFIG_SMP
-spinlock_t sun4d_imsk_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(sun4d_imsk_lock);
 #endif
 
 int show_sun4d_interrupts(struct seq_file *p, void *v)
@@ -103,20 +102,18 @@ found_it: seq_printf(p, "%3d: ", i);
 #ifndef CONFIG_SMP
                seq_printf(p, "%10u ", kstat_irqs(i));
 #else
-               for (x = 0; x < NR_CPUS; x++) {
-                       if (cpu_online(x))
-                               seq_printf(p, "%10u ",
-                                      kstat_cpu(cpu_logical_map(x)).irqs[i]);
-               }
+               for_each_online_cpu(x)
+                       seq_printf(p, "%10u ",
+                              kstat_cpu(cpu_logical_map(x)).irqs[i]);
 #endif
                seq_printf(p, "%c %s",
-                       (action->flags & SA_INTERRUPT) ? '+' : ' ',
+                       (action->flags & IRQF_DISABLED) ? '+' : ' ',
                        action->name);
                action = action->next;
                for (;;) {
                        for (; action; action = action->next) {
                                seq_printf(p, ",%s %s",
-                                       (action->flags & SA_INTERRUPT) ? " +" : "",
+                                       (action->flags & IRQF_DISABLED) ? " +" : "",
                                        action->name);
                        }
                        if (!sbusl) break;
@@ -163,7 +160,7 @@ void sun4d_free_irq(unsigned int irq, void *dev_id)
                        printk("Trying to free free shared IRQ%d\n",irq);
                        goto out_unlock;
                }
-       } else if (action->flags & SA_SHIRQ) {
+       } else if (action->flags & IRQF_SHARED) {
                printk("Trying to free shared IRQ%d with NULL device ID\n", irq);
                goto out_unlock;
        }
@@ -216,7 +213,7 @@ void sun4d_handler_irq(int irq, struct pt_regs * regs)
        if (!sbusl) {
                action = *(irq + irq_action);
                if (!action)
-                       unexpected_irq(irq, 0, regs);
+                       unexpected_irq(irq, NULL, regs);
                do {
                        action->handler(irq, action->dev_id, regs);
                        action = action->next;
@@ -243,7 +240,7 @@ void sun4d_handler_irq(int irq, struct pt_regs * regs)
                                                action = actionp->action;
                                                
                                                if (!action)
-                                                       unexpected_irq(irq, 0, regs);
+                                                       unexpected_irq(irq, NULL, regs);
                                                do {
                                                        action->handler(irq, action->dev_id, regs);
                                                        action = action->next;
@@ -301,13 +298,13 @@ int sun4d_request_irq(unsigned int irq,
        action = *actionp;
        
        if (action) {
-               if ((action->flags & SA_SHIRQ) && (irqflags & SA_SHIRQ)) {
+               if ((action->flags & IRQF_SHARED) && (irqflags & IRQF_SHARED)) {
                        for (tmp = action; tmp->next; tmp = tmp->next);
                } else {
                        ret = -EBUSY;
                        goto out_unlock;
                }
-               if ((action->flags & SA_INTERRUPT) ^ (irqflags & SA_INTERRUPT)) {
+               if ((action->flags & IRQF_DISABLED) ^ (irqflags & IRQF_DISABLED)) {
                        printk("Attempt to mix fast and slow interrupts on IRQ%d denied\n", irq);
                        ret = -EBUSY;
                        goto out_unlock;
@@ -336,7 +333,7 @@ int sun4d_request_irq(unsigned int irq,
 
        action->handler = handler;
        action->flags = irqflags;
-       action->mask = 0;
+       cpus_clear(action->mask);
        action->name = devname;
        action->next = NULL;
        action->dev_id = dev_id;
@@ -493,7 +490,7 @@ static void __init sun4d_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);
@@ -562,17 +559,6 @@ void __init sun4d_init_sbi_irq(void)
        }
 }
 
-static char *sun4d_irq_itoa(unsigned int irq)
-{
-       static char buff[16];
-       
-       if (irq < (1 << 5))
-               sprintf(buff, "%d", irq);
-       else
-               sprintf(buff, "%d,%x", sbus_to_pil[(irq >> 2) & 7], irq);
-       return buff;
-}
-
 void __init sun4d_init_IRQ(void)
 {
        local_irq_disable();
@@ -583,7 +569,6 @@ void __init sun4d_init_IRQ(void)
        BTFIXUPSET_CALL(clear_clock_irq, sun4d_clear_clock_irq, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(clear_profile_irq, sun4d_clear_profile_irq, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(load_profile_irq, sun4d_load_profile_irq, BTFIXUPCALL_NORM);
-       BTFIXUPSET_CALL(__irq_itoa, sun4d_irq_itoa, BTFIXUPCALL_NORM);
        sparc_init_timers = sun4d_init_timers;
 #ifdef CONFIG_SMP
        BTFIXUPSET_CALL(set_cpu_int, sun4d_set_cpu_int, BTFIXUPCALL_NORM);