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