irq.h 2.0 KB

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