irqdomain.h 1.9 KB

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