2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 1994 by Waldorf GMBH, written by Ralf Baechle
7 * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02, 03 by Ralf Baechle
12 #include <linux/linkage.h>
14 #include <asm/mipsmtregs.h>
19 static inline int irq_canonicalize(int irq)
21 return ((irq == 2) ? 9 : irq);
24 #define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */
29 extern asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs);
31 #ifdef CONFIG_MIPS_MT_SMTC
33 * Clear interrupt mask handling "backstop" if irq_hwmask
34 * entry so indicates. This implies that the ack() or end()
35 * functions will take over re-enabling the low-level mask.
36 * Otherwise it will be done on return from exception.
38 #define __DO_IRQ_SMTC_HOOK() \
40 if (irq_hwmask[irq] & 0x0000ff00) \
41 write_c0_tccontext(read_c0_tccontext() & \
42 ~(irq_hwmask[irq] & 0x0000ff00)); \
45 #define __DO_IRQ_SMTC_HOOK() do { } while (0)
51 * do_IRQ handles all normal device IRQ's (the special
52 * SMP cross-CPU interrupts have their own specific
55 * Ideally there should be away to get this into kernel/irq/handle.c to
56 * avoid the overhead of a call for just a tiny function ...
58 #define do_IRQ(irq, regs) \
61 __DO_IRQ_SMTC_HOOK(); \
62 __do_IRQ((irq), (regs)); \
68 extern void arch_init_irq(void);
69 extern void spurious_interrupt(struct pt_regs *regs);
71 #ifdef CONFIG_MIPS_MT_SMTC
74 extern unsigned long irq_hwmask[];
75 extern int setup_irq_smtc(unsigned int irq, struct irqaction * new,
76 unsigned long hwmask);
77 #endif /* CONFIG_MIPS_MT_SMTC */
80 #define ARCH_HAS_IRQ_PER_CPU
83 #endif /* _ASM_IRQ_H */