Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _ASM_IRQ_H |
| 2 | #define _ASM_IRQ_H |
| 3 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | #include <linux/hardirq.h> |
Heiko Carstens | 420f42e | 2013-01-02 15:18:18 +0100 | [diff] [blame] | 5 | #include <linux/percpu.h> |
| 6 | #include <linux/cache.h> |
Heiko Carstens | d7b250e | 2011-05-26 09:48:24 +0200 | [diff] [blame] | 7 | #include <linux/types.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | |
Heiko Carstens | 420f42e | 2013-01-02 15:18:18 +0100 | [diff] [blame] | 9 | enum interruption_main_class { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | EXTERNAL_INTERRUPT, |
| 11 | IO_INTERRUPT, |
Heiko Carstens | 420f42e | 2013-01-02 15:18:18 +0100 | [diff] [blame] | 12 | NR_IRQS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | }; |
| 14 | |
Heiko Carstens | 420f42e | 2013-01-02 15:18:18 +0100 | [diff] [blame] | 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, |
Linus Torvalds | 89f8833 | 2013-02-24 13:07:18 -0800 | [diff] [blame] | 44 | IRQIO_VIR, |
Heiko Carstens | 420f42e | 2013-01-02 15:18:18 +0100 | [diff] [blame] | 45 | NMI_NMI, |
Heiko Carstens | 93f3b2e | 2013-01-02 16:54:12 +0100 | [diff] [blame] | 46 | CPU_RST, |
Heiko Carstens | 420f42e | 2013-01-02 15:18:18 +0100 | [diff] [blame] | 47 | NR_ARCH_IRQS |
| 48 | }; |
| 49 | |
| 50 | struct irq_stat { |
| 51 | unsigned int irqs[NR_ARCH_IRQS]; |
| 52 | }; |
| 53 | |
| 54 | DECLARE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat); |
| 55 | |
| 56 | static __always_inline void inc_irq_stat(enum interruption_class irq) |
| 57 | { |
| 58 | __get_cpu_var(irq_stat).irqs[irq]++; |
| 59 | } |
| 60 | |
Heiko Carstens | fde15c3 | 2012-03-11 11:59:31 -0400 | [diff] [blame] | 61 | struct ext_code { |
| 62 | unsigned short subcode; |
| 63 | unsigned short code; |
| 64 | }; |
| 65 | |
| 66 | typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long); |
Heiko Carstens | d7b250e | 2011-05-26 09:48:24 +0200 | [diff] [blame] | 67 | |
| 68 | int register_external_interrupt(u16 code, ext_int_handler_t handler); |
| 69 | int unregister_external_interrupt(u16 code, ext_int_handler_t handler); |
| 70 | void service_subclass_irq_register(void); |
| 71 | void service_subclass_irq_unregister(void); |
Jan Glauber | b03d541a | 2012-03-23 11:13:05 +0100 | [diff] [blame] | 72 | void measurement_alert_subclass_register(void); |
| 73 | void measurement_alert_subclass_unregister(void); |
Heiko Carstens | d7b250e | 2011-05-26 09:48:24 +0200 | [diff] [blame] | 74 | |
Jan Glauber | 9a4da8a | 2012-11-29 13:05:05 +0100 | [diff] [blame] | 75 | #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 Carstens | 052ff46 | 2011-01-05 12:47:28 +0100 | [diff] [blame] | 85 | #endif /* _ASM_IRQ_H */ |