blob: 456f9e7b8d83ad343bed2a222df35023e148e7f6 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Anton Blanchard8c007bf2010-01-31 20:30:23 +00002#ifndef _ASM_POWERPC_HARDIRQ_H
3#define _ASM_POWERPC_HARDIRQ_H
4
5#include <linux/threads.h>
6#include <linux/irq.h>
7
8typedef struct {
9 unsigned int __softirq_pending;
fan.duc041cfa2013-01-23 16:06:11 +080010 unsigned int timer_irqs_event;
11 unsigned int timer_irqs_others;
Anton Blanchard89713ed2010-01-31 20:34:06 +000012 unsigned int pmu_irqs;
13 unsigned int mce_exceptions;
Anton Blanchard170811022010-01-31 20:34:36 +000014 unsigned int spurious_irqs;
Mahesh Salgaonkar0869b6f2014-07-29 18:40:01 +053015 unsigned int hmi_exceptions;
Nicholas Pigginca41ad42017-08-01 22:00:53 +100016 unsigned int sreset_irqs;
Nicholas Piggin04019bf2017-08-01 22:00:54 +100017#ifdef CONFIG_PPC_WATCHDOG
18 unsigned int soft_nmi_irqs;
19#endif
Ian Munsiea6a058e2013-03-21 19:22:52 +000020#ifdef CONFIG_PPC_DOORBELL
21 unsigned int doorbell_irqs;
22#endif
Anton Blanchard8c007bf2010-01-31 20:30:23 +000023} ____cacheline_aligned irq_cpustat_t;
24
25DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
26
27#define __ARCH_IRQ_STAT
28
Christoph Lameter69111ba2014-10-21 15:23:25 -050029#define local_softirq_pending() __this_cpu_read(irq_stat.__softirq_pending)
30
31#define __ARCH_SET_SOFTIRQ_PENDING
32
33#define set_softirq_pending(x) __this_cpu_write(irq_stat.__softirq_pending, (x))
34#define or_softirq_pending(x) __this_cpu_or(irq_stat.__softirq_pending, (x))
Anton Blanchard8c007bf2010-01-31 20:30:23 +000035
36static inline void ack_bad_irq(unsigned int irq)
37{
38 printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq);
39}
40
Anton Blanchard89713ed2010-01-31 20:34:06 +000041extern u64 arch_irq_stat_cpu(unsigned int cpu);
42#define arch_irq_stat_cpu arch_irq_stat_cpu
43
Anton Blanchard8c007bf2010-01-31 20:30:23 +000044#endif /* _ASM_POWERPC_HARDIRQ_H */