Loading arch/x86/kernel/irq_64.c +24 −7 Original line number Original line Diff line number Diff line Loading @@ -70,9 +70,27 @@ static inline void stack_overflow_check(struct pt_regs *regs) int show_interrupts(struct seq_file *p, void *v) int show_interrupts(struct seq_file *p, void *v) { { int i = *(loff_t *) v, j; int i, j; struct irqaction * action; struct irqaction * action; unsigned long flags; unsigned long flags; unsigned int entries; struct irq_desc *desc; int tail = 0; #ifdef CONFIG_HAVE_SPARSE_IRQ desc = (struct irq_desc *)v; entries = -1U; i = desc->irq; if (!desc->next) tail = 1; #else entries = nr_irqs - 1; i = *(loff_t *) v; if (i == nr_irqs) tail = 1; else desc = irq_to_desc(i); #endif if (i == 0) { if (i == 0) { seq_printf(p, " "); seq_printf(p, " "); Loading @@ -81,12 +99,8 @@ int show_interrupts(struct seq_file *p, void *v) seq_putc(p, '\n'); seq_putc(p, '\n'); } } if (i < nr_irqs) { if (i <= entries) { unsigned any_count = 0; unsigned any_count = 0; struct irq_desc *desc = irq_to_desc(i); if (!desc) return 0; spin_lock_irqsave(&desc->lock, flags); spin_lock_irqsave(&desc->lock, flags); #ifndef CONFIG_SMP #ifndef CONFIG_SMP Loading Loading @@ -116,7 +130,9 @@ int show_interrupts(struct seq_file *p, void *v) seq_putc(p, '\n'); seq_putc(p, '\n'); skip: skip: spin_unlock_irqrestore(&desc->lock, flags); spin_unlock_irqrestore(&desc->lock, flags); } else if (i == nr_irqs) { } if (tail) { seq_printf(p, "NMI: "); seq_printf(p, "NMI: "); for_each_online_cpu(j) for_each_online_cpu(j) seq_printf(p, "%10u ", cpu_pda(j)->__nmi_count); seq_printf(p, "%10u ", cpu_pda(j)->__nmi_count); Loading Loading @@ -155,6 +171,7 @@ int show_interrupts(struct seq_file *p, void *v) seq_printf(p, " Spurious interrupts\n"); seq_printf(p, " Spurious interrupts\n"); seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); } } return 0; return 0; } } Loading fs/proc/proc_misc.c +24 −4 Original line number Original line Diff line number Diff line Loading @@ -645,15 +645,36 @@ static const struct file_operations proc_stat_operations = { */ */ static void *int_seq_start(struct seq_file *f, loff_t *pos) static void *int_seq_start(struct seq_file *f, loff_t *pos) { { #ifdef CONFIG_HAVE_SPARSE_IRQ struct irq_desc *desc; int irq; int count = *pos; for_each_irq_desc(irq, desc) { if (count-- == 0) return desc; } return NULL; #else return (*pos <= nr_irqs) ? pos : NULL; return (*pos <= nr_irqs) ? pos : NULL; #endif } } static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos) static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos) { { #ifdef CONFIG_HAVE_SPARSE_IRQ struct irq_desc *desc; desc = ((struct irq_desc *)v)->next; (*pos)++; (*pos)++; if (*pos > nr_irqs) return NULL; return desc; return pos; #else (*pos)++; return (*pos <= nr_irqs) ? pos : NULL; #endif } } static void int_seq_stop(struct seq_file *f, void *v) static void int_seq_stop(struct seq_file *f, void *v) Loading @@ -661,7 +682,6 @@ static void int_seq_stop(struct seq_file *f, void *v) /* Nothing to do */ /* Nothing to do */ } } static const struct seq_operations int_seq_ops = { static const struct seq_operations int_seq_ops = { .start = int_seq_start, .start = int_seq_start, .next = int_seq_next, .next = int_seq_next, Loading Loading
arch/x86/kernel/irq_64.c +24 −7 Original line number Original line Diff line number Diff line Loading @@ -70,9 +70,27 @@ static inline void stack_overflow_check(struct pt_regs *regs) int show_interrupts(struct seq_file *p, void *v) int show_interrupts(struct seq_file *p, void *v) { { int i = *(loff_t *) v, j; int i, j; struct irqaction * action; struct irqaction * action; unsigned long flags; unsigned long flags; unsigned int entries; struct irq_desc *desc; int tail = 0; #ifdef CONFIG_HAVE_SPARSE_IRQ desc = (struct irq_desc *)v; entries = -1U; i = desc->irq; if (!desc->next) tail = 1; #else entries = nr_irqs - 1; i = *(loff_t *) v; if (i == nr_irqs) tail = 1; else desc = irq_to_desc(i); #endif if (i == 0) { if (i == 0) { seq_printf(p, " "); seq_printf(p, " "); Loading @@ -81,12 +99,8 @@ int show_interrupts(struct seq_file *p, void *v) seq_putc(p, '\n'); seq_putc(p, '\n'); } } if (i < nr_irqs) { if (i <= entries) { unsigned any_count = 0; unsigned any_count = 0; struct irq_desc *desc = irq_to_desc(i); if (!desc) return 0; spin_lock_irqsave(&desc->lock, flags); spin_lock_irqsave(&desc->lock, flags); #ifndef CONFIG_SMP #ifndef CONFIG_SMP Loading Loading @@ -116,7 +130,9 @@ int show_interrupts(struct seq_file *p, void *v) seq_putc(p, '\n'); seq_putc(p, '\n'); skip: skip: spin_unlock_irqrestore(&desc->lock, flags); spin_unlock_irqrestore(&desc->lock, flags); } else if (i == nr_irqs) { } if (tail) { seq_printf(p, "NMI: "); seq_printf(p, "NMI: "); for_each_online_cpu(j) for_each_online_cpu(j) seq_printf(p, "%10u ", cpu_pda(j)->__nmi_count); seq_printf(p, "%10u ", cpu_pda(j)->__nmi_count); Loading Loading @@ -155,6 +171,7 @@ int show_interrupts(struct seq_file *p, void *v) seq_printf(p, " Spurious interrupts\n"); seq_printf(p, " Spurious interrupts\n"); seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); } } return 0; return 0; } } Loading
fs/proc/proc_misc.c +24 −4 Original line number Original line Diff line number Diff line Loading @@ -645,15 +645,36 @@ static const struct file_operations proc_stat_operations = { */ */ static void *int_seq_start(struct seq_file *f, loff_t *pos) static void *int_seq_start(struct seq_file *f, loff_t *pos) { { #ifdef CONFIG_HAVE_SPARSE_IRQ struct irq_desc *desc; int irq; int count = *pos; for_each_irq_desc(irq, desc) { if (count-- == 0) return desc; } return NULL; #else return (*pos <= nr_irqs) ? pos : NULL; return (*pos <= nr_irqs) ? pos : NULL; #endif } } static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos) static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos) { { #ifdef CONFIG_HAVE_SPARSE_IRQ struct irq_desc *desc; desc = ((struct irq_desc *)v)->next; (*pos)++; (*pos)++; if (*pos > nr_irqs) return NULL; return desc; return pos; #else (*pos)++; return (*pos <= nr_irqs) ? pos : NULL; #endif } } static void int_seq_stop(struct seq_file *f, void *v) static void int_seq_stop(struct seq_file *f, void *v) Loading @@ -661,7 +682,6 @@ static void int_seq_stop(struct seq_file *f, void *v) /* Nothing to do */ /* Nothing to do */ } } static const struct seq_operations int_seq_ops = { static const struct seq_operations int_seq_ops = { .start = int_seq_start, .start = int_seq_start, .next = int_seq_next, .next = int_seq_next, Loading