xref: /openbmc/linux/arch/sh/include/asm/irq.h (revision ad1a4830)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2f15cbe6fSPaul Mundt #ifndef __ASM_SH_IRQ_H
3f15cbe6fSPaul Mundt #define __ASM_SH_IRQ_H
4f15cbe6fSPaul Mundt 
5763142d1SPaul Mundt #include <linux/cpumask.h>
6f15cbe6fSPaul Mundt #include <asm/machvec.h>
7f15cbe6fSPaul Mundt 
8f15cbe6fSPaul Mundt /*
9dc825b17SPaul Mundt  * This is a special IRQ number for indicating that no IRQ has been
10dc825b17SPaul Mundt  * triggered and to simply ignore the IRQ dispatch. This is a special
11dc825b17SPaul Mundt  * case that can happen with IRQ auto-distribution when multiple CPUs
12dc825b17SPaul Mundt  * are woken up and signalled in parallel.
13dc825b17SPaul Mundt  */
14dc825b17SPaul Mundt #define NO_IRQ_IGNORE		((unsigned int)-1)
15dc825b17SPaul Mundt 
16dc825b17SPaul Mundt /*
17f15cbe6fSPaul Mundt  * Simple Mask Register Support
18f15cbe6fSPaul Mundt  */
19f15cbe6fSPaul Mundt extern void make_maskreg_irq(unsigned int irq);
20f15cbe6fSPaul Mundt extern unsigned short *irq_mask_register;
21f15cbe6fSPaul Mundt 
22f15cbe6fSPaul Mundt /*
23f15cbe6fSPaul Mundt  * PINT IRQs
24f15cbe6fSPaul Mundt  */
25f15cbe6fSPaul Mundt void make_imask_irq(unsigned int irq);
26f15cbe6fSPaul Mundt 
generic_irq_demux(int irq)27f15cbe6fSPaul Mundt static inline int generic_irq_demux(int irq)
28f15cbe6fSPaul Mundt {
29f15cbe6fSPaul Mundt 	return irq;
30f15cbe6fSPaul Mundt }
31f15cbe6fSPaul Mundt 
32f15cbe6fSPaul Mundt #define irq_demux(irq)		sh_mv.mv_irq_demux(irq)
33f15cbe6fSPaul Mundt 
34fa43972fSPaul Mundt void init_IRQ(void);
35763142d1SPaul Mundt void migrate_irqs(void);
36763142d1SPaul Mundt 
37fa43972fSPaul Mundt asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs);
38fa43972fSPaul Mundt 
39f15cbe6fSPaul Mundt #ifdef CONFIG_IRQSTACKS
40f15cbe6fSPaul Mundt extern void irq_ctx_init(int cpu);
41f15cbe6fSPaul Mundt extern void irq_ctx_exit(int cpu);
42f15cbe6fSPaul Mundt #else
43f15cbe6fSPaul Mundt # define irq_ctx_init(cpu) do { } while (0)
44f15cbe6fSPaul Mundt # define irq_ctx_exit(cpu) do { } while (0)
45f15cbe6fSPaul Mundt #endif
46f15cbe6fSPaul Mundt 
47dc825b17SPaul Mundt #ifdef CONFIG_INTC_BALANCING
48dc825b17SPaul Mundt extern unsigned int irq_lookup(unsigned int irq);
49dc825b17SPaul Mundt extern void irq_finish(unsigned int irq);
50dc825b17SPaul Mundt #else
51dc825b17SPaul Mundt #define irq_lookup(irq)		(irq)
52dc825b17SPaul Mundt #define irq_finish(irq)		do { } while (0)
53dc825b17SPaul Mundt #endif
54dc825b17SPaul Mundt 
55f8f06bc7SPaul Mundt #include <asm-generic/irq.h>
56f15cbe6fSPaul Mundt 
57f15cbe6fSPaul Mundt #endif /* __ASM_SH_IRQ_H */
58