Commit | Line | Data |
---|---|---|
736baef4 JR |
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 | ||
8a8f422d SS |
22 | #ifndef __X86_IRQ_REMAPPING_H |
23 | #define __X86_IRQ_REMAPPING_H | |
736baef4 | 24 | |
399988ee | 25 | #include <asm/io_apic.h> |
736baef4 | 26 | |
35d3d814 JR |
27 | struct IO_APIC_route_entry; |
28 | struct io_apic_irq_attr; | |
29 | struct irq_chip; | |
30 | struct msi_msg; | |
31 | struct pci_dev; | |
32 | struct irq_cfg; | |
33 | ||
399988ee | 34 | #ifdef CONFIG_IRQ_REMAP |
0c3f173a | 35 | |
95a02e97 SS |
36 | extern void setup_irq_remapping_ops(void); |
37 | extern int irq_remapping_supported(void); | |
03bbcb2e | 38 | extern void set_irq_remapping_broken(void); |
95a02e97 SS |
39 | extern int irq_remapping_prepare(void); |
40 | extern int irq_remapping_enable(void); | |
41 | extern void irq_remapping_disable(void); | |
42 | extern int irq_remapping_reenable(int); | |
43 | extern int irq_remap_enable_fault_handling(void); | |
44 | extern int setup_ioapic_remapped_entry(int irq, | |
45 | struct IO_APIC_route_entry *entry, | |
46 | unsigned int destination, | |
47 | int vector, | |
48 | struct io_apic_irq_attr *attr); | |
95a02e97 SS |
49 | extern void free_remapped_irq(int irq); |
50 | extern void compose_remapped_msi_msg(struct pci_dev *pdev, | |
51 | unsigned int irq, unsigned int dest, | |
52 | struct msi_msg *msg, u8 hpet_id); | |
95a02e97 | 53 | extern int setup_hpet_msi_remapped(unsigned int irq, unsigned int id); |
6a9f5de2 | 54 | extern void panic_if_irq_remap(const char *msg); |
2976fd84 JR |
55 | extern bool setup_remapped_irq(int irq, |
56 | struct irq_cfg *cfg, | |
57 | struct irq_chip *chip); | |
736baef4 | 58 | |
9b1b0e42 JR |
59 | void irq_remap_modify_chip_defaults(struct irq_chip *chip); |
60 | ||
736baef4 JR |
61 | #else /* CONFIG_IRQ_REMAP */ |
62 | ||
95a02e97 SS |
63 | static inline void setup_irq_remapping_ops(void) { } |
64 | static inline int irq_remapping_supported(void) { return 0; } | |
03bbcb2e | 65 | static inline void set_irq_remapping_broken(void) { } |
95a02e97 SS |
66 | static inline int irq_remapping_prepare(void) { return -ENODEV; } |
67 | static inline int irq_remapping_enable(void) { return -ENODEV; } | |
68 | static inline void irq_remapping_disable(void) { } | |
69 | static inline int irq_remapping_reenable(int eim) { return -ENODEV; } | |
70 | static inline int irq_remap_enable_fault_handling(void) { return -ENODEV; } | |
71 | static inline int setup_ioapic_remapped_entry(int irq, | |
72 | struct IO_APIC_route_entry *entry, | |
73 | unsigned int destination, | |
74 | int vector, | |
75 | struct io_apic_irq_attr *attr) | |
0c3f173a JR |
76 | { |
77 | return -ENODEV; | |
78 | } | |
95a02e97 SS |
79 | static inline void free_remapped_irq(int irq) { } |
80 | static inline void compose_remapped_msi_msg(struct pci_dev *pdev, | |
81 | unsigned int irq, unsigned int dest, | |
82 | struct msi_msg *msg, u8 hpet_id) | |
5e2b930b JR |
83 | { |
84 | } | |
95a02e97 | 85 | static inline int setup_hpet_msi_remapped(unsigned int irq, unsigned int id) |
5e2b930b JR |
86 | { |
87 | return -ENODEV; | |
88 | } | |
6a9f5de2 JR |
89 | |
90 | static inline void panic_if_irq_remap(const char *msg) | |
91 | { | |
92 | } | |
9b1b0e42 | 93 | |
9b1b0e42 JR |
94 | static inline void irq_remap_modify_chip_defaults(struct irq_chip *chip) |
95 | { | |
96 | } | |
97 | ||
2976fd84 JR |
98 | static inline bool setup_remapped_irq(int irq, |
99 | struct irq_cfg *cfg, | |
100 | struct irq_chip *chip) | |
101 | { | |
102 | return false; | |
103 | } | |
736baef4 JR |
104 | #endif /* CONFIG_IRQ_REMAP */ |
105 | ||
8a8f422d | 106 | #endif /* __X86_IRQ_REMAPPING_H */ |