sh: convert /proc/cpu/aligmnent, /proc/cpu/kernel_alignment to seq_file
[safe/jmp/linux-2.6] / arch / mips / kernel / irq.c
index aeded6c..7b845ba 100644 (file)
 #include <linux/sched.h>
 #include <linux/seq_file.h>
 #include <linux/kallsyms.h>
+#include <linux/kgdb.h>
 
 #include <asm/atomic.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 
+#ifdef CONFIG_KGDB
+int kgdb_early_setup;
+#endif
+
 static unsigned long irq_map[NR_IRQS / BITS_PER_LONG];
 
 int allocate_irqno(void)
@@ -44,8 +49,6 @@ again:
        return irq;
 }
 
-EXPORT_SYMBOL_GPL(allocate_irqno);
-
 /*
  * Allocate the 16 legacy interrupts for i8259 devices.  This happens early
  * in the kernel initialization so treating allocation failure as BUG() is
@@ -66,28 +69,18 @@ void free_irqno(unsigned int irq)
        smp_mb__after_clear_bit();
 }
 
-EXPORT_SYMBOL_GPL(free_irqno);
-
 /*
  * 'what should we do if we get a hw irq event on an illegal vector'.
  * each architecture has to answer this themselves.
  */
 void ack_bad_irq(unsigned int irq)
 {
+       smtc_im_ack_irq(irq);
        printk("unexpected IRQ # %d\n", irq);
 }
 
 atomic_t irq_err_count;
 
-#ifdef CONFIG_MIPS_MT_SMTC
-/*
- * SMTC Kernel needs to manipulate low-level CPU interrupt mask
- * in do_IRQ. These are passed in setup_irq_smtc() and stored
- * in this table.
- */
-unsigned long irq_hwmask[NR_IRQS];
-#endif /* CONFIG_MIPS_MT_SMTC */
-
 /*
  * Generic, controller-independent functions:
  */
@@ -101,7 +94,7 @@ int show_interrupts(struct seq_file *p, void *v)
        if (i == 0) {
                seq_printf(p, "           ");
                for_each_online_cpu(j)
-                       seq_printf(p, "CPU%d       ",j);
+                       seq_printf(p, "CPU%d       ", j);
                seq_putc(p, '\n');
        }
 
@@ -110,12 +103,12 @@ int show_interrupts(struct seq_file *p, void *v)
                action = irq_desc[i].action;
                if (!action)
                        goto skip;
-               seq_printf(p, "%3d: ",i);
+               seq_printf(p, "%3d: ", i);
 #ifndef CONFIG_SMP
                seq_printf(p, "%10u ", kstat_irqs(i));
 #else
                for_each_online_cpu(j)
-                       seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
+                       seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
 #endif
                seq_printf(p, " %14s", irq_desc[i].chip->name);
                seq_printf(p, "  %s", action->name);
@@ -138,28 +131,22 @@ asmlinkage void spurious_interrupt(void)
        atomic_inc(&irq_err_count);
 }
 
-#ifdef CONFIG_KGDB
-extern void breakpoint(void);
-extern void set_debug_traps(void);
-
-static int kgdb_flag = 1;
-static int __init nokgdb(char *str)
+void __init init_IRQ(void)
 {
-       kgdb_flag = 0;
-       return 1;
-}
-__setup("nokgdb", nokgdb);
+       int i;
+
+#ifdef CONFIG_KGDB
+       if (kgdb_early_setup)
+               return;
 #endif
 
-void __init init_IRQ(void)
-{
+       for (i = 0; i < NR_IRQS; i++)
+               set_irq_noprobe(i);
+
        arch_init_irq();
 
 #ifdef CONFIG_KGDB
-       if (kgdb_flag) {
-               printk("Wait for gdb client connection ...\n");
-               set_debug_traps();
-               breakpoint();
-       }
+       if (!kgdb_early_setup)
+               kgdb_early_setup = 1;
 #endif
 }