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