x86: use not_pci bitmap #4
[sfrench/cifs-2.6.git] / arch / x86 / kernel / irq_32.c
index e173b763f148ad6ae032e68b590f87f519ecb159..6ea67b76a21452f3b7ffacdec52ae8b155f2a21a 100644 (file)
@@ -66,11 +66,11 @@ static union irq_ctx *softirq_ctx[NR_CPUS] __read_mostly;
  * SMP cross-CPU interrupts have their own specific
  * handlers).
  */
-fastcall unsigned int do_IRQ(struct pt_regs *regs)
+unsigned int do_IRQ(struct pt_regs *regs)
 {      
        struct pt_regs *old_regs;
        /* high bit used in ret_from_ code */
-       int irq = ~regs->orig_eax;
+       int irq = ~regs->orig_ax;
        struct irq_desc *desc = irq_desc + irq;
 #ifdef CONFIG_4KSTACKS
        union irq_ctx *curctx, *irqctx;
@@ -79,7 +79,7 @@ fastcall unsigned int do_IRQ(struct pt_regs *regs)
 
        if (unlikely((unsigned)irq >= NR_IRQS)) {
                printk(KERN_EMERG "%s: cannot handle IRQ %d\n",
-                                       __FUNCTION__, irq);
+                                       __func__, irq);
                BUG();
        }
 
@@ -88,13 +88,13 @@ fastcall unsigned int do_IRQ(struct pt_regs *regs)
 #ifdef CONFIG_DEBUG_STACKOVERFLOW
        /* Debugging check for stack overflow: is there less than 1KB free? */
        {
-               long esp;
+               long sp;
 
                __asm__ __volatile__("andl %%esp,%0" :
-                                       "=r" (esp) : "0" (THREAD_SIZE - 1));
-               if (unlikely(esp < (sizeof(struct thread_info) + STACK_WARN))) {
+                                       "=r" (sp) : "0" (THREAD_SIZE - 1));
+               if (unlikely(sp < (sizeof(struct thread_info) + STACK_WARN))) {
                        printk("do_IRQ: stack overflow: %ld\n",
-                               esp - sizeof(struct thread_info));
+                               sp - sizeof(struct thread_info));
                        dump_stack();
                }
        }
@@ -112,7 +112,7 @@ fastcall unsigned int do_IRQ(struct pt_regs *regs)
         * current stack (which is the irq stack already after all)
         */
        if (curctx != irqctx) {
-               int arg1, arg2, ebx;
+               int arg1, arg2, bx;
 
                /* build the stack frame on the IRQ stack */
                isp = (u32*) ((char*)irqctx + sizeof(*irqctx));
@@ -128,10 +128,10 @@ fastcall unsigned int do_IRQ(struct pt_regs *regs)
                        (curctx->tinfo.preempt_count & SOFTIRQ_MASK);
 
                asm volatile(
-                       "       xchgl  %%ebx,%%esp      \n"
-                       "       call   *%%edi           \n"
-                       "       movl   %%ebx,%%esp      \n"
-                       : "=a" (arg1), "=d" (arg2), "=b" (ebx)
+                       "       xchgl  %%ebx,%%esp    \n"
+                       "       call   *%%edi         \n"
+                       "       movl   %%ebx,%%esp    \n"
+                       : "=a" (arg1), "=d" (arg2), "=b" (bx)
                        :  "0" (irq),   "1" (desc),  "2" (isp),
                           "D" (desc->handle_irq)
                        : "memory", "cc"
@@ -255,9 +255,17 @@ int show_interrupts(struct seq_file *p, void *v)
        }
 
        if (i < NR_IRQS) {
+               unsigned any_count = 0;
+
                spin_lock_irqsave(&irq_desc[i].lock, flags);
+#ifndef CONFIG_SMP
+               any_count = kstat_irqs(i);
+#else
+               for_each_online_cpu(j)
+                       any_count |= kstat_cpu(j).irqs[i];
+#endif
                action = irq_desc[i].action;
-               if (!action)
+               if (!action && !any_count)
                        goto skip;
                seq_printf(p, "%3d: ",i);
 #ifndef CONFIG_SMP
@@ -268,10 +276,12 @@ int show_interrupts(struct seq_file *p, void *v)
 #endif
                seq_printf(p, " %8s", irq_desc[i].chip->name);
                seq_printf(p, "-%-8s", irq_desc[i].name);
-               seq_printf(p, "  %s", action->name);
 
-               for (action=action->next; action; action = action->next)
-                       seq_printf(p, ", %s", action->name);
+               if (action) {
+                       seq_printf(p, "  %s", action->name);
+                       while ((action = action->next) != NULL)
+                               seq_printf(p, ", %s", action->name);
+               }
 
                seq_putc(p, '\n');
 skip:
@@ -280,14 +290,41 @@ skip:
                seq_printf(p, "NMI: ");
                for_each_online_cpu(j)
                        seq_printf(p, "%10u ", nmi_count(j));
-               seq_putc(p, '\n');
+               seq_printf(p, "  Non-maskable interrupts\n");
 #ifdef CONFIG_X86_LOCAL_APIC
                seq_printf(p, "LOC: ");
                for_each_online_cpu(j)
                        seq_printf(p, "%10u ",
                                per_cpu(irq_stat,j).apic_timer_irqs);
-               seq_putc(p, '\n');
+               seq_printf(p, "  Local timer interrupts\n");
 #endif
+#ifdef CONFIG_SMP
+               seq_printf(p, "RES: ");
+               for_each_online_cpu(j)
+                       seq_printf(p, "%10u ",
+                               per_cpu(irq_stat,j).irq_resched_count);
+               seq_printf(p, "  Rescheduling interrupts\n");
+               seq_printf(p, "CAL: ");
+               for_each_online_cpu(j)
+                       seq_printf(p, "%10u ",
+                               per_cpu(irq_stat,j).irq_call_count);
+               seq_printf(p, "  function call interrupts\n");
+               seq_printf(p, "TLB: ");
+               for_each_online_cpu(j)
+                       seq_printf(p, "%10u ",
+                               per_cpu(irq_stat,j).irq_tlb_count);
+               seq_printf(p, "  TLB shootdowns\n");
+#endif
+               seq_printf(p, "TRM: ");
+               for_each_online_cpu(j)
+                       seq_printf(p, "%10u ",
+                               per_cpu(irq_stat,j).irq_thermal_count);
+               seq_printf(p, "  Thermal event interrupts\n");
+               seq_printf(p, "SPU: ");
+               for_each_online_cpu(j)
+                       seq_printf(p, "%10u ",
+                               per_cpu(irq_stat,j).irq_spurious_count);
+               seq_printf(p, "  Spurious interrupts\n");
                seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
 #if defined(CONFIG_X86_IO_APIC)
                seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count));