Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _ASM_IRQDOMAIN_H
0003 #define _ASM_IRQDOMAIN_H
0004 
0005 #include <linux/irqdomain.h>
0006 #include <asm/hw_irq.h>
0007 
0008 #ifdef CONFIG_X86_LOCAL_APIC
0009 enum {
0010     /* Allocate contiguous CPU vectors */
0011     X86_IRQ_ALLOC_CONTIGUOUS_VECTORS        = 0x1,
0012     X86_IRQ_ALLOC_LEGACY                = 0x2,
0013 };
0014 
0015 extern int x86_fwspec_is_ioapic(struct irq_fwspec *fwspec);
0016 extern int x86_fwspec_is_hpet(struct irq_fwspec *fwspec);
0017 
0018 extern struct irq_domain *x86_vector_domain;
0019 
0020 extern void init_irq_alloc_info(struct irq_alloc_info *info,
0021                 const struct cpumask *mask);
0022 extern void copy_irq_alloc_info(struct irq_alloc_info *dst,
0023                 struct irq_alloc_info *src);
0024 #endif /* CONFIG_X86_LOCAL_APIC */
0025 
0026 #ifdef CONFIG_X86_IO_APIC
0027 struct device_node;
0028 struct irq_data;
0029 
0030 enum ioapic_domain_type {
0031     IOAPIC_DOMAIN_INVALID,
0032     IOAPIC_DOMAIN_LEGACY,
0033     IOAPIC_DOMAIN_STRICT,
0034     IOAPIC_DOMAIN_DYNAMIC,
0035 };
0036 
0037 struct ioapic_domain_cfg {
0038     enum ioapic_domain_type     type;
0039     const struct irq_domain_ops *ops;
0040     struct device_node      *dev;
0041 };
0042 
0043 extern const struct irq_domain_ops mp_ioapic_irqdomain_ops;
0044 
0045 extern int mp_irqdomain_alloc(struct irq_domain *domain, unsigned int virq,
0046                   unsigned int nr_irqs, void *arg);
0047 extern void mp_irqdomain_free(struct irq_domain *domain, unsigned int virq,
0048                   unsigned int nr_irqs);
0049 extern int mp_irqdomain_activate(struct irq_domain *domain,
0050                  struct irq_data *irq_data, bool reserve);
0051 extern void mp_irqdomain_deactivate(struct irq_domain *domain,
0052                     struct irq_data *irq_data);
0053 extern int mp_irqdomain_ioapic_idx(struct irq_domain *domain);
0054 #endif /* CONFIG_X86_IO_APIC */
0055 
0056 #ifdef CONFIG_PCI_MSI
0057 void x86_create_pci_msi_domain(void);
0058 struct irq_domain *native_create_pci_msi_domain(void);
0059 extern struct irq_domain *x86_pci_msi_default_domain;
0060 #else
0061 static inline void x86_create_pci_msi_domain(void) { }
0062 #define native_create_pci_msi_domain    NULL
0063 #define x86_pci_msi_default_domain  NULL
0064 #endif
0065 
0066 #endif