irq_remapping.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2012 Advanced Micro Devices, Inc.
  4. * Author: Joerg Roedel <jroedel@suse.de>
  5. *
  6. * This header file contains stuff that is shared between different interrupt
  7. * remapping drivers but with no need to be visible outside of the IOMMU layer.
  8. */
  9. #ifndef __IRQ_REMAPPING_H
  10. #define __IRQ_REMAPPING_H
  11. #ifdef CONFIG_IRQ_REMAP
  12. struct irq_data;
  13. struct msi_msg;
  14. struct irq_domain;
  15. struct irq_alloc_info;
  16. extern int irq_remap_broken;
  17. extern int disable_sourceid_checking;
  18. extern int no_x2apic_optout;
  19. extern int irq_remapping_enabled;
  20. extern int disable_irq_post;
  21. struct irq_remap_ops {
  22. /* The supported capabilities */
  23. int capability;
  24. /* Initializes hardware and makes it ready for remapping interrupts */
  25. int (*prepare)(void);
  26. /* Enables the remapping hardware */
  27. int (*enable)(void);
  28. /* Disables the remapping hardware */
  29. void (*disable)(void);
  30. /* Reenables the remapping hardware */
  31. int (*reenable)(int);
  32. /* Enable fault handling */
  33. int (*enable_faulting)(void);
  34. /* Get the irqdomain associated to IOMMU device */
  35. struct irq_domain *(*get_irq_domain)(struct irq_alloc_info *);
  36. };
  37. extern struct irq_remap_ops intel_irq_remap_ops;
  38. extern struct irq_remap_ops amd_iommu_irq_ops;
  39. extern struct irq_remap_ops hyperv_irq_remap_ops;
  40. #else /* CONFIG_IRQ_REMAP */
  41. #define irq_remapping_enabled 0
  42. #define irq_remap_broken 0
  43. #define disable_irq_post 1
  44. #endif /* CONFIG_IRQ_REMAP */
  45. #endif /* __IRQ_REMAPPING_H */