irq_remapping.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * Copyright (C) 2012 Advanced Micro Devices, Inc.
  3. * Author: Joerg Roedel <joerg.roedel@amd.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License version 2 as published
  7. * by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. *
  18. * This header file contains the interface of the interrupt remapping code to
  19. * the x86 interrupt management code.
  20. */
  21. #ifndef __X86_IRQ_REMAPPING_H
  22. #define __X86_IRQ_REMAPPING_H
  23. #include <asm/io_apic.h>
  24. #ifdef CONFIG_IRQ_REMAP
  25. extern int irq_remapping_enabled;
  26. extern void setup_irq_remapping_ops(void);
  27. extern int irq_remapping_supported(void);
  28. extern int irq_remapping_prepare(void);
  29. extern int irq_remapping_enable(void);
  30. extern void irq_remapping_disable(void);
  31. extern int irq_remapping_reenable(int);
  32. extern int irq_remap_enable_fault_handling(void);
  33. extern int setup_ioapic_remapped_entry(int irq,
  34. struct IO_APIC_route_entry *entry,
  35. unsigned int destination,
  36. int vector,
  37. struct io_apic_irq_attr *attr);
  38. extern int set_remapped_irq_affinity(struct irq_data *data,
  39. const struct cpumask *mask,
  40. bool force);
  41. extern void free_remapped_irq(int irq);
  42. extern void compose_remapped_msi_msg(struct pci_dev *pdev,
  43. unsigned int irq, unsigned int dest,
  44. struct msi_msg *msg, u8 hpet_id);
  45. extern int msi_alloc_remapped_irq(struct pci_dev *pdev, int irq, int nvec);
  46. extern int msi_setup_remapped_irq(struct pci_dev *pdev, unsigned int irq,
  47. int index, int sub_handle);
  48. extern int setup_hpet_msi_remapped(unsigned int irq, unsigned int id);
  49. #else /* CONFIG_IRQ_REMAP */
  50. #define irq_remapping_enabled 0
  51. static inline void setup_irq_remapping_ops(void) { }
  52. static inline int irq_remapping_supported(void) { return 0; }
  53. static inline int irq_remapping_prepare(void) { return -ENODEV; }
  54. static inline int irq_remapping_enable(void) { return -ENODEV; }
  55. static inline void irq_remapping_disable(void) { }
  56. static inline int irq_remapping_reenable(int eim) { return -ENODEV; }
  57. static inline int irq_remap_enable_fault_handling(void) { return -ENODEV; }
  58. static inline int setup_ioapic_remapped_entry(int irq,
  59. struct IO_APIC_route_entry *entry,
  60. unsigned int destination,
  61. int vector,
  62. struct io_apic_irq_attr *attr)
  63. {
  64. return -ENODEV;
  65. }
  66. static inline int set_remapped_irq_affinity(struct irq_data *data,
  67. const struct cpumask *mask,
  68. bool force)
  69. {
  70. return 0;
  71. }
  72. static inline void free_remapped_irq(int irq) { }
  73. static inline void compose_remapped_msi_msg(struct pci_dev *pdev,
  74. unsigned int irq, unsigned int dest,
  75. struct msi_msg *msg, u8 hpet_id)
  76. {
  77. }
  78. static inline int msi_alloc_remapped_irq(struct pci_dev *pdev, int irq, int nvec)
  79. {
  80. return -ENODEV;
  81. }
  82. static inline int msi_setup_remapped_irq(struct pci_dev *pdev, unsigned int irq,
  83. int index, int sub_handle)
  84. {
  85. return -ENODEV;
  86. }
  87. static inline int setup_hpet_msi_remapped(unsigned int irq, unsigned int id)
  88. {
  89. return -ENODEV;
  90. }
  91. #endif /* CONFIG_IRQ_REMAP */
  92. #endif /* __X86_IRQ_REMAPPING_H */