irq.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #ifndef _M68K_IRQ_H_
  2. #define _M68K_IRQ_H_
  3. #include <linux/config.h>
  4. #include <linux/interrupt.h>
  5. /*
  6. * # of m68k interrupts
  7. */
  8. #define SYS_IRQS 8
  9. /*
  10. * This should be the same as the max(NUM_X_SOURCES) for all the
  11. * different m68k hosts compiled into the kernel.
  12. * Currently the Atari has 72 and the Amiga 24, but if both are
  13. * supported in the kernel it is better to make room for 72.
  14. */
  15. #if defined(CONFIG_ATARI) || defined(CONFIG_MAC)
  16. #define NR_IRQS (72+SYS_IRQS)
  17. #else
  18. #define NR_IRQS (24+SYS_IRQS)
  19. #endif
  20. /*
  21. * Interrupt source definitions
  22. * General interrupt sources are the level 1-7.
  23. * Adding an interrupt service routine for one of these sources
  24. * results in the addition of that routine to a chain of routines.
  25. * Each one is called in succession. Each individual interrupt
  26. * service routine should determine if the device associated with
  27. * that routine requires service.
  28. */
  29. #define IRQ1 (1) /* level 1 interrupt */
  30. #define IRQ2 (2) /* level 2 interrupt */
  31. #define IRQ3 (3) /* level 3 interrupt */
  32. #define IRQ4 (4) /* level 4 interrupt */
  33. #define IRQ5 (5) /* level 5 interrupt */
  34. #define IRQ6 (6) /* level 6 interrupt */
  35. #define IRQ7 (7) /* level 7 interrupt (non-maskable) */
  36. /*
  37. * "Generic" interrupt sources
  38. */
  39. #define IRQ_SCHED_TIMER (8) /* interrupt source for scheduling timer */
  40. static __inline__ int irq_canonicalize(int irq)
  41. {
  42. return irq;
  43. }
  44. /*
  45. * Machine specific interrupt sources.
  46. *
  47. * Adding an interrupt service routine for a source with this bit
  48. * set indicates a special machine specific interrupt source.
  49. * The machine specific files define these sources.
  50. *
  51. * The IRQ_MACHSPEC bit is now gone - the only thing it did was to
  52. * introduce unnecessary overhead.
  53. *
  54. * All interrupt handling is actually machine specific so it is better
  55. * to use function pointers, as used by the Sparc port, and select the
  56. * interrupt handling functions when initializing the kernel. This way
  57. * we save some unnecessary overhead at run-time.
  58. * 01/11/97 - Jes
  59. */
  60. extern void (*enable_irq)(unsigned int);
  61. extern void (*disable_irq)(unsigned int);
  62. #define disable_irq_nosync disable_irq
  63. #define enable_irq_nosync enable_irq
  64. struct pt_regs;
  65. extern int cpu_request_irq(unsigned int,
  66. irqreturn_t (*)(int, void *, struct pt_regs *),
  67. unsigned long, const char *, void *);
  68. extern void cpu_free_irq(unsigned int, void *);
  69. /*
  70. * various flags for request_irq() - the Amiga now uses the standard
  71. * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ
  72. * are your friends.
  73. */
  74. #ifndef MACH_AMIGA_ONLY
  75. #define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */
  76. #define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */
  77. #define IRQ_FLG_FAST (0x0004)
  78. #define IRQ_FLG_SLOW (0x0008)
  79. #define IRQ_FLG_STD (0x8000) /* internally used */
  80. #endif
  81. /*
  82. * This structure is used to chain together the ISRs for a particular
  83. * interrupt source (if it supports chaining).
  84. */
  85. typedef struct irq_node {
  86. irqreturn_t (*handler)(int, void *, struct pt_regs *);
  87. unsigned long flags;
  88. void *dev_id;
  89. const char *devname;
  90. struct irq_node *next;
  91. } irq_node_t;
  92. /*
  93. * This structure has only 4 elements for speed reasons
  94. */
  95. typedef struct irq_handler {
  96. irqreturn_t (*handler)(int, void *, struct pt_regs *);
  97. unsigned long flags;
  98. void *dev_id;
  99. const char *devname;
  100. } irq_handler_t;
  101. /* count of spurious interrupts */
  102. extern volatile unsigned int num_spurious;
  103. /*
  104. * This function returns a new irq_node_t
  105. */
  106. extern irq_node_t *new_irq_node(void);
  107. struct irqaction;
  108. struct pt_regs;
  109. int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
  110. #endif /* _M68K_IRQ_H_ */