ARM: SMP: provide accessors for irq_stat data
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 15 Nov 2010 14:15:03 +0000 (14:15 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 20 Dec 2010 15:06:58 +0000 (15:06 +0000)
Provide __inc_irq_stat() and __get_irq_stat() to increment and
read the irq stat counters.

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/hardirq.h
arch/arm/kernel/smp.c

index 522fb23241acce56c25d83c48681adeaeadd09ad..923eaa1ba83b7ceba1612e764f29b0de7899e52e 100644 (file)
@@ -14,6 +14,9 @@ typedef struct {
 
 #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
 
+#define __inc_irq_stat(cpu, member)    __IRQ_STAT(cpu, member)++
+#define __get_irq_stat(cpu, member)    __IRQ_STAT(cpu, member)
+
 #if NR_IRQS > 512
 #define HARDIRQ_BITS   10
 #elif NR_IRQS > 256
index 36d4b9140dcf13cea071715e8c73b55d80a6522d..24131264ec2c62cd9236098f72728fc561b6ea97 100644 (file)
@@ -423,7 +423,7 @@ asmlinkage void __exception do_local_timer(struct pt_regs *regs)
        int cpu = smp_processor_id();
 
        if (local_timer_ack()) {
-               irq_stat[cpu].local_timer_irqs++;
+               __inc_irq_stat(cpu, local_timer_irqs);
                ipi_timer();
        }
 
@@ -437,7 +437,7 @@ void show_local_irqs(struct seq_file *p)
        seq_printf(p, "LOC: ");
 
        for_each_present_cpu(cpu)
-               seq_printf(p, "%10u ", irq_stat[cpu].local_timer_irqs);
+               seq_printf(p, "%10u ", __get_irq_stat(cpu, local_timer_irqs));
 
        seq_putc(p, '\n');
 }