xref: /linux/arch/powerpc/include/asm/hardirq.h (revision 2d7eaeb05ae265bd64270376e6a2c0d80244771f)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_POWERPC_HARDIRQ_H
3 #define _ASM_POWERPC_HARDIRQ_H
4 
5 #include <linux/threads.h>
6 #include <linux/irq.h>
7 
8 enum irq_stat_counts {
9 	IRQ_COUNT_LOC_TIMER,
10 	IRQ_COUNT_BCT_TIMER,
11 	IRQ_COUNT_OTHER_TIMER,
12 	IRQ_COUNT_SPURIOUS,
13 	IRQ_COUNT_PMI,
14 	IRQ_COUNT_MCE,
15 	IRQ_COUNT_NMI_SRESET,
16 #ifdef CONFIG_PPC_WATCHDOG
17 	IRQ_COUNT_WATCHDOG,
18 #endif
19 #ifdef CONFIG_PPC_DOORBELL
20 	IRQ_COUNT_DOORBELL,
21 #endif
22 	IRQ_COUNT_MAX,
23 };
24 
25 typedef struct {
26 	unsigned int counts[IRQ_COUNT_MAX];
27 } ____cacheline_aligned irq_cpustat_t;
28 
29 DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
30 DECLARE_PER_CPU(unsigned int, __softirq_pending);
31 #define local_softirq_pending_ref       __softirq_pending
32 
33 #define inc_irq_stat(index)	__this_cpu_inc(irq_stat.counts[IRQ_COUNT_##index])
34 void inc_irq_stat_and_enable(enum irq_stat_counts which);
35 
36 #define __ARCH_IRQ_STAT
37 #define __ARCH_IRQ_EXIT_IRQS_DISABLED
38 
39 static inline void ack_bad_irq(unsigned int irq)
40 {
41 	printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq);
42 }
43 
44 extern u64 arch_irq_stat_cpu(unsigned int cpu);
45 #define arch_irq_stat_cpu	arch_irq_stat_cpu
46 
47 #endif /* _ASM_POWERPC_HARDIRQ_H */
48