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