• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _ASM_IRQ_H
2 #define _ASM_IRQ_H
3 
4 #define EXT_INTERRUPT	1
5 #define IO_INTERRUPT	2
6 #define THIN_INTERRUPT	3
7 
8 #define NR_IRQS_BASE	4
9 
10 #ifdef CONFIG_PCI_NR_MSI
11 # define NR_IRQS	(NR_IRQS_BASE + CONFIG_PCI_NR_MSI)
12 #else
13 # define NR_IRQS	NR_IRQS_BASE
14 #endif
15 
16 /* This number is used when no interrupt has been assigned */
17 #define NO_IRQ		0
18 
19 /* External interruption codes */
20 #define EXT_IRQ_INTERRUPT_KEY	0x0040
21 #define EXT_IRQ_CLK_COMP	0x1004
22 #define EXT_IRQ_CPU_TIMER	0x1005
23 #define EXT_IRQ_WARNING_TRACK	0x1007
24 #define EXT_IRQ_MALFUNC_ALERT	0x1200
25 #define EXT_IRQ_EMERGENCY_SIG	0x1201
26 #define EXT_IRQ_EXTERNAL_CALL	0x1202
27 #define EXT_IRQ_TIMING_ALERT	0x1406
28 #define EXT_IRQ_MEASURE_ALERT	0x1407
29 #define EXT_IRQ_SERVICE_SIG	0x2401
30 #define EXT_IRQ_CP_SERVICE	0x2603
31 #define EXT_IRQ_IUCV		0x4000
32 
33 #ifndef __ASSEMBLY__
34 
35 #include <linux/hardirq.h>
36 #include <linux/percpu.h>
37 #include <linux/cache.h>
38 #include <linux/types.h>
39 
40 enum interruption_class {
41 	IRQEXT_CLK,
42 	IRQEXT_EXC,
43 	IRQEXT_EMS,
44 	IRQEXT_TMR,
45 	IRQEXT_TLA,
46 	IRQEXT_PFL,
47 	IRQEXT_DSD,
48 	IRQEXT_VRT,
49 	IRQEXT_SCP,
50 	IRQEXT_IUC,
51 	IRQEXT_CMS,
52 	IRQEXT_CMC,
53 	IRQEXT_CMR,
54 	IRQEXT_FTP,
55 	IRQIO_CIO,
56 	IRQIO_QAI,
57 	IRQIO_DAS,
58 	IRQIO_C15,
59 	IRQIO_C70,
60 	IRQIO_TAP,
61 	IRQIO_VMR,
62 	IRQIO_LCS,
63 	IRQIO_CLW,
64 	IRQIO_CTC,
65 	IRQIO_APB,
66 	IRQIO_ADM,
67 	IRQIO_CSC,
68 	IRQIO_PCI,
69 	IRQIO_MSI,
70 	IRQIO_VIR,
71 	IRQIO_VAI,
72 	NMI_NMI,
73 	CPU_RST,
74 	NR_ARCH_IRQS
75 };
76 
77 struct irq_stat {
78 	unsigned int irqs[NR_ARCH_IRQS];
79 };
80 
81 DECLARE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat);
82 
inc_irq_stat(enum interruption_class irq)83 static __always_inline void inc_irq_stat(enum interruption_class irq)
84 {
85 	__this_cpu_inc(irq_stat.irqs[irq]);
86 }
87 
88 struct ext_code {
89 	unsigned short subcode;
90 	unsigned short code;
91 };
92 
93 typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);
94 
95 int register_external_irq(u16 code, ext_int_handler_t handler);
96 int unregister_external_irq(u16 code, ext_int_handler_t handler);
97 
98 enum irq_subclass {
99 	IRQ_SUBCLASS_MEASUREMENT_ALERT = 5,
100 	IRQ_SUBCLASS_SERVICE_SIGNAL = 9,
101 };
102 
103 void irq_subclass_register(enum irq_subclass subclass);
104 void irq_subclass_unregister(enum irq_subclass subclass);
105 
106 #define irq_canonicalize(irq)  (irq)
107 
108 #endif /* __ASSEMBLY__ */
109 
110 #endif /* _ASM_IRQ_H */
111