Merge remote-tracking branches 'asoc/fix/wm8737', 'asoc/fix/wm8903', 'asoc/fix/wm8955...
[deliverable/linux.git] / arch / x86 / include / asm / irq_remapping.h
CommitLineData
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
27struct IO_APIC_route_entry;
28struct io_apic_irq_attr;
29struct irq_chip;
30struct msi_msg;
31struct pci_dev;
32struct irq_cfg;
33
399988ee 34#ifdef CONFIG_IRQ_REMAP
0c3f173a 35
03bbcb2e 36extern void set_irq_remapping_broken(void);
95a02e97
SS
37extern int irq_remapping_prepare(void);
38extern int irq_remapping_enable(void);
39extern void irq_remapping_disable(void);
40extern int irq_remapping_reenable(int);
41extern int irq_remap_enable_fault_handling(void);
42extern int setup_ioapic_remapped_entry(int irq,
43 struct IO_APIC_route_entry *entry,
44 unsigned int destination,
45 int vector,
46 struct io_apic_irq_attr *attr);
95a02e97
SS
47extern void free_remapped_irq(int irq);
48extern void compose_remapped_msi_msg(struct pci_dev *pdev,
49 unsigned int irq, unsigned int dest,
50 struct msi_msg *msg, u8 hpet_id);
95a02e97 51extern int setup_hpet_msi_remapped(unsigned int irq, unsigned int id);
6a9f5de2 52extern void panic_if_irq_remap(const char *msg);
2976fd84
JR
53extern bool setup_remapped_irq(int irq,
54 struct irq_cfg *cfg,
55 struct irq_chip *chip);
736baef4 56
9b1b0e42
JR
57void irq_remap_modify_chip_defaults(struct irq_chip *chip);
58
736baef4
JR
59#else /* CONFIG_IRQ_REMAP */
60
03bbcb2e 61static inline void set_irq_remapping_broken(void) { }
95a02e97
SS
62static inline int irq_remapping_prepare(void) { return -ENODEV; }
63static inline int irq_remapping_enable(void) { return -ENODEV; }
64static inline void irq_remapping_disable(void) { }
65static inline int irq_remapping_reenable(int eim) { return -ENODEV; }
66static inline int irq_remap_enable_fault_handling(void) { return -ENODEV; }
67static inline int setup_ioapic_remapped_entry(int irq,
68 struct IO_APIC_route_entry *entry,
69 unsigned int destination,
70 int vector,
71 struct io_apic_irq_attr *attr)
0c3f173a
JR
72{
73 return -ENODEV;
74}
95a02e97
SS
75static inline void free_remapped_irq(int irq) { }
76static inline void compose_remapped_msi_msg(struct pci_dev *pdev,
77 unsigned int irq, unsigned int dest,
78 struct msi_msg *msg, u8 hpet_id)
5e2b930b
JR
79{
80}
95a02e97 81static inline int setup_hpet_msi_remapped(unsigned int irq, unsigned int id)
5e2b930b
JR
82{
83 return -ENODEV;
84}
6a9f5de2
JR
85
86static inline void panic_if_irq_remap(const char *msg)
87{
88}
9b1b0e42 89
9b1b0e42
JR
90static inline void irq_remap_modify_chip_defaults(struct irq_chip *chip)
91{
92}
93
2976fd84
JR
94static inline bool setup_remapped_irq(int irq,
95 struct irq_cfg *cfg,
96 struct irq_chip *chip)
97{
98 return false;
99}
736baef4
JR
100#endif /* CONFIG_IRQ_REMAP */
101
a553b142
TG
102#define dmar_alloc_hwirq() irq_alloc_hwirq(-1)
103#define dmar_free_hwirq irq_free_hwirq
104
8a8f422d 105#endif /* __X86_IRQ_REMAPPING_H */
This page took 1.287538 seconds and 5 git commands to generate.