irq.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. #ifndef _M68K_IRQ_H_
  2. #define _M68K_IRQ_H_
  3. #include <linux/config.h>
  4. #include <linux/interrupt.h>
  5. #include <asm/ptrace.h>
  6. #ifdef CONFIG_COLDFIRE
  7. /*
  8. * On the ColdFire we keep track of all vectors. That way drivers
  9. * can register whatever vector number they wish, and we can deal
  10. * with it.
  11. */
  12. #define SYS_IRQS 256
  13. #define NR_IRQS SYS_IRQS
  14. #else
  15. /*
  16. * # of m68k interrupts
  17. */
  18. #define SYS_IRQS 8
  19. #define NR_IRQS (24+SYS_IRQS)
  20. #endif /* CONFIG_COLDFIRE */
  21. /*
  22. * Interrupt source definitions
  23. * General interrupt sources are the level 1-7.
  24. * Adding an interrupt service routine for one of these sources
  25. * results in the addition of that routine to a chain of routines.
  26. * Each one is called in succession. Each individual interrupt
  27. * service routine should determine if the device associated with
  28. * that routine requires service.
  29. */
  30. #define IRQ1 (1) /* level 1 interrupt */
  31. #define IRQ2 (2) /* level 2 interrupt */
  32. #define IRQ3 (3) /* level 3 interrupt */
  33. #define IRQ4 (4) /* level 4 interrupt */
  34. #define IRQ5 (5) /* level 5 interrupt */
  35. #define IRQ6 (6) /* level 6 interrupt */
  36. #define IRQ7 (7) /* level 7 interrupt (non-maskable) */
  37. /*
  38. * Machine specific interrupt sources.
  39. *
  40. * Adding an interrupt service routine for a source with this bit
  41. * set indicates a special machine specific interrupt source.
  42. * The machine specific files define these sources.
  43. *
  44. * The IRQ_MACHSPEC bit is now gone - the only thing it did was to
  45. * introduce unnecessary overhead.
  46. *
  47. * All interrupt handling is actually machine specific so it is better
  48. * to use function pointers, as used by the Sparc port, and select the
  49. * interrupt handling functions when initializing the kernel. This way
  50. * we save some unnecessary overhead at run-time.
  51. * 01/11/97 - Jes
  52. */
  53. extern void (*mach_enable_irq)(unsigned int);
  54. extern void (*mach_disable_irq)(unsigned int);
  55. /*
  56. * various flags for request_irq() - the Amiga now uses the standard
  57. * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ
  58. * are your friends.
  59. */
  60. #define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */
  61. #define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */
  62. #define IRQ_FLG_FAST (0x0004)
  63. #define IRQ_FLG_SLOW (0x0008)
  64. #define IRQ_FLG_STD (0x8000) /* internally used */
  65. #ifdef CONFIG_M68360
  66. #define CPM_INTERRUPT IRQ4
  67. /* see MC68360 User's Manual, p. 7-377 */
  68. #define CPM_VECTOR_BASE 0x04 /* 3 MSbits of CPM vector */
  69. #endif /* CONFIG_M68360 */
  70. /*
  71. * This structure is used to chain together the ISRs for a particular
  72. * interrupt source (if it supports chaining).
  73. */
  74. typedef struct irq_node {
  75. irqreturn_t (*handler)(int, void *, struct pt_regs *);
  76. unsigned long flags;
  77. void *dev_id;
  78. const char *devname;
  79. struct irq_node *next;
  80. } irq_node_t;
  81. /*
  82. * This structure has only 4 elements for speed reasons
  83. */
  84. typedef struct irq_handler {
  85. irqreturn_t (*handler)(int, void *, struct pt_regs *);
  86. unsigned long flags;
  87. void *dev_id;
  88. const char *devname;
  89. } irq_handler_t;
  90. /* count of spurious interrupts */
  91. extern volatile unsigned int num_spurious;
  92. /*
  93. * This function returns a new irq_node_t
  94. */
  95. extern irq_node_t *new_irq_node(void);
  96. /*
  97. * Some drivers want these entry points
  98. */
  99. #define enable_irq(x) (mach_enable_irq ? (*mach_enable_irq)(x) : 0)
  100. #define disable_irq(x) (mach_disable_irq ? (*mach_disable_irq)(x) : 0)
  101. #define enable_irq_nosync(x) enable_irq(x)
  102. #define disable_irq_nosync(x) disable_irq(x)
  103. struct irqaction;
  104. struct pt_regs;
  105. int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
  106. #endif /* _M68K_IRQ_H_ */