]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
f7a0c786 TG |
2 | #ifndef _ASM_IRQDOMAIN_H |
3 | #define _ASM_IRQDOMAIN_H | |
4 | ||
5 | #include <linux/irqdomain.h> | |
d746d1eb JL |
6 | #include <asm/hw_irq.h> |
7 | ||
8 | #ifdef CONFIG_X86_LOCAL_APIC | |
9 | enum { | |
10 | /* Allocate contiguous CPU vectors */ | |
11 | X86_IRQ_ALLOC_CONTIGUOUS_VECTORS = 0x1, | |
3534be05 | 12 | X86_IRQ_ALLOC_LEGACY = 0x2, |
d746d1eb JL |
13 | }; |
14 | ||
15 | extern struct irq_domain *x86_vector_domain; | |
16 | ||
17 | extern void init_irq_alloc_info(struct irq_alloc_info *info, | |
18 | const struct cpumask *mask); | |
19 | extern void copy_irq_alloc_info(struct irq_alloc_info *dst, | |
20 | struct irq_alloc_info *src); | |
21 | #endif /* CONFIG_X86_LOCAL_APIC */ | |
22 | ||
23 | #ifdef CONFIG_X86_IO_APIC | |
24 | struct device_node; | |
25 | struct irq_data; | |
f7a0c786 TG |
26 | |
27 | enum ioapic_domain_type { | |
28 | IOAPIC_DOMAIN_INVALID, | |
29 | IOAPIC_DOMAIN_LEGACY, | |
30 | IOAPIC_DOMAIN_STRICT, | |
31 | IOAPIC_DOMAIN_DYNAMIC, | |
32 | }; | |
33 | ||
f7a0c786 TG |
34 | struct ioapic_domain_cfg { |
35 | enum ioapic_domain_type type; | |
36 | const struct irq_domain_ops *ops; | |
37 | struct device_node *dev; | |
38 | }; | |
39 | ||
40 | extern const struct irq_domain_ops mp_ioapic_irqdomain_ops; | |
41 | ||
42 | extern int mp_irqdomain_alloc(struct irq_domain *domain, unsigned int virq, | |
43 | unsigned int nr_irqs, void *arg); | |
44 | extern void mp_irqdomain_free(struct irq_domain *domain, unsigned int virq, | |
45 | unsigned int nr_irqs); | |
72491643 TG |
46 | extern int mp_irqdomain_activate(struct irq_domain *domain, |
47 | struct irq_data *irq_data, bool early); | |
f7a0c786 TG |
48 | extern void mp_irqdomain_deactivate(struct irq_domain *domain, |
49 | struct irq_data *irq_data); | |
50 | extern int mp_irqdomain_ioapic_idx(struct irq_domain *domain); | |
d746d1eb JL |
51 | #endif /* CONFIG_X86_IO_APIC */ |
52 | ||
53 | #ifdef CONFIG_PCI_MSI | |
54 | extern void arch_init_msi_domain(struct irq_domain *domain); | |
55 | #else | |
56 | static inline void arch_init_msi_domain(struct irq_domain *domain) { } | |
57 | #endif | |
58 | ||
f7a0c786 | 59 | #endif |