Merge git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
[cascardo/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_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         IRQIO_CIO,
55         IRQIO_QAI,
56         IRQIO_DAS,
57         IRQIO_C15,
58         IRQIO_C70,
59         IRQIO_TAP,
60         IRQIO_VMR,
61         IRQIO_LCS,
62         IRQIO_CLW,
63         IRQIO_CTC,
64         IRQIO_APB,
65         IRQIO_ADM,
66         IRQIO_CSC,
67         IRQIO_PCI,
68         IRQIO_MSI,
69         IRQIO_VIR,
70         IRQIO_VAI,
71         NMI_NMI,
72         CPU_RST,
73         NR_ARCH_IRQS
74 };
75
76 struct irq_stat {
77         unsigned int irqs[NR_ARCH_IRQS];
78 };
79
80 DECLARE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat);
81
82 static __always_inline void inc_irq_stat(enum interruption_class irq)
83 {
84         __get_cpu_var(irq_stat).irqs[irq]++;
85 }
86
87 struct ext_code {
88         unsigned short subcode;
89         unsigned short code;
90 };
91
92 typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);
93
94 int register_external_irq(u16 code, ext_int_handler_t handler);
95 int unregister_external_irq(u16 code, ext_int_handler_t handler);
96
97 enum irq_subclass {
98         IRQ_SUBCLASS_MEASUREMENT_ALERT = 5,
99         IRQ_SUBCLASS_SERVICE_SIGNAL = 9,
100 };
101
102 void irq_subclass_register(enum irq_subclass subclass);
103 void irq_subclass_unregister(enum irq_subclass subclass);
104
105 #define irq_canonicalize(irq)  (irq)
106
107 #endif /* __ASSEMBLY__ */
108
109 #endif /* _ASM_IRQ_H */