Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _M68K_IRQ_H_ |
| 2 | #define _M68K_IRQ_H_ |
| 3 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | #include <linux/interrupt.h> |
| 5 | |
| 6 | /* |
Roman Zippel | 4facfde | 2006-06-25 05:46:59 -0700 | [diff] [blame^] | 7 | * # of m68k auto vector interrupts |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #define SYS_IRQS 8 |
| 11 | |
| 12 | /* |
| 13 | * This should be the same as the max(NUM_X_SOURCES) for all the |
| 14 | * different m68k hosts compiled into the kernel. |
| 15 | * Currently the Atari has 72 and the Amiga 24, but if both are |
| 16 | * supported in the kernel it is better to make room for 72. |
| 17 | */ |
| 18 | #if defined(CONFIG_ATARI) || defined(CONFIG_MAC) |
| 19 | #define NR_IRQS (72+SYS_IRQS) |
| 20 | #else |
| 21 | #define NR_IRQS (24+SYS_IRQS) |
| 22 | #endif |
| 23 | |
| 24 | /* |
Al Viro | 85b07cd | 2006-01-12 01:06:10 -0800 | [diff] [blame] | 25 | * The hardirq mask has to be large enough to have |
| 26 | * space for potentially all IRQ sources in the system |
| 27 | * nesting on a single CPU: |
| 28 | */ |
| 29 | #if (1 << HARDIRQ_BITS) < NR_IRQS |
| 30 | # error HARDIRQ_BITS is too low! |
| 31 | #endif |
| 32 | |
| 33 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | * Interrupt source definitions |
| 35 | * General interrupt sources are the level 1-7. |
| 36 | * Adding an interrupt service routine for one of these sources |
| 37 | * results in the addition of that routine to a chain of routines. |
| 38 | * Each one is called in succession. Each individual interrupt |
| 39 | * service routine should determine if the device associated with |
| 40 | * that routine requires service. |
| 41 | */ |
| 42 | |
Roman Zippel | 4facfde | 2006-06-25 05:46:59 -0700 | [diff] [blame^] | 43 | #define IRQ_SPURIOUS 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | |
Roman Zippel | 4facfde | 2006-06-25 05:46:59 -0700 | [diff] [blame^] | 45 | #define IRQ_AUTO_1 1 /* level 1 interrupt */ |
| 46 | #define IRQ_AUTO_2 2 /* level 2 interrupt */ |
| 47 | #define IRQ_AUTO_3 3 /* level 3 interrupt */ |
| 48 | #define IRQ_AUTO_4 4 /* level 4 interrupt */ |
| 49 | #define IRQ_AUTO_5 5 /* level 5 interrupt */ |
| 50 | #define IRQ_AUTO_6 6 /* level 6 interrupt */ |
| 51 | #define IRQ_AUTO_7 7 /* level 7 interrupt (non-maskable) */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | |
Roman Zippel | 4facfde | 2006-06-25 05:46:59 -0700 | [diff] [blame^] | 53 | #define IRQ_USER 8 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | |
| 55 | static __inline__ int irq_canonicalize(int irq) |
| 56 | { |
| 57 | return irq; |
| 58 | } |
| 59 | |
| 60 | /* |
| 61 | * Machine specific interrupt sources. |
| 62 | * |
| 63 | * Adding an interrupt service routine for a source with this bit |
| 64 | * set indicates a special machine specific interrupt source. |
| 65 | * The machine specific files define these sources. |
| 66 | * |
| 67 | * The IRQ_MACHSPEC bit is now gone - the only thing it did was to |
| 68 | * introduce unnecessary overhead. |
| 69 | * |
| 70 | * All interrupt handling is actually machine specific so it is better |
| 71 | * to use function pointers, as used by the Sparc port, and select the |
| 72 | * interrupt handling functions when initializing the kernel. This way |
| 73 | * we save some unnecessary overhead at run-time. |
| 74 | * 01/11/97 - Jes |
| 75 | */ |
| 76 | |
| 77 | extern void (*enable_irq)(unsigned int); |
| 78 | extern void (*disable_irq)(unsigned int); |
Al Viro | 00fc00d | 2006-01-18 21:22:55 -0500 | [diff] [blame] | 79 | #define disable_irq_nosync disable_irq |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | |
| 81 | struct pt_regs; |
| 82 | |
| 83 | extern int cpu_request_irq(unsigned int, |
| 84 | irqreturn_t (*)(int, void *, struct pt_regs *), |
| 85 | unsigned long, const char *, void *); |
| 86 | extern void cpu_free_irq(unsigned int, void *); |
| 87 | |
| 88 | /* |
| 89 | * various flags for request_irq() - the Amiga now uses the standard |
| 90 | * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ |
| 91 | * are your friends. |
| 92 | */ |
| 93 | #ifndef MACH_AMIGA_ONLY |
| 94 | #define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */ |
| 95 | #define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */ |
| 96 | #define IRQ_FLG_FAST (0x0004) |
| 97 | #define IRQ_FLG_SLOW (0x0008) |
| 98 | #define IRQ_FLG_STD (0x8000) /* internally used */ |
| 99 | #endif |
| 100 | |
| 101 | /* |
| 102 | * This structure is used to chain together the ISRs for a particular |
| 103 | * interrupt source (if it supports chaining). |
| 104 | */ |
| 105 | typedef struct irq_node { |
| 106 | irqreturn_t (*handler)(int, void *, struct pt_regs *); |
| 107 | unsigned long flags; |
| 108 | void *dev_id; |
| 109 | const char *devname; |
| 110 | struct irq_node *next; |
| 111 | } irq_node_t; |
| 112 | |
| 113 | /* |
| 114 | * This structure has only 4 elements for speed reasons |
| 115 | */ |
| 116 | typedef struct irq_handler { |
| 117 | irqreturn_t (*handler)(int, void *, struct pt_regs *); |
| 118 | unsigned long flags; |
| 119 | void *dev_id; |
| 120 | const char *devname; |
| 121 | } irq_handler_t; |
| 122 | |
| 123 | /* count of spurious interrupts */ |
| 124 | extern volatile unsigned int num_spurious; |
| 125 | |
| 126 | /* |
| 127 | * This function returns a new irq_node_t |
| 128 | */ |
| 129 | extern irq_node_t *new_irq_node(void); |
| 130 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 131 | #endif /* _M68K_IRQ_H_ */ |