irq.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #ifndef _ASM_IRQ_H
  2. #define _ASM_IRQ_H
  3. #define EXT_INTERRUPT 1
  4. #define IO_INTERRUPT 2
  5. #define THIN_INTERRUPT 3
  6. #define NR_IRQS_BASE 4
  7. #ifdef CONFIG_PCI_NR_MSI
  8. # define NR_IRQS (NR_IRQS_BASE + CONFIG_PCI_NR_MSI)
  9. #else
  10. # define NR_IRQS NR_IRQS_BASE
  11. #endif
  12. /* This number is used when no interrupt has been assigned */
  13. #define NO_IRQ 0
  14. /* External interruption codes */
  15. #define EXT_IRQ_INTERRUPT_KEY 0x0040
  16. #define EXT_IRQ_CLK_COMP 0x1004
  17. #define EXT_IRQ_CPU_TIMER 0x1005
  18. #define EXT_IRQ_WARNING_TRACK 0x1007
  19. #define EXT_IRQ_MALFUNC_ALERT 0x1200
  20. #define EXT_IRQ_EMERGENCY_SIG 0x1201
  21. #define EXT_IRQ_EXTERNAL_CALL 0x1202
  22. #define EXT_IRQ_TIMING_ALERT 0x1406
  23. #define EXT_IRQ_MEASURE_ALERT 0x1407
  24. #define EXT_IRQ_SERVICE_SIG 0x2401
  25. #define EXT_IRQ_CP_SERVICE 0x2603
  26. #define EXT_IRQ_IUCV 0x4000
  27. #ifndef __ASSEMBLY__
  28. #include <linux/hardirq.h>
  29. #include <linux/percpu.h>
  30. #include <linux/cache.h>
  31. #include <linux/types.h>
  32. enum interruption_class {
  33. IRQEXT_CLK,
  34. IRQEXT_EXC,
  35. IRQEXT_EMS,
  36. IRQEXT_TMR,
  37. IRQEXT_TLA,
  38. IRQEXT_PFL,
  39. IRQEXT_DSD,
  40. IRQEXT_VRT,
  41. IRQEXT_SCP,
  42. IRQEXT_IUC,
  43. IRQEXT_CMS,
  44. IRQEXT_CMC,
  45. IRQEXT_CMR,
  46. IRQIO_CIO,
  47. IRQIO_QAI,
  48. IRQIO_DAS,
  49. IRQIO_C15,
  50. IRQIO_C70,
  51. IRQIO_TAP,
  52. IRQIO_VMR,
  53. IRQIO_LCS,
  54. IRQIO_CLW,
  55. IRQIO_CTC,
  56. IRQIO_APB,
  57. IRQIO_ADM,
  58. IRQIO_CSC,
  59. IRQIO_PCI,
  60. IRQIO_MSI,
  61. IRQIO_VIR,
  62. IRQIO_VAI,
  63. NMI_NMI,
  64. CPU_RST,
  65. NR_ARCH_IRQS
  66. };
  67. struct irq_stat {
  68. unsigned int irqs[NR_ARCH_IRQS];
  69. };
  70. DECLARE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat);
  71. static __always_inline void inc_irq_stat(enum interruption_class irq)
  72. {
  73. __get_cpu_var(irq_stat).irqs[irq]++;
  74. }
  75. struct ext_code {
  76. unsigned short subcode;
  77. unsigned short code;
  78. };
  79. typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);
  80. int register_external_irq(u16 code, ext_int_handler_t handler);
  81. int unregister_external_irq(u16 code, ext_int_handler_t handler);
  82. enum irq_subclass {
  83. IRQ_SUBCLASS_MEASUREMENT_ALERT = 5,
  84. IRQ_SUBCLASS_SERVICE_SIGNAL = 9,
  85. };
  86. void irq_subclass_register(enum irq_subclass subclass);
  87. void irq_subclass_unregister(enum irq_subclass subclass);
  88. #define irq_canonicalize(irq) (irq)
  89. #endif /* __ASSEMBLY__ */
  90. #endif /* _ASM_IRQ_H */