2 * Copyright (C) 2012 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com>
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.
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.
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
18 * This header file contains the interface of the interrupt remapping code to
19 * the x86 interrupt management code.
22 #ifndef __X86_IRQ_REMAPPING_H
23 #define __X86_IRQ_REMAPPING_H
25 #include <asm/io_apic.h>
27 #ifdef CONFIG_IRQ_REMAP
29 extern int irq_remapping_enabled;
31 extern void setup_irq_remapping_ops(void);
32 extern int irq_remapping_supported(void);
33 extern int irq_remapping_prepare(void);
34 extern int irq_remapping_enable(void);
35 extern void irq_remapping_disable(void);
36 extern int irq_remapping_reenable(int);
37 extern int irq_remap_enable_fault_handling(void);
38 extern int setup_ioapic_remapped_entry(int irq,
39 struct IO_APIC_route_entry *entry,
40 unsigned int destination,
42 struct io_apic_irq_attr *attr);
43 extern int set_remapped_irq_affinity(struct irq_data *data,
44 const struct cpumask *mask,
46 extern void free_remapped_irq(int irq);
47 extern void compose_remapped_msi_msg(struct pci_dev *pdev,
48 unsigned int irq, unsigned int dest,
49 struct msi_msg *msg, u8 hpet_id);
50 extern int msi_alloc_remapped_irq(struct pci_dev *pdev, int irq, int nvec);
51 extern int msi_setup_remapped_irq(struct pci_dev *pdev, unsigned int irq,
52 int index, int sub_handle);
53 extern int setup_hpet_msi_remapped(unsigned int irq, unsigned int id);
55 #else /* CONFIG_IRQ_REMAP */
57 #define irq_remapping_enabled 0
59 static inline void setup_irq_remapping_ops(void) { }
60 static inline int irq_remapping_supported(void) { return 0; }
61 static inline int irq_remapping_prepare(void) { return -ENODEV; }
62 static inline int irq_remapping_enable(void) { return -ENODEV; }
63 static inline void irq_remapping_disable(void) { }
64 static inline int irq_remapping_reenable(int eim) { return -ENODEV; }
65 static inline int irq_remap_enable_fault_handling(void) { return -ENODEV; }
66 static inline int setup_ioapic_remapped_entry(int irq,
67 struct IO_APIC_route_entry *entry,
68 unsigned int destination,
70 struct io_apic_irq_attr *attr)
74 static inline int set_remapped_irq_affinity(struct irq_data *data,
75 const struct cpumask *mask,
80 static inline void free_remapped_irq(int irq) { }
81 static inline void compose_remapped_msi_msg(struct pci_dev *pdev,
82 unsigned int irq, unsigned int dest,
83 struct msi_msg *msg, u8 hpet_id)
86 static inline int msi_alloc_remapped_irq(struct pci_dev *pdev, int irq, int nvec)
90 static inline int msi_setup_remapped_irq(struct pci_dev *pdev, unsigned int irq,
91 int index, int sub_handle)
95 static inline int setup_hpet_msi_remapped(unsigned int irq, unsigned int id)
99 #endif /* CONFIG_IRQ_REMAP */
101 #endif /* __X86_IRQ_REMAPPING_H */