irq_remapping.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 void setup_irq_remapping_ops(void);
  26. extern int irq_remapping_supported(void);
  27. extern int irq_remapping_prepare(void);
  28. extern int irq_remapping_enable(void);
  29. extern void irq_remapping_disable(void);
  30. extern int irq_remapping_reenable(int);
  31. extern int irq_remap_enable_fault_handling(void);
  32. extern int setup_ioapic_remapped_entry(int irq,
  33. struct IO_APIC_route_entry *entry,
  34. unsigned int destination,
  35. int vector,
  36. struct io_apic_irq_attr *attr);
  37. extern void free_remapped_irq(int irq);
  38. extern void compose_remapped_msi_msg(struct pci_dev *pdev,
  39. unsigned int irq, unsigned int dest,
  40. struct msi_msg *msg, u8 hpet_id);
  41. extern int setup_hpet_msi_remapped(unsigned int irq, unsigned int id);
  42. extern void panic_if_irq_remap(const char *msg);
  43. extern bool setup_remapped_irq(int irq,
  44. struct irq_cfg *cfg,
  45. struct irq_chip *chip);
  46. void irq_remap_modify_chip_defaults(struct irq_chip *chip);
  47. #else /* CONFIG_IRQ_REMAP */
  48. static inline void setup_irq_remapping_ops(void) { }
  49. static inline int irq_remapping_supported(void) { return 0; }
  50. static inline int irq_remapping_prepare(void) { return -ENODEV; }
  51. static inline int irq_remapping_enable(void) { return -ENODEV; }
  52. static inline void irq_remapping_disable(void) { }
  53. static inline int irq_remapping_reenable(int eim) { return -ENODEV; }
  54. static inline int irq_remap_enable_fault_handling(void) { return -ENODEV; }
  55. static inline int setup_ioapic_remapped_entry(int irq,
  56. struct IO_APIC_route_entry *entry,
  57. unsigned int destination,
  58. int vector,
  59. struct io_apic_irq_attr *attr)
  60. {
  61. return -ENODEV;
  62. }
  63. static inline void free_remapped_irq(int irq) { }
  64. static inline void compose_remapped_msi_msg(struct pci_dev *pdev,
  65. unsigned int irq, unsigned int dest,
  66. struct msi_msg *msg, u8 hpet_id)
  67. {
  68. }
  69. static inline int setup_hpet_msi_remapped(unsigned int irq, unsigned int id)
  70. {
  71. return -ENODEV;
  72. }
  73. static inline void panic_if_irq_remap(const char *msg)
  74. {
  75. }
  76. static inline void irq_remap_modify_chip_defaults(struct irq_chip *chip)
  77. {
  78. }
  79. static inline bool setup_remapped_irq(int irq,
  80. struct irq_cfg *cfg,
  81. struct irq_chip *chip)
  82. {
  83. return false;
  84. }
  85. #endif /* CONFIG_IRQ_REMAP */
  86. #endif /* __X86_IRQ_REMAPPING_H */