]> git.karo-electronics.de Git - karo-tx-linux.git/blob - arch/s390/include/asm/irq.h
58c1ea63945244baf487a8d2cc0a25a45a75c599
[karo-tx-linux.git] / arch / s390 / include / asm / irq.h
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_IUCV            0x4000
31
32 #ifndef __ASSEMBLY__
33
34 #include <linux/hardirq.h>
35 #include <linux/percpu.h>
36 #include <linux/cache.h>
37 #include <linux/types.h>
38
39 enum interruption_class {
40         IRQEXT_CLK,
41         IRQEXT_EXC,
42         IRQEXT_EMS,
43         IRQEXT_TMR,
44         IRQEXT_TLA,
45         IRQEXT_PFL,
46         IRQEXT_DSD,
47         IRQEXT_VRT,
48         IRQEXT_SCP,
49         IRQEXT_IUC,
50         IRQEXT_CMS,
51         IRQEXT_CMC,
52         IRQEXT_CMR,
53         IRQIO_CIO,
54         IRQIO_QAI,
55         IRQIO_DAS,
56         IRQIO_C15,
57         IRQIO_C70,
58         IRQIO_TAP,
59         IRQIO_VMR,
60         IRQIO_LCS,
61         IRQIO_CLW,
62         IRQIO_CTC,
63         IRQIO_APB,
64         IRQIO_ADM,
65         IRQIO_CSC,
66         IRQIO_PCI,
67         IRQIO_MSI,
68         IRQIO_VIR,
69         NMI_NMI,
70         CPU_RST,
71         NR_ARCH_IRQS
72 };
73
74 struct irq_stat {
75         unsigned int irqs[NR_ARCH_IRQS];
76 };
77
78 DECLARE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat);
79
80 static __always_inline void inc_irq_stat(enum interruption_class irq)
81 {
82         __get_cpu_var(irq_stat).irqs[irq]++;
83 }
84
85 struct ext_code {
86         unsigned short subcode;
87         unsigned short code;
88 };
89
90 typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);
91
92 int register_external_interrupt(u16 code, ext_int_handler_t handler);
93 int unregister_external_interrupt(u16 code, ext_int_handler_t handler);
94
95 enum irq_subclass {
96         IRQ_SUBCLASS_MEASUREMENT_ALERT = 5,
97         IRQ_SUBCLASS_SERVICE_SIGNAL = 9,
98 };
99
100 void irq_subclass_register(enum irq_subclass subclass);
101 void irq_subclass_unregister(enum irq_subclass subclass);
102
103 #define irq_canonicalize(irq)  (irq)
104
105 #endif /* __ASSEMBLY__ */
106
107 #endif /* _ASM_IRQ_H */