irqdomain.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 struct irq_domain *x86_vector_domain;
  13. extern void init_irq_alloc_info(struct irq_alloc_info *info,
  14. const struct cpumask *mask);
  15. extern void copy_irq_alloc_info(struct irq_alloc_info *dst,
  16. struct irq_alloc_info *src);
  17. #endif /* CONFIG_X86_LOCAL_APIC */
  18. #ifdef CONFIG_X86_IO_APIC
  19. struct device_node;
  20. struct irq_data;
  21. enum ioapic_domain_type {
  22. IOAPIC_DOMAIN_INVALID,
  23. IOAPIC_DOMAIN_LEGACY,
  24. IOAPIC_DOMAIN_STRICT,
  25. IOAPIC_DOMAIN_DYNAMIC,
  26. };
  27. struct ioapic_domain_cfg {
  28. enum ioapic_domain_type type;
  29. const struct irq_domain_ops *ops;
  30. struct device_node *dev;
  31. };
  32. extern const struct irq_domain_ops mp_ioapic_irqdomain_ops;
  33. extern int mp_irqdomain_alloc(struct irq_domain *domain, unsigned int virq,
  34. unsigned int nr_irqs, void *arg);
  35. extern void mp_irqdomain_free(struct irq_domain *domain, unsigned int virq,
  36. unsigned int nr_irqs);
  37. extern int mp_irqdomain_activate(struct irq_domain *domain,
  38. struct irq_data *irq_data, bool reserve);
  39. extern void mp_irqdomain_deactivate(struct irq_domain *domain,
  40. struct irq_data *irq_data);
  41. extern int mp_irqdomain_ioapic_idx(struct irq_domain *domain);
  42. #endif /* CONFIG_X86_IO_APIC */
  43. #ifdef CONFIG_PCI_MSI
  44. extern void arch_init_msi_domain(struct irq_domain *domain);
  45. #else
  46. static inline void arch_init_msi_domain(struct irq_domain *domain) { }
  47. #endif
  48. #endif