blob: 814dfab7e392ed677446d1a2dfc7cc4ab852ce0e [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001/* SPDX-License-Identifier: GPL-2.0-or-later */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002#ifdef __KERNEL__
3#ifndef _ASM_POWERPC_IRQ_H
4#define _ASM_POWERPC_IRQ_H
5
6/*
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00007 */
8
9#include <linux/irqdomain.h>
10#include <linux/threads.h>
11#include <linux/list.h>
12#include <linux/radix-tree.h>
13
14#include <asm/types.h>
15#include <linux/atomic.h>
16
17
18extern atomic_t ppc_n_lost_interrupts;
19
20/* This number is used when no interrupt has been assigned */
21#define NO_IRQ (0)
22
23/* Total number of virq in the platform */
24#define NR_IRQS CONFIG_NR_IRQS
25
26/* Same thing, used by the generic IRQ code */
27#define NR_IRQS_LEGACY NUM_ISA_INTERRUPTS
28
29extern irq_hw_number_t virq_to_hw(unsigned int virq);
30
31static __inline__ int irq_canonicalize(int irq)
32{
33 return irq;
34}
35
36extern int distribute_irqs;
37
38struct irqaction;
39struct pt_regs;
40
41#define __ARCH_HAS_DO_SOFTIRQ
42
43#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
44/*
45 * Per-cpu stacks for handling critical, debug and machine check
46 * level interrupts.
47 */
David Brazdil0f672f62019-12-10 10:32:29 +000048extern void *critirq_ctx[NR_CPUS];
49extern void *dbgirq_ctx[NR_CPUS];
50extern void *mcheckirq_ctx[NR_CPUS];
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000051#endif
52
53/*
54 * Per-cpu stacks for handling hard and soft interrupts.
55 */
David Brazdil0f672f62019-12-10 10:32:29 +000056extern void *hardirq_ctx[NR_CPUS];
57extern void *softirq_ctx[NR_CPUS];
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000058
David Brazdil0f672f62019-12-10 10:32:29 +000059void call_do_softirq(void *sp);
60void call_do_irq(struct pt_regs *regs, void *sp);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000061extern void do_IRQ(struct pt_regs *regs);
62extern void __init init_IRQ(void);
63extern void __do_irq(struct pt_regs *regs);
64
65int irq_choose_cpu(const struct cpumask *mask);
66
67#endif /* _ASM_IRQ_H */
68#endif /* __KERNEL__ */