1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_X86_IRQ_H
3#define _ASM_X86_IRQ_H
4/*
5 * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar
6 *
7 * IRQ/IPI changes taken from work by Thomas Radke
8 * <tomsoft@informatik.tu-chemnitz.de>
9 */
10
11#include <asm/apicdef.h>
12#include <asm/irq_vectors.h>
13
14static inline int irq_canonicalize(int irq)
15{
16 return ((irq == 2) ? 9 : irq);
17}
18
19#ifdef CONFIG_X86_32
20extern void irq_ctx_init(int cpu);
21#else
22# define irq_ctx_init(cpu) do { } while (0)
23#endif
24
25#define __ARCH_HAS_DO_SOFTIRQ
26
27struct irq_desc;
28
29extern void fixup_irqs(void);
30
31#ifdef CONFIG_HAVE_KVM
32extern void kvm_set_posted_intr_wakeup_handler(void (*handler)(void));
33extern __visible void smp_kvm_posted_intr_ipi(struct pt_regs *regs);
34extern __visible void smp_kvm_posted_intr_wakeup_ipi(struct pt_regs *regs);
35extern __visible void smp_kvm_posted_intr_nested_ipi(struct pt_regs *regs);
36#endif
37
38extern void (*x86_platform_ipi_callback)(void);
39extern void native_init_IRQ(void);
40
41extern bool handle_irq(struct irq_desc *desc, struct pt_regs *regs);
42
43extern __visible unsigned int do_IRQ(struct pt_regs *regs);
44
45extern void init_ISA_irqs(void);
46
47extern void __init init_IRQ(void);
48
49#ifdef CONFIG_X86_LOCAL_APIC
50void arch_trigger_cpumask_backtrace(const struct cpumask *mask,
51 bool exclude_self);
52
53extern __visible void smp_x86_platform_ipi(struct pt_regs *regs);
54#define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace
55#endif
56
57#endif /* _ASM_X86_IRQ_H */
58