Joerg Roedel | 736baef | 2012-03-30 11:47:00 -0700 | [diff] [blame] | 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 | |
| 22 | #ifndef __X86_INTR_REMAPPING_H |
| 23 | #define __X86_INTR_REMAPPING_H |
| 24 | |
| 25 | #ifdef CONFIG_IRQ_REMAP |
| 26 | |
Joerg Roedel | 0c3f173 | 2012-03-30 11:47:02 -0700 | [diff] [blame] | 27 | struct IO_APIC_route_entry; |
| 28 | struct io_apic_irq_attr; |
| 29 | |
Joerg Roedel | 736baef | 2012-03-30 11:47:00 -0700 | [diff] [blame] | 30 | extern int intr_remapping_enabled; |
| 31 | |
| 32 | extern void setup_intr_remapping(void); |
| 33 | extern int intr_remapping_supported(void); |
| 34 | extern int intr_hardware_init(void); |
| 35 | extern int intr_hardware_enable(void); |
Joerg Roedel | 4f3d8b6 | 2012-03-30 11:47:01 -0700 | [diff] [blame] | 36 | extern void intr_hardware_disable(void); |
| 37 | extern int intr_hardware_reenable(int); |
| 38 | extern int intr_enable_fault_handling(void); |
Joerg Roedel | 0c3f173 | 2012-03-30 11:47:02 -0700 | [diff] [blame] | 39 | extern int intr_setup_ioapic_entry(int irq, |
| 40 | struct IO_APIC_route_entry *entry, |
| 41 | unsigned int destination, int vector, |
| 42 | struct io_apic_irq_attr *attr); |
Joerg Roedel | 4c1bad6 | 2012-03-30 11:47:03 -0700 | [diff] [blame] | 43 | extern int intr_set_affinity(struct irq_data *data, |
| 44 | const struct cpumask *mask, |
| 45 | bool force); |
Joerg Roedel | 9d619f6 | 2012-03-30 11:47:04 -0700 | [diff] [blame^] | 46 | extern void intr_free_irq(int irq); |
Joerg Roedel | 736baef | 2012-03-30 11:47:00 -0700 | [diff] [blame] | 47 | |
| 48 | #else /* CONFIG_IRQ_REMAP */ |
| 49 | |
| 50 | #define intr_remapping_enabled 0 |
| 51 | |
| 52 | static inline void setup_intr_remapping(void) { } |
| 53 | static inline int intr_remapping_supported(void) { return 0; } |
| 54 | static inline int intr_hardware_init(void) { return -ENODEV; } |
| 55 | static inline int intr_hardware_enable(void) { return -ENODEV; } |
Joerg Roedel | 4f3d8b6 | 2012-03-30 11:47:01 -0700 | [diff] [blame] | 56 | static inline void intr_hardware_disable(void) { } |
| 57 | static inline int intr_hardware_reenable(int eim) { return -ENODEV; } |
| 58 | static inline int intr_enable_fault_handling(void) { return -ENODEV; } |
Joerg Roedel | 0c3f173 | 2012-03-30 11:47:02 -0700 | [diff] [blame] | 59 | static inline int intr_setup_ioapic_entry(int irq, |
| 60 | struct IO_APIC_route_entry *entry, |
| 61 | unsigned int destination, int vector, |
| 62 | struct io_apic_irq_attr *attr) |
| 63 | { |
| 64 | return -ENODEV; |
| 65 | } |
Joerg Roedel | 4c1bad6 | 2012-03-30 11:47:03 -0700 | [diff] [blame] | 66 | static inline int intr_set_affinity(struct irq_data *data, |
| 67 | const struct cpumask *mask, |
| 68 | bool force) |
| 69 | { |
| 70 | return 0; |
| 71 | } |
Joerg Roedel | 9d619f6 | 2012-03-30 11:47:04 -0700 | [diff] [blame^] | 72 | static inline void intr_free_irq(int irq) { } |
Joerg Roedel | 736baef | 2012-03-30 11:47:00 -0700 | [diff] [blame] | 73 | #endif /* CONFIG_IRQ_REMAP */ |
| 74 | |
| 75 | #endif /* __X86_INTR_REMAPPING_H */ |