irq_remapping.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 void free_remapped_irq(int irq);
  39. extern void compose_remapped_msi_msg(struct pci_dev *pdev,
  40. unsigned int irq, unsigned int dest,
  41. struct msi_msg *msg, u8 hpet_id);
  42. extern int setup_hpet_msi_remapped(unsigned int irq, unsigned int id);
  43. #else /* CONFIG_IRQ_REMAP */
  44. #define irq_remapping_enabled 0
  45. static inline void setup_irq_remapping_ops(void) { }
  46. static inline int irq_remapping_supported(void) { return 0; }
  47. static inline int irq_remapping_prepare(void) { return -ENODEV; }
  48. static inline int irq_remapping_enable(void) { return -ENODEV; }
  49. static inline void irq_remapping_disable(void) { }
  50. static inline int irq_remapping_reenable(int eim) { return -ENODEV; }
  51. static inline int irq_remap_enable_fault_handling(void) { return -ENODEV; }
  52. static inline int setup_ioapic_remapped_entry(int irq,
  53. struct IO_APIC_route_entry *entry,
  54. unsigned int destination,
  55. int vector,
  56. struct io_apic_irq_attr *attr)
  57. {
  58. return -ENODEV;
  59. }
  60. static inline void free_remapped_irq(int irq) { }
  61. static inline void compose_remapped_msi_msg(struct pci_dev *pdev,
  62. unsigned int irq, unsigned int dest,
  63. struct msi_msg *msg, u8 hpet_id)
  64. {
  65. }
  66. static inline int setup_hpet_msi_remapped(unsigned int irq, unsigned int id)
  67. {
  68. return -ENODEV;
  69. }
  70. #endif /* CONFIG_IRQ_REMAP */
  71. #endif /* __X86_IRQ_REMAPPING_H */