]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - include/asm-mips/irq.h
[MIPS] MT: Improved multithreading support.
[mirror_ubuntu-jammy-kernel.git] / include / asm-mips / irq.h
CommitLineData
1da177e4
LT
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.
5 *
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
11
12#include <linux/config.h>
13#include <linux/linkage.h>
41c594ab
RB
14
15#include <asm/mipsmtregs.h>
16
1da177e4
LT
17#include <irq.h>
18
19#ifdef CONFIG_I8259
20static inline int irq_canonicalize(int irq)
21{
22 return ((irq == 2) ? 9 : irq);
23}
24#else
25#define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */
26#endif
27
28struct pt_regs;
29
1da177e4
LT
30extern asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs);
31
41c594ab
RB
32#ifdef CONFIG_MIPS_MT_SMTC
33/*
34 * Clear interrupt mask handling "backstop" if irq_hwmask
35 * entry so indicates. This implies that the ack() or end()
36 * functions will take over re-enabling the low-level mask.
37 * Otherwise it will be done on return from exception.
38 */
39#define __DO_IRQ_SMTC_HOOK() \
40do { \
41 if (irq_hwmask[irq] & 0x0000ff00) \
42 write_c0_tccontext(read_c0_tccontext() & \
43 ~(irq_hwmask[irq] & 0x0000ff00)); \
44} while (0)
45#else
46#define __DO_IRQ_SMTC_HOOK() do { } while (0)
47#endif
48
fe00f943 49#ifdef CONFIG_PREEMPT
1da177e4
LT
50
51/*
52 * do_IRQ handles all normal device IRQ's (the special
53 * SMP cross-CPU interrupts have their own specific
54 * handlers).
55 *
56 * Ideally there should be away to get this into kernel/irq/handle.c to
57 * avoid the overhead of a call for just a tiny function ...
58 */
59#define do_IRQ(irq, regs) \
60do { \
61 irq_enter(); \
41c594ab 62 __DO_IRQ_SMTC_HOOK(); \
1da177e4
LT
63 __do_IRQ((irq), (regs)); \
64 irq_exit(); \
65} while (0)
66
67#endif
68
69extern void arch_init_irq(void);
93373ed4 70extern void spurious_interrupt(struct pt_regs *regs);
1da177e4 71
41c594ab
RB
72#ifdef CONFIG_MIPS_MT_SMTC
73struct irqaction;
74
75extern unsigned long irq_hwmask[];
76extern int setup_irq_smtc(unsigned int irq, struct irqaction * new,
77 unsigned long hwmask);
78#endif /* CONFIG_MIPS_MT_SMTC */
79
1da177e4 80#endif /* _ASM_IRQ_H */