irq.h 2.5 KB

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