Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
[linux-3.10.git] / arch / s390 / include / asm / irq.h
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         NMI_NMI,
45         CPU_RST,
46         NR_ARCH_IRQS
47 };
48
49 struct irq_stat {
50         unsigned int irqs[NR_ARCH_IRQS];
51 };
52
53 DECLARE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat);
54
55 static __always_inline void inc_irq_stat(enum interruption_class irq)
56 {
57         __get_cpu_var(irq_stat).irqs[irq]++;
58 }
59
60 struct ext_code {
61         unsigned short subcode;
62         unsigned short code;
63 };
64
65 typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);
66
67 int register_external_interrupt(u16 code, ext_int_handler_t handler);
68 int unregister_external_interrupt(u16 code, ext_int_handler_t handler);
69 void service_subclass_irq_register(void);
70 void service_subclass_irq_unregister(void);
71 void measurement_alert_subclass_register(void);
72 void measurement_alert_subclass_unregister(void);
73
74 #ifdef CONFIG_LOCKDEP
75 #  define disable_irq_nosync_lockdep(irq)       disable_irq_nosync(irq)
76 #  define disable_irq_nosync_lockdep_irqsave(irq, flags) \
77                                                 disable_irq_nosync(irq)
78 #  define disable_irq_lockdep(irq)              disable_irq(irq)
79 #  define enable_irq_lockdep(irq)               enable_irq(irq)
80 #  define enable_irq_lockdep_irqrestore(irq, flags) \
81                                                 enable_irq(irq)
82 #endif
83
84 #endif /* _ASM_IRQ_H */