blob: 87c17bfb2968e8423fed70784417b36384754f91 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _ASM_IRQ_H
2#define _ASM_IRQ_H
3
Linus Torvalds1da177e2005-04-16 15:20:36 -07004#include <linux/hardirq.h>
Heiko Carstens420f42e2013-01-02 15:18:18 +01005#include <linux/percpu.h>
6#include <linux/cache.h>
Heiko Carstensd7b250e2011-05-26 09:48:24 +02007#include <linux/types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
Heiko Carstens420f42e2013-01-02 15:18:18 +01009enum interruption_main_class {
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 EXTERNAL_INTERRUPT,
11 IO_INTERRUPT,
Heiko Carstens420f42e2013-01-02 15:18:18 +010012 NR_IRQS
Linus Torvalds1da177e2005-04-16 15:20:36 -070013};
14
Heiko Carstens420f42e2013-01-02 15:18:18 +010015enum 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,
Linus Torvalds89f88332013-02-24 13:07:18 -080044 IRQIO_VIR,
Heiko Carstens420f42e2013-01-02 15:18:18 +010045 NMI_NMI,
Heiko Carstens93f3b2e2013-01-02 16:54:12 +010046 CPU_RST,
Heiko Carstens420f42e2013-01-02 15:18:18 +010047 NR_ARCH_IRQS
48};
49
50struct irq_stat {
51 unsigned int irqs[NR_ARCH_IRQS];
52};
53
54DECLARE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat);
55
56static __always_inline void inc_irq_stat(enum interruption_class irq)
57{
58 __get_cpu_var(irq_stat).irqs[irq]++;
59}
60
Heiko Carstensfde15c32012-03-11 11:59:31 -040061struct ext_code {
62 unsigned short subcode;
63 unsigned short code;
64};
65
66typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);
Heiko Carstensd7b250e2011-05-26 09:48:24 +020067
68int register_external_interrupt(u16 code, ext_int_handler_t handler);
69int unregister_external_interrupt(u16 code, ext_int_handler_t handler);
70void service_subclass_irq_register(void);
71void service_subclass_irq_unregister(void);
Jan Glauberb03d541a2012-03-23 11:13:05 +010072void measurement_alert_subclass_register(void);
73void measurement_alert_subclass_unregister(void);
Heiko Carstensd7b250e2011-05-26 09:48:24 +020074
Jan Glauber9a4da8a2012-11-29 13:05:05 +010075#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
Heiko Carstens052ff462011-01-05 12:47:28 +010085#endif /* _ASM_IRQ_H */