xref: /openbmc/linux/arch/mips/include/asm/irq.h (revision 770847bad0200b62af2d93808b4e69d82f14264e)
1384740dcSRalf Baechle /*
2384740dcSRalf Baechle  * This file is subject to the terms and conditions of the GNU General Public
3384740dcSRalf Baechle  * License.  See the file "COPYING" in the main directory of this archive
4384740dcSRalf Baechle  * for more details.
5384740dcSRalf Baechle  *
6384740dcSRalf Baechle  * Copyright (C) 1994 by Waldorf GMBH, written by Ralf Baechle
7384740dcSRalf Baechle  * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02, 03 by Ralf Baechle
8384740dcSRalf Baechle  */
9384740dcSRalf Baechle #ifndef _ASM_IRQ_H
10384740dcSRalf Baechle #define _ASM_IRQ_H
11384740dcSRalf Baechle 
12384740dcSRalf Baechle #include <linux/linkage.h>
13631330f5SRalf Baechle #include <linux/smp.h>
14abd2363fSGrant Likely #include <linux/irqdomain.h>
15384740dcSRalf Baechle 
16384740dcSRalf Baechle #include <asm/mipsmtregs.h>
17384740dcSRalf Baechle 
18384740dcSRalf Baechle #include <irq.h>
19384740dcSRalf Baechle 
20384740dcSRalf Baechle #ifdef CONFIG_I8259
21384740dcSRalf Baechle static inline int irq_canonicalize(int irq)
22384740dcSRalf Baechle {
23384740dcSRalf Baechle 	return ((irq == I8259A_IRQ_BASE + 2) ? I8259A_IRQ_BASE + 9 : irq);
24384740dcSRalf Baechle }
25384740dcSRalf Baechle #else
26384740dcSRalf Baechle #define irq_canonicalize(irq) (irq)	/* Sane hardware, sane code ... */
27384740dcSRalf Baechle #endif
28384740dcSRalf Baechle 
29950e97caSSergey Ryazanov asmlinkage void plat_irq_dispatch(void);
30950e97caSSergey Ryazanov 
318f99a162SWu Zhangjin extern void do_IRQ(unsigned int irq);
32384740dcSRalf Baechle 
33384740dcSRalf Baechle extern void arch_init_irq(void);
34384740dcSRalf Baechle extern void spurious_interrupt(void);
35384740dcSRalf Baechle 
36384740dcSRalf Baechle extern int allocate_irqno(void);
37384740dcSRalf Baechle extern void alloc_legacy_irqno(void);
38384740dcSRalf Baechle extern void free_irqno(unsigned int irq);
39384740dcSRalf Baechle 
40384740dcSRalf Baechle /*
41384740dcSRalf Baechle  * Before R2 the timer and performance counter interrupts were both fixed to
42384740dcSRalf Baechle  * IE7.	 Since R2 their number has to be read from the c0_intctl register.
43384740dcSRalf Baechle  */
44384740dcSRalf Baechle #define CP0_LEGACY_COMPARE_IRQ 7
45c6a4ebb9SRalf Baechle #define CP0_LEGACY_PERFCNT_IRQ 7
46384740dcSRalf Baechle 
47384740dcSRalf Baechle extern int cp0_compare_irq;
48010c108dSDavid VomLehn extern int cp0_compare_irq_shift;
49384740dcSRalf Baechle extern int cp0_perfcount_irq;
508f7ff027SJames Hogan extern int cp0_fdc_irq;
518f7ff027SJames Hogan 
52*770847baSBjorn Helgaas extern int get_c0_fdc_int(void);
53384740dcSRalf Baechle 
54856839b7SEunbong Song void arch_trigger_all_cpu_backtrace(bool);
55856839b7SEunbong Song #define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
56856839b7SEunbong Song 
57384740dcSRalf Baechle #endif /* _ASM_IRQ_H */
58