blob: 13f0409dd617e35cfa061fa638b27b0670b3b5e8 [file] [log] [blame]
Thomas Gleixner2874c5f2019-05-27 08:55:01 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifdef __KERNEL__
Paul Mackerras1b923132005-10-10 22:54:57 +10003#ifndef _ASM_POWERPC_IRQ_H
4#define _ASM_POWERPC_IRQ_H
5
6/*
Paul Mackerras1b923132005-10-10 22:54:57 +10007 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
Paul Mackerras1b923132005-10-10 22:54:57 +10009#include <linux/threads.h>
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100010#include <linux/list.h>
11#include <linux/radix-tree.h>
Paul Mackerras1b923132005-10-10 22:54:57 +100012
13#include <asm/types.h>
Arun Sharma600634972011-07-26 16:09:06 -070014#include <linux/atomic.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100016
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100017extern atomic_t ppc_n_lost_interrupts;
18
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100019/* This number is used when no interrupt has been assigned */
20#define NO_IRQ (0)
21
Michael Ellerman551b81f2009-10-13 19:44:44 +000022/* Total number of virq in the platform */
23#define NR_IRQS CONFIG_NR_IRQS
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100024
Marc Zyngier7c576f42018-09-13 10:42:25 +010025/* Number of irqs reserved for a legacy isa controller */
26#define NR_IRQS_LEGACY 16
Michael Ellermancd015702009-10-13 19:45:03 +000027
Olof Johansson35923f122007-06-04 14:47:04 +100028extern irq_hw_number_t virq_to_hw(unsigned int virq);
Benjamin Herrenschmidt0b05ac62011-04-04 13:46:58 +100029
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100030static __inline__ int irq_canonicalize(int irq)
31{
32 return irq;
33}
34
Paul Mackerras1b923132005-10-10 22:54:57 +100035extern int distribute_irqs;
36
Paul Mackerras1b923132005-10-10 22:54:57 +100037struct pt_regs;
38
Christophe Leroy047a6fd2021-10-19 09:29:25 +020039#ifdef CONFIG_BOOKE_OR_40x
Kumar Galabcf0b082008-04-30 03:49:55 -050040/*
41 * Per-cpu stacks for handling critical, debug and machine check
42 * level interrupts.
43 */
Christophe Leroya7916a12019-01-31 10:09:00 +000044extern void *critirq_ctx[NR_CPUS];
45extern void *dbgirq_ctx[NR_CPUS];
46extern void *mcheckirq_ctx[NR_CPUS];
Kumar Galabcf0b082008-04-30 03:49:55 -050047#endif
48
Paul Mackerras1b923132005-10-10 22:54:57 +100049/*
50 * Per-cpu stacks for handling hard and soft interrupts.
51 */
Christophe Leroya7916a12019-01-31 10:09:00 +000052extern void *hardirq_ctx[NR_CPUS];
53extern void *softirq_ctx[NR_CPUS];
Paul Mackerras1b923132005-10-10 22:54:57 +100054
Christophe Leroy98694162021-08-10 16:13:16 +000055void __do_IRQ(struct pt_regs *regs);
Mathieu Malaterre23a6d8b2018-02-25 18:22:31 +010056extern void __init init_IRQ(void);
Benjamin Herrenschmidt0366a1c2013-09-23 14:29:11 +100057extern void __do_irq(struct pt_regs *regs);
Paul Mackerrasf2783c12005-10-20 09:23:26 +100058
Stuart Yoder6ec36b52011-05-19 08:54:26 -050059int irq_choose_cpu(const struct cpumask *mask);
60
Linus Torvalds1da177e2005-04-16 15:20:36 -070061#endif /* _ASM_IRQ_H */
62#endif /* __KERNEL__ */