blob: c1eda9199214e6f0d80d5f665d5b8da926bc6fff [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
Grant Likelybae1d8f2012-02-14 14:06:50 -07009#include <linux/irqdomain.h>
Paul Mackerras1b923132005-10-10 22:54:57 +100010#include <linux/threads.h>
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100011#include <linux/list.h>
12#include <linux/radix-tree.h>
Paul Mackerras1b923132005-10-10 22:54:57 +100013
14#include <asm/types.h>
Arun Sharma600634972011-07-26 16:09:06 -070015#include <linux/atomic.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100017
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100018extern atomic_t ppc_n_lost_interrupts;
19
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100020/* This number is used when no interrupt has been assigned */
21#define NO_IRQ (0)
22
Michael Ellerman551b81f2009-10-13 19:44:44 +000023/* Total number of virq in the platform */
24#define NR_IRQS CONFIG_NR_IRQS
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100025
Marc Zyngier7c576f42018-09-13 10:42:25 +010026/* Number of irqs reserved for a legacy isa controller */
27#define NR_IRQS_LEGACY 16
Michael Ellermancd015702009-10-13 19:45:03 +000028
Olof Johansson35923f122007-06-04 14:47:04 +100029extern irq_hw_number_t virq_to_hw(unsigned int virq);
Benjamin Herrenschmidt0b05ac62011-04-04 13:46:58 +100030
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100031static __inline__ int irq_canonicalize(int irq)
32{
33 return irq;
34}
35
Paul Mackerras1b923132005-10-10 22:54:57 +100036extern int distribute_irqs;
37
Paul Mackerras1b923132005-10-10 22:54:57 +100038struct pt_regs;
39
Kumar Galabcf0b082008-04-30 03:49:55 -050040#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
41/*
42 * Per-cpu stacks for handling critical, debug and machine check
43 * level interrupts.
44 */
Christophe Leroya7916a12019-01-31 10:09:00 +000045extern void *critirq_ctx[NR_CPUS];
46extern void *dbgirq_ctx[NR_CPUS];
47extern void *mcheckirq_ctx[NR_CPUS];
Kumar Galabcf0b082008-04-30 03:49:55 -050048#endif
49
Paul Mackerras1b923132005-10-10 22:54:57 +100050/*
51 * Per-cpu stacks for handling hard and soft interrupts.
52 */
Christophe Leroya7916a12019-01-31 10:09:00 +000053extern void *hardirq_ctx[NR_CPUS];
54extern void *softirq_ctx[NR_CPUS];
Paul Mackerras1b923132005-10-10 22:54:57 +100055
Paul Mackerrasf2783c12005-10-20 09:23:26 +100056extern void do_IRQ(struct pt_regs *regs);
Mathieu Malaterre23a6d8b2018-02-25 18:22:31 +010057extern void __init init_IRQ(void);
Benjamin Herrenschmidt0366a1c2013-09-23 14:29:11 +100058extern void __do_irq(struct pt_regs *regs);
Paul Mackerrasf2783c12005-10-20 09:23:26 +100059
Stuart Yoder6ec36b52011-05-19 08:54:26 -050060int irq_choose_cpu(const struct cpumask *mask);
61
Linus Torvalds1da177e2005-04-16 15:20:36 -070062#endif /* _ASM_IRQ_H */
63#endif /* __KERNEL__ */