]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - arch/x86/include/asm/hw_irq.h
objtool: Improve error message for bad file argument
[mirror_ubuntu-jammy-kernel.git] / arch / x86 / include / asm / hw_irq.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
1965aae3
PA
2#ifndef _ASM_X86_HW_IRQ_H
3#define _ASM_X86_HW_IRQ_H
2e088436
TG
4
5/*
6 * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar
7 *
8 * moved some of the old arch/i386/kernel/irq.h to here. VY
9 *
10 * IRQ/IPI changes taken from work by Thomas Radke
11 * <tomsoft@informatik.tu-chemnitz.de>
12 *
13 * hacked by Andi Kleen for x86-64.
14 * unified by tglx
15 */
16
9b7dc567 17#include <asm/irq_vectors.h>
2e088436
TG
18
19#ifndef __ASSEMBLY__
20
21#include <linux/percpu.h>
22#include <linux/profile.h>
23#include <linux/smp.h>
24
60063497 25#include <linux/atomic.h>
2e088436
TG
26#include <asm/irq.h>
27#include <asm/sections.h>
28
2e088436 29/* Interrupt handlers registered during init_IRQ */
1d9090e2
AK
30extern asmlinkage void apic_timer_interrupt(void);
31extern asmlinkage void x86_platform_ipi(void);
32extern asmlinkage void kvm_posted_intr_ipi(void);
f6b3c72c 33extern asmlinkage void kvm_posted_intr_wakeup_ipi(void);
210f84b0 34extern asmlinkage void kvm_posted_intr_nested_ipi(void);
1d9090e2
AK
35extern asmlinkage void error_interrupt(void);
36extern asmlinkage void irq_work_interrupt(void);
37
38extern asmlinkage void spurious_interrupt(void);
39extern asmlinkage void thermal_interrupt(void);
40extern asmlinkage void reschedule_interrupt(void);
41
1d9090e2
AK
42extern asmlinkage void irq_move_cleanup_interrupt(void);
43extern asmlinkage void reboot_interrupt(void);
44extern asmlinkage void threshold_interrupt(void);
24fd78a8 45extern asmlinkage void deferred_error_interrupt(void);
1d9090e2
AK
46
47extern asmlinkage void call_function_interrupt(void);
48extern asmlinkage void call_function_single_interrupt(void);
2e088436 49
26011eee 50#ifdef CONFIG_X86_LOCAL_APIC
74afab7a 51struct irq_data;
947045a2
JL
52struct pci_dev;
53struct msi_desc;
54
55enum irq_alloc_type {
56 X86_IRQ_ALLOC_TYPE_IOAPIC = 1,
57 X86_IRQ_ALLOC_TYPE_HPET,
58 X86_IRQ_ALLOC_TYPE_MSI,
59 X86_IRQ_ALLOC_TYPE_MSIX,
0921f1da 60 X86_IRQ_ALLOC_TYPE_DMAR,
43fe1abc 61 X86_IRQ_ALLOC_TYPE_UV,
947045a2 62};
b5dc8e6c
JL
63
64struct irq_alloc_info {
947045a2 65 enum irq_alloc_type type;
b5dc8e6c
JL
66 u32 flags;
67 const struct cpumask *mask; /* CPU mask for vector allocation */
947045a2
JL
68 union {
69 int unused;
70#ifdef CONFIG_HPET_TIMER
71 struct {
72 int hpet_id;
73 int hpet_index;
74 void *hpet_data;
75 };
76#endif
77#ifdef CONFIG_PCI_MSI
78 struct {
79 struct pci_dev *msi_dev;
80 irq_hw_number_t msi_hwirq;
81 };
82#endif
83#ifdef CONFIG_X86_IO_APIC
84 struct {
85 int ioapic_id;
86 int ioapic_pin;
87 int ioapic_node;
88 u32 ioapic_trigger : 1;
89 u32 ioapic_polarity : 1;
90 u32 ioapic_valid : 1;
91 struct IO_APIC_route_entry *ioapic_entry;
92 };
0921f1da
JL
93#endif
94#ifdef CONFIG_DMAR_TABLE
95 struct {
96 int dmar_id;
97 void *dmar_data;
98 };
49e07d8f
JL
99#endif
100#ifdef CONFIG_HT_IRQ
101 struct {
102 int ht_pos;
103 int ht_idx;
104 struct pci_dev *ht_dev;
105 void *ht_update;
106 };
43fe1abc
JL
107#endif
108#ifdef CONFIG_X86_UV
109 struct {
110 int uv_limit;
111 int uv_blade;
112 unsigned long uv_offset;
113 char *uv_name;
114 };
185a383a
KB
115#endif
116#if IS_ENABLED(CONFIG_VMD)
117 struct {
118 struct msi_desc *desc;
119 };
947045a2
JL
120#endif
121 };
b5dc8e6c
JL
122};
123
9338ad6f 124struct irq_cfg {
5f0052f9 125 unsigned int dest_apicid;
9338ad6f 126 u8 vector;
551adc60 127 u8 old_vector;
9338ad6f
DS
128};
129
55a0e2b1
JL
130extern struct irq_cfg *irq_cfg(unsigned int irq);
131extern struct irq_cfg *irqd_cfg(struct irq_data *irq_data);
74afab7a
JL
132extern void lock_vector_lock(void);
133extern void unlock_vector_lock(void);
74afab7a 134extern void setup_vector_irq(int cpu);
e32c67e0 135#ifdef CONFIG_SMP
9338ad6f 136extern void send_cleanup_vector(struct irq_cfg *);
f0e5bf75 137extern void irq_complete_move(struct irq_cfg *cfg);
e32c67e0
JL
138#else
139static inline void send_cleanup_vector(struct irq_cfg *c) { }
f0e5bf75 140static inline void irq_complete_move(struct irq_cfg *c) { }
e32c67e0 141#endif
7ec13187 142
74afab7a 143extern void apic_ack_edge(struct irq_data *data);
74afab7a 144#else /* CONFIG_X86_LOCAL_APIC */
26011eee
JL
145static inline void lock_vector_lock(void) {}
146static inline void unlock_vector_lock(void) {}
74afab7a 147#endif /* CONFIG_X86_LOCAL_APIC */
26011eee 148
2e088436
TG
149/* Statistics */
150extern atomic_t irq_err_count;
151extern atomic_t irq_mis_count;
152
ea6cd250 153extern void elcr_set_level_irq(unsigned int irq);
1a331957 154
3304c9c3 155extern char irq_entries_start[];
25c74b10 156#ifdef CONFIG_TRACING
3304c9c3 157#define trace_irq_entries_start irq_entries_start
25c74b10 158#endif
497c9a19 159
a782a7e4
TG
160#define VECTOR_UNUSED NULL
161#define VECTOR_RETRIGGERED ((void *)~0UL)
9345005f 162
a782a7e4 163typedef struct irq_desc* vector_irq_t[NR_VECTORS];
22dc12d1 164DECLARE_PER_CPU(vector_irq_t, vector_irq);
2e088436 165
22dc12d1
TG
166#endif /* !ASSEMBLY_ */
167
1965aae3 168#endif /* _ASM_X86_HW_IRQ_H */