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