blob: 2a62017eb2750705d1b07f7defb21532c8ccbf27 [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/*
8 * A sane default based on a reasonable vector table size, platforms are
9 * advised to cap this at the hard limit that they're interested in
10 * through the machvec.
Linus Torvalds1da177e2005-04-16 15:20:36 -070011 */
Yoshihiro Shimodab32f1fe2010-07-06 04:32:40 +000012#define NR_IRQS 512
Paul Mundt62fad392009-05-22 13:50:18 +090013#define NR_IRQS_LEGACY 8 /* Legacy external IRQ0-7 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
Linus Torvalds1da177e2005-04-16 15:20:36 -070015/*
Paul Mundtdc825b12010-04-15 13:13:52 +090016 * This is a special IRQ number for indicating that no IRQ has been
17 * triggered and to simply ignore the IRQ dispatch. This is a special
18 * case that can happen with IRQ auto-distribution when multiple CPUs
19 * are woken up and signalled in parallel.
20 */
21#define NO_IRQ_IGNORE ((unsigned int)-1)
22
23/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 * Simple Mask Register Support
25 */
26extern void make_maskreg_irq(unsigned int irq);
27extern unsigned short *irq_mask_register;
28
29/*
Paul Mundt0f08f332006-09-27 17:03:56 +090030 * PINT IRQs
31 */
32void init_IRQ_pint(void);
Jamie Lenehanea0f8fe2006-12-06 12:05:02 +090033void make_imask_irq(unsigned int irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
Linus Torvalds1da177e2005-04-16 15:20:36 -070035static inline int generic_irq_demux(int irq)
36{
37 return irq;
38}
39
Paul Mundt9a7ef6d2006-11-20 13:55:34 +090040#define irq_demux(irq) sh_mv.mv_irq_demux(irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
Paul Mundtfa439722008-09-04 18:53:58 +090042void init_IRQ(void);
Paul Mundt763142d2010-04-26 19:08:55 +090043void migrate_irqs(void);
44
Paul Mundtfa439722008-09-04 18:53:58 +090045asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs);
46
Paul Mundt110ed282007-11-02 12:16:51 +090047#ifdef CONFIG_IRQSTACKS
Paul Mundta6a311392006-09-27 18:22:14 +090048extern void irq_ctx_init(int cpu);
49extern void irq_ctx_exit(int cpu);
50# define __ARCH_HAS_DO_SOFTIRQ
51#else
52# define irq_ctx_init(cpu) do { } while (0)
53# define irq_ctx_exit(cpu) do { } while (0)
54#endif
55
Paul Mundtdc825b12010-04-15 13:13:52 +090056#ifdef CONFIG_INTC_BALANCING
57extern unsigned int irq_lookup(unsigned int irq);
58extern void irq_finish(unsigned int irq);
59#else
60#define irq_lookup(irq) (irq)
61#define irq_finish(irq) do { } while (0)
62#endif
63
Paul Mundtf8f06bc2009-06-14 23:21:54 +090064#include <asm-generic/irq.h>
Paul Mundtc7a49dd2008-02-13 20:16:47 +090065#ifdef CONFIG_CPU_SH5
Paul Mundtf15cbe62008-07-29 08:09:44 +090066#include <cpu/irq.h>
Paul Mundtc7a49dd2008-02-13 20:16:47 +090067#endif
68
Linus Torvalds1da177e2005-04-16 15:20:36 -070069#endif /* __ASM_SH_IRQ_H */