1 #ifndef _ASM_IRQ_H
2 #define _ASM_IRQ_H
3
4 #include <linux/hardirq.h>
5 #include <linux/percpu.h>
6 #include <linux/cache.h>
7 #include <linux/types.h>
8
9 enum interruption_main_class {
10 EXTERNAL_INTERRUPT,
11 IO_INTERRUPT,
12 NR_IRQS
13 };
14
15 enum interruption_class {
16 IRQEXT_CLK,
17 IRQEXT_EXC,
18 IRQEXT_EMS,
19 IRQEXT_TMR,
20 IRQEXT_TLA,
21 IRQEXT_PFL,
22 IRQEXT_DSD,
23 IRQEXT_VRT,
24 IRQEXT_SCP,
25 IRQEXT_IUC,
26 IRQEXT_CMS,
27 IRQEXT_CMC,
28 IRQEXT_CMR,
29 IRQIO_CIO,
30 IRQIO_QAI,
31 IRQIO_DAS,
32 IRQIO_C15,
33 IRQIO_C70,
34 IRQIO_TAP,
35 IRQIO_VMR,
36 IRQIO_LCS,
37 IRQIO_CLW,
38 IRQIO_CTC,
39 IRQIO_APB,
40 IRQIO_ADM,
41 IRQIO_CSC,
42 IRQIO_PCI,
43 IRQIO_MSI,
44 IRQIO_VIR,
45 NMI_NMI,
46 CPU_RST,
47 NR_ARCH_IRQS
48 };
49
50 struct irq_stat {
51 unsigned int irqs[NR_ARCH_IRQS];
52 };
53
54 DECLARE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat);
55
inc_irq_stat(enum interruption_class irq)56 static __always_inline void inc_irq_stat(enum interruption_class irq)
57 {
58 __get_cpu_var(irq_stat).irqs[irq]++;
59 }
60
61 struct ext_code {
62 unsigned short subcode;
63 unsigned short code;
64 };
65
66 typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);
67
68 int register_external_interrupt(u16 code, ext_int_handler_t handler);
69 int unregister_external_interrupt(u16 code, ext_int_handler_t handler);
70 void service_subclass_irq_register(void);
71 void service_subclass_irq_unregister(void);
72 void measurement_alert_subclass_register(void);
73 void measurement_alert_subclass_unregister(void);
74
75 #ifdef CONFIG_LOCKDEP
76 # define disable_irq_nosync_lockdep(irq) disable_irq_nosync(irq)
77 # define disable_irq_nosync_lockdep_irqsave(irq, flags) \
78 disable_irq_nosync(irq)
79 # define disable_irq_lockdep(irq) disable_irq(irq)
80 # define enable_irq_lockdep(irq) enable_irq(irq)
81 # define enable_irq_lockdep_irqrestore(irq, flags) \
82 enable_irq(irq)
83 #endif
84
85 #endif /* _ASM_IRQ_H */
86