MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / include / asm-mips / irq.h
blob35a05ca5560cf75bf4d8cc865cc21231a08311cc
1 /*
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
4 * for more details.
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
8 */
9 #ifndef _ASM_IRQ_H
10 #define _ASM_IRQ_H
12 #include <linux/linkage.h>
14 #include <asm/mipsmtregs.h>
16 #include <irq.h>
18 #ifdef CONFIG_I8259
19 static inline int irq_canonicalize(int irq)
21 return ((irq == 2) ? 9 : irq);
23 #else
24 #define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */
25 #endif
27 extern asmlinkage unsigned int do_IRQ(unsigned int irq);
29 #ifdef CONFIG_MIPS_MT_SMTC
31 * Clear interrupt mask handling "backstop" if irq_hwmask
32 * entry so indicates. This implies that the ack() or end()
33 * functions will take over re-enabling the low-level mask.
34 * Otherwise it will be done on return from exception.
36 #define __DO_IRQ_SMTC_HOOK() \
37 do { \
38 if (irq_hwmask[irq] & 0x0000ff00) \
39 write_c0_tccontext(read_c0_tccontext() & \
40 ~(irq_hwmask[irq] & 0x0000ff00)); \
41 } while (0)
42 #else
43 #define __DO_IRQ_SMTC_HOOK() do { } while (0)
44 #endif
46 #ifdef CONFIG_PREEMPT
49 * do_IRQ handles all normal device IRQ's (the special
50 * SMP cross-CPU interrupts have their own specific
51 * handlers).
53 * Ideally there should be away to get this into kernel/irq/handle.c to
54 * avoid the overhead of a call for just a tiny function ...
56 #define do_IRQ(irq) \
57 do { \
58 irq_enter(); \
59 __DO_IRQ_SMTC_HOOK(); \
60 __do_IRQ((irq)); \
61 irq_exit(); \
62 } while (0)
64 #endif
66 extern void arch_init_irq(void);
67 extern void spurious_interrupt(void);
69 #ifdef CONFIG_MIPS_MT_SMTC
70 struct irqaction;
72 extern unsigned long irq_hwmask[];
73 extern int setup_irq_smtc(unsigned int irq, struct irqaction * new,
74 unsigned long hwmask);
75 #endif /* CONFIG_MIPS_MT_SMTC */
77 extern int allocate_irqno(void);
78 extern void alloc_legacy_irqno(void);
79 extern void free_irqno(unsigned int irq);
81 #endif /* _ASM_IRQ_H */