blob: 0e4f532e47379d1af1ded1eae3fc9f086a7966c2 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __ASM_SH_IRQ_H
2#define __ASM_SH_IRQ_H
3
Paul Mundt763142d2010-04-26 19:08:55 +09004#include <linux/cpumask.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005#include <asm/machvec.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
Paul Mundtbe782df2007-03-12 14:09:35 +09007/*
Paul Mundt63dc02b2012-05-21 17:54:01 +09008 * Only legacy non-sparseirq platforms have to set a reasonably sane
9 * value here. sparseirq platforms allocate their irq_descs on the fly,
10 * so will expand automatically based on the number of registered IRQs.
Linus Torvalds1da177e2005-04-16 15:20:36 -070011 */
Paul Mundt63dc02b2012-05-21 17:54:01 +090012#ifdef CONFIG_SPARSE_IRQ
13# define NR_IRQS 8
14#else
15# define NR_IRQS 512
16#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
Linus Torvalds1da177e2005-04-16 15:20:36 -070018/*
Paul Mundtdc825b12010-04-15 13:13:52 +090019 * This is a special IRQ number for indicating that no IRQ has been
20 * triggered and to simply ignore the IRQ dispatch. This is a special
21 * case that can happen with IRQ auto-distribution when multiple CPUs
22 * are woken up and signalled in parallel.
23 */
24#define NO_IRQ_IGNORE ((unsigned int)-1)
25
26/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 * Simple Mask Register Support
28 */
29extern void make_maskreg_irq(unsigned int irq);
30extern unsigned short *irq_mask_register;
31
32/*
Paul Mundt0f08f332006-09-27 17:03:56 +090033 * PINT IRQs
34 */
35void init_IRQ_pint(void);
Jamie Lenehanea0f8fe2006-12-06 12:05:02 +090036void make_imask_irq(unsigned int irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
Linus Torvalds1da177e2005-04-16 15:20:36 -070038static inline int generic_irq_demux(int irq)
39{
40 return irq;
41}
42
Paul Mundt9a7ef6d2006-11-20 13:55:34 +090043#define irq_demux(irq) sh_mv.mv_irq_demux(irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -070044
Paul Mundtfa439722008-09-04 18:53:58 +090045void init_IRQ(void);
Paul Mundt763142d2010-04-26 19:08:55 +090046void migrate_irqs(void);
47
Paul Mundtfa439722008-09-04 18:53:58 +090048asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs);
49
Paul Mundt110ed282007-11-02 12:16:51 +090050#ifdef CONFIG_IRQSTACKS
Paul Mundta6a311392006-09-27 18:22:14 +090051extern void irq_ctx_init(int cpu);
52extern void irq_ctx_exit(int cpu);
53# define __ARCH_HAS_DO_SOFTIRQ
54#else
55# define irq_ctx_init(cpu) do { } while (0)
56# define irq_ctx_exit(cpu) do { } while (0)
57#endif
58
Paul Mundtdc825b12010-04-15 13:13:52 +090059#ifdef CONFIG_INTC_BALANCING
60extern unsigned int irq_lookup(unsigned int irq);
61extern void irq_finish(unsigned int irq);
62#else
63#define irq_lookup(irq) (irq)
64#define irq_finish(irq) do { } while (0)
65#endif
66
Paul Mundtf8f06bc2009-06-14 23:21:54 +090067#include <asm-generic/irq.h>
Paul Mundtc7a49dd2008-02-13 20:16:47 +090068#ifdef CONFIG_CPU_SH5
Paul Mundtf15cbe62008-07-29 08:09:44 +090069#include <cpu/irq.h>
Paul Mundtc7a49dd2008-02-13 20:16:47 +090070#endif
71
Linus Torvalds1da177e2005-04-16 15:20:36 -070072#endif /* __ASM_SH_IRQ_H */