irq.h 2.0 KB

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