irq.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. #ifndef __ASSEMBLY__
  15. #include <linux/hardirq.h>
  16. #include <linux/percpu.h>
  17. #include <linux/cache.h>
  18. #include <linux/types.h>
  19. enum interruption_class {
  20. IRQEXT_CLK,
  21. IRQEXT_EXC,
  22. IRQEXT_EMS,
  23. IRQEXT_TMR,
  24. IRQEXT_TLA,
  25. IRQEXT_PFL,
  26. IRQEXT_DSD,
  27. IRQEXT_VRT,
  28. IRQEXT_SCP,
  29. IRQEXT_IUC,
  30. IRQEXT_CMS,
  31. IRQEXT_CMC,
  32. IRQEXT_CMR,
  33. IRQIO_CIO,
  34. IRQIO_QAI,
  35. IRQIO_DAS,
  36. IRQIO_C15,
  37. IRQIO_C70,
  38. IRQIO_TAP,
  39. IRQIO_VMR,
  40. IRQIO_LCS,
  41. IRQIO_CLW,
  42. IRQIO_CTC,
  43. IRQIO_APB,
  44. IRQIO_ADM,
  45. IRQIO_CSC,
  46. IRQIO_PCI,
  47. IRQIO_MSI,
  48. IRQIO_VIR,
  49. NMI_NMI,
  50. CPU_RST,
  51. NR_ARCH_IRQS
  52. };
  53. struct irq_stat {
  54. unsigned int irqs[NR_ARCH_IRQS];
  55. };
  56. DECLARE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat);
  57. static __always_inline void inc_irq_stat(enum interruption_class irq)
  58. {
  59. __get_cpu_var(irq_stat).irqs[irq]++;
  60. }
  61. struct ext_code {
  62. unsigned short subcode;
  63. unsigned short code;
  64. };
  65. typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);
  66. int register_external_interrupt(u16 code, ext_int_handler_t handler);
  67. int unregister_external_interrupt(u16 code, ext_int_handler_t handler);
  68. void service_subclass_irq_register(void);
  69. void service_subclass_irq_unregister(void);
  70. void measurement_alert_subclass_register(void);
  71. void measurement_alert_subclass_unregister(void);
  72. #define irq_canonicalize(irq) (irq)
  73. #endif /* __ASSEMBLY__ */
  74. #endif /* _ASM_IRQ_H */