blob: e8e3a0a04eb079b179d3a67c47641a0ad95b07da [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifdef __KERNEL__
Paul Mackerras1b923132005-10-10 22:54:57 +10002#ifndef _ASM_POWERPC_IRQ_H
3#define _ASM_POWERPC_IRQ_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
Grant Likelybae1d8f2012-02-14 14:06:50 -070012#include <linux/irqdomain.h>
Paul Mackerras1b923132005-10-10 22:54:57 +100013#include <linux/threads.h>
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100014#include <linux/list.h>
15#include <linux/radix-tree.h>
Paul Mackerras1b923132005-10-10 22:54:57 +100016
17#include <asm/types.h>
Arun Sharma600634972011-07-26 16:09:06 -070018#include <linux/atomic.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070019
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100020
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100021extern atomic_t ppc_n_lost_interrupts;
22
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100023/* This number is used when no interrupt has been assigned */
24#define NO_IRQ (0)
25
Michael Ellerman551b81f2009-10-13 19:44:44 +000026/* Total number of virq in the platform */
27#define NR_IRQS CONFIG_NR_IRQS
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100028
Michael Ellermancd015702009-10-13 19:45:03 +000029/* Same thing, used by the generic IRQ code */
30#define NR_IRQS_LEGACY NUM_ISA_INTERRUPTS
31
Olof Johansson35923f122007-06-04 14:47:04 +100032extern irq_hw_number_t virq_to_hw(unsigned int virq);
Benjamin Herrenschmidt0b05ac62011-04-04 13:46:58 +100033
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100034static __inline__ int irq_canonicalize(int irq)
35{
36 return irq;
37}
38
Paul Mackerras1b923132005-10-10 22:54:57 +100039extern int distribute_irqs;
40
41struct irqaction;
42struct pt_regs;
43
Paul Mackerrasc6622f62006-02-24 10:06:59 +110044#define __ARCH_HAS_DO_SOFTIRQ
45
Kumar Galabcf0b082008-04-30 03:49:55 -050046#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
47/*
48 * Per-cpu stacks for handling critical, debug and machine check
49 * level interrupts.
50 */
51extern struct thread_info *critirq_ctx[NR_CPUS];
52extern struct thread_info *dbgirq_ctx[NR_CPUS];
53extern struct thread_info *mcheckirq_ctx[NR_CPUS];
54extern void exc_lvl_ctx_init(void);
55#else
56#define exc_lvl_ctx_init()
57#endif
58
Paul Mackerras1b923132005-10-10 22:54:57 +100059/*
60 * Per-cpu stacks for handling hard and soft interrupts.
61 */
62extern struct thread_info *hardirq_ctx[NR_CPUS];
63extern struct thread_info *softirq_ctx[NR_CPUS];
64
65extern void irq_ctx_init(void);
66extern void call_do_softirq(struct thread_info *tp);
Benjamin Herrenschmidt0366a1c2013-09-23 14:29:11 +100067extern void call_do_irq(struct pt_regs *regs, struct thread_info *tp);
Paul Mackerrasf2783c12005-10-20 09:23:26 +100068extern void do_IRQ(struct pt_regs *regs);
Benjamin Herrenschmidt0366a1c2013-09-23 14:29:11 +100069extern void __do_irq(struct pt_regs *regs);
Paul Mackerrasf2783c12005-10-20 09:23:26 +100070
Stuart Yoder6ec36b52011-05-19 08:54:26 -050071int irq_choose_cpu(const struct cpumask *mask);
72
Linus Torvalds1da177e2005-04-16 15:20:36 -070073#endif /* _ASM_IRQ_H */
74#endif /* __KERNEL__ */