irq.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. IRQEXT_FTP,
  47. IRQIO_CIO,
  48. IRQIO_QAI,
  49. IRQIO_DAS,
  50. IRQIO_C15,
  51. IRQIO_C70,
  52. IRQIO_TAP,
  53. IRQIO_VMR,
  54. IRQIO_LCS,
  55. IRQIO_CLW,
  56. IRQIO_CTC,
  57. IRQIO_APB,
  58. IRQIO_ADM,
  59. IRQIO_CSC,
  60. IRQIO_PCI,
  61. IRQIO_MSI,
  62. IRQIO_VIR,
  63. IRQIO_VAI,
  64. NMI_NMI,
  65. CPU_RST,
  66. NR_ARCH_IRQS
  67. };
  68. struct irq_stat {
  69. unsigned int irqs[NR_ARCH_IRQS];
  70. };
  71. DECLARE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat);
  72. static __always_inline void inc_irq_stat(enum interruption_class irq)
  73. {
  74. __this_cpu_inc(irq_stat.irqs[irq]);
  75. }
  76. struct ext_code {
  77. unsigned short subcode;
  78. unsigned short code;
  79. };
  80. typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);
  81. int register_external_irq(u16 code, ext_int_handler_t handler);
  82. int unregister_external_irq(u16 code, ext_int_handler_t handler);
  83. enum irq_subclass {
  84. IRQ_SUBCLASS_MEASUREMENT_ALERT = 5,
  85. IRQ_SUBCLASS_SERVICE_SIGNAL = 9,
  86. };
  87. void irq_subclass_register(enum irq_subclass subclass);
  88. void irq_subclass_unregister(enum irq_subclass subclass);
  89. #define irq_canonicalize(irq) (irq)
  90. #endif /* __ASSEMBLY__ */
  91. #endif /* _ASM_IRQ_H */