Thomas Gleixner | 2874c5f | 2019-05-27 08:55:01 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | #ifdef __KERNEL__ |
Paul Mackerras | 1b92313 | 2005-10-10 22:54:57 +1000 | [diff] [blame] | 3 | #ifndef _ASM_POWERPC_IRQ_H |
| 4 | #define _ASM_POWERPC_IRQ_H |
| 5 | |
| 6 | /* |
Paul Mackerras | 1b92313 | 2005-10-10 22:54:57 +1000 | [diff] [blame] | 7 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | |
Grant Likely | bae1d8f | 2012-02-14 14:06:50 -0700 | [diff] [blame] | 9 | #include <linux/irqdomain.h> |
Paul Mackerras | 1b92313 | 2005-10-10 22:54:57 +1000 | [diff] [blame] | 10 | #include <linux/threads.h> |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 11 | #include <linux/list.h> |
| 12 | #include <linux/radix-tree.h> |
Paul Mackerras | 1b92313 | 2005-10-10 22:54:57 +1000 | [diff] [blame] | 13 | |
| 14 | #include <asm/types.h> |
Arun Sharma | 60063497 | 2011-07-26 16:09:06 -0700 | [diff] [blame] | 15 | #include <linux/atomic.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 17 | |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 18 | extern atomic_t ppc_n_lost_interrupts; |
| 19 | |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 20 | /* This number is used when no interrupt has been assigned */ |
| 21 | #define NO_IRQ (0) |
| 22 | |
Michael Ellerman | 551b81f | 2009-10-13 19:44:44 +0000 | [diff] [blame] | 23 | /* Total number of virq in the platform */ |
| 24 | #define NR_IRQS CONFIG_NR_IRQS |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 25 | |
Marc Zyngier | 7c576f4 | 2018-09-13 10:42:25 +0100 | [diff] [blame^] | 26 | /* Number of irqs reserved for a legacy isa controller */ |
| 27 | #define NR_IRQS_LEGACY 16 |
Michael Ellerman | cd01570 | 2009-10-13 19:45:03 +0000 | [diff] [blame] | 28 | |
Olof Johansson | 35923f12 | 2007-06-04 14:47:04 +1000 | [diff] [blame] | 29 | extern irq_hw_number_t virq_to_hw(unsigned int virq); |
Benjamin Herrenschmidt | 0b05ac6 | 2011-04-04 13:46:58 +1000 | [diff] [blame] | 30 | |
Benjamin Herrenschmidt | 0ebfff1 | 2006-07-03 21:36:01 +1000 | [diff] [blame] | 31 | static __inline__ int irq_canonicalize(int irq) |
| 32 | { |
| 33 | return irq; |
| 34 | } |
| 35 | |
Paul Mackerras | 1b92313 | 2005-10-10 22:54:57 +1000 | [diff] [blame] | 36 | extern int distribute_irqs; |
| 37 | |
Paul Mackerras | 1b92313 | 2005-10-10 22:54:57 +1000 | [diff] [blame] | 38 | struct pt_regs; |
| 39 | |
Kumar Gala | bcf0b08 | 2008-04-30 03:49:55 -0500 | [diff] [blame] | 40 | #if defined(CONFIG_BOOKE) || defined(CONFIG_40x) |
| 41 | /* |
| 42 | * Per-cpu stacks for handling critical, debug and machine check |
| 43 | * level interrupts. |
| 44 | */ |
Christophe Leroy | a7916a1 | 2019-01-31 10:09:00 +0000 | [diff] [blame] | 45 | extern void *critirq_ctx[NR_CPUS]; |
| 46 | extern void *dbgirq_ctx[NR_CPUS]; |
| 47 | extern void *mcheckirq_ctx[NR_CPUS]; |
Kumar Gala | bcf0b08 | 2008-04-30 03:49:55 -0500 | [diff] [blame] | 48 | #endif |
| 49 | |
Paul Mackerras | 1b92313 | 2005-10-10 22:54:57 +1000 | [diff] [blame] | 50 | /* |
| 51 | * Per-cpu stacks for handling hard and soft interrupts. |
| 52 | */ |
Christophe Leroy | a7916a1 | 2019-01-31 10:09:00 +0000 | [diff] [blame] | 53 | extern void *hardirq_ctx[NR_CPUS]; |
| 54 | extern void *softirq_ctx[NR_CPUS]; |
Paul Mackerras | 1b92313 | 2005-10-10 22:54:57 +1000 | [diff] [blame] | 55 | |
Paul Mackerras | f2783c1 | 2005-10-20 09:23:26 +1000 | [diff] [blame] | 56 | extern void do_IRQ(struct pt_regs *regs); |
Mathieu Malaterre | 23a6d8b | 2018-02-25 18:22:31 +0100 | [diff] [blame] | 57 | extern void __init init_IRQ(void); |
Benjamin Herrenschmidt | 0366a1c | 2013-09-23 14:29:11 +1000 | [diff] [blame] | 58 | extern void __do_irq(struct pt_regs *regs); |
Paul Mackerras | f2783c1 | 2005-10-20 09:23:26 +1000 | [diff] [blame] | 59 | |
Stuart Yoder | 6ec36b5 | 2011-05-19 08:54:26 -0500 | [diff] [blame] | 60 | int irq_choose_cpu(const struct cpumask *mask); |
| 61 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | #endif /* _ASM_IRQ_H */ |
| 63 | #endif /* __KERNEL__ */ |