]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - arch/mips/include/asm/irq.h
Merge branches 'for-4.11/upstream-fixes', 'for-4.12/accutouch', 'for-4.12/cp2112...
[mirror_ubuntu-artful-kernel.git] / arch / mips / include / asm / 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
1da177e4 12#include <linux/linkage.h>
631330f5 13#include <linux/smp.h>
abd2363f 14#include <linux/irqdomain.h>
41c594ab
RB
15
16#include <asm/mipsmtregs.h>
17
1da177e4
LT
18#include <irq.h>
19
fe8bd18f
MR
20#define IRQ_STACK_SIZE THREAD_SIZE
21
22extern void *irq_stack[NR_CPUS];
23
24static inline bool on_irq_stack(int cpu, unsigned long sp)
25{
26 unsigned long low = (unsigned long)irq_stack[cpu];
27 unsigned long high = low + IRQ_STACK_SIZE;
28
29 return (low <= sp && sp <= high);
30}
31
1da177e4
LT
32#ifdef CONFIG_I8259
33static inline int irq_canonicalize(int irq)
34{
2fa7937b 35 return ((irq == I8259A_IRQ_BASE + 2) ? I8259A_IRQ_BASE + 9 : irq);
1da177e4
LT
36}
37#else
38#define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */
39#endif
40
950e97ca
SR
41asmlinkage void plat_irq_dispatch(void);
42
8f99a162 43extern void do_IRQ(unsigned int irq);
1da177e4 44
1da177e4 45extern void arch_init_irq(void);
937a8015 46extern void spurious_interrupt(void);
1da177e4 47
4a4cf779
RB
48extern int allocate_irqno(void);
49extern void alloc_legacy_irqno(void);
50extern void free_irqno(unsigned int irq);
51
3b1d4ed5
RB
52/*
53 * Before R2 the timer and performance counter interrupts were both fixed to
70342287 54 * IE7. Since R2 their number has to be read from the c0_intctl register.
3b1d4ed5
RB
55 */
56#define CP0_LEGACY_COMPARE_IRQ 7
c6a4ebb9 57#define CP0_LEGACY_PERFCNT_IRQ 7
3b1d4ed5
RB
58
59extern int cp0_compare_irq;
010c108d 60extern int cp0_compare_irq_shift;
3b1d4ed5 61extern int cp0_perfcount_irq;
8f7ff027
JH
62extern int cp0_fdc_irq;
63
770847ba 64extern int get_c0_fdc_int(void);
3b1d4ed5 65
9a01c3ed
CM
66void arch_trigger_cpumask_backtrace(const struct cpumask *mask,
67 bool exclude_self);
68#define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace
856839b7 69
1da177e4 70#endif /* _ASM_IRQ_H */