blob: 95fd3527f632d2f0b45c47b07bada7fee46effea [file] [log] [blame]
Joerg Roedel736baef2012-03-30 11:47:00 -07001/*
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
Suresh Siddha8a8f4222012-03-30 11:47:08 -070022#ifndef __X86_IRQ_REMAPPING_H
23#define __X86_IRQ_REMAPPING_H
Joerg Roedel736baef2012-03-30 11:47:00 -070024
Suresh Siddha399988e2012-05-08 00:08:52 -070025#include <asm/io_apic.h>
Joerg Roedel736baef2012-03-30 11:47:00 -070026
Suresh Siddha399988e2012-05-08 00:08:52 -070027#ifdef CONFIG_IRQ_REMAP
Joerg Roedel0c3f1732012-03-30 11:47:02 -070028
Suresh Siddha95a02e92012-03-30 11:47:07 -070029extern void setup_irq_remapping_ops(void);
30extern int irq_remapping_supported(void);
31extern int irq_remapping_prepare(void);
32extern int irq_remapping_enable(void);
33extern void irq_remapping_disable(void);
34extern int irq_remapping_reenable(int);
35extern int irq_remap_enable_fault_handling(void);
36extern int setup_ioapic_remapped_entry(int irq,
37 struct IO_APIC_route_entry *entry,
38 unsigned int destination,
39 int vector,
40 struct io_apic_irq_attr *attr);
Suresh Siddha95a02e92012-03-30 11:47:07 -070041extern void free_remapped_irq(int irq);
42extern void compose_remapped_msi_msg(struct pci_dev *pdev,
43 unsigned int irq, unsigned int dest,
44 struct msi_msg *msg, u8 hpet_id);
Suresh Siddha95a02e92012-03-30 11:47:07 -070045extern int setup_hpet_msi_remapped(unsigned int irq, unsigned int id);
Joerg Roedel6a9f5de2012-09-26 12:44:41 +020046extern void panic_if_irq_remap(const char *msg);
Joerg Roedel2976fd82012-09-26 12:44:48 +020047extern bool setup_remapped_irq(int irq,
48 struct irq_cfg *cfg,
49 struct irq_chip *chip);
Joerg Roedel736baef2012-03-30 11:47:00 -070050
Joerg Roedel9b1b0e42012-09-26 12:44:45 +020051void irq_remap_modify_chip_defaults(struct irq_chip *chip);
52
Joerg Roedel736baef2012-03-30 11:47:00 -070053#else /* CONFIG_IRQ_REMAP */
54
Suresh Siddha95a02e92012-03-30 11:47:07 -070055static inline void setup_irq_remapping_ops(void) { }
56static inline int irq_remapping_supported(void) { return 0; }
57static inline int irq_remapping_prepare(void) { return -ENODEV; }
58static inline int irq_remapping_enable(void) { return -ENODEV; }
59static inline void irq_remapping_disable(void) { }
60static inline int irq_remapping_reenable(int eim) { return -ENODEV; }
61static inline int irq_remap_enable_fault_handling(void) { return -ENODEV; }
62static inline int setup_ioapic_remapped_entry(int irq,
63 struct IO_APIC_route_entry *entry,
64 unsigned int destination,
65 int vector,
66 struct io_apic_irq_attr *attr)
Joerg Roedel0c3f1732012-03-30 11:47:02 -070067{
68 return -ENODEV;
69}
Suresh Siddha95a02e92012-03-30 11:47:07 -070070static inline void free_remapped_irq(int irq) { }
71static inline void compose_remapped_msi_msg(struct pci_dev *pdev,
72 unsigned int irq, unsigned int dest,
73 struct msi_msg *msg, u8 hpet_id)
Joerg Roedel5e2b9302012-03-30 11:47:05 -070074{
75}
Suresh Siddha95a02e92012-03-30 11:47:07 -070076static inline int setup_hpet_msi_remapped(unsigned int irq, unsigned int id)
Joerg Roedel5e2b9302012-03-30 11:47:05 -070077{
78 return -ENODEV;
79}
Joerg Roedel6a9f5de2012-09-26 12:44:41 +020080
81static inline void panic_if_irq_remap(const char *msg)
82{
83}
Joerg Roedel9b1b0e42012-09-26 12:44:45 +020084
Joerg Roedel9b1b0e42012-09-26 12:44:45 +020085static inline void irq_remap_modify_chip_defaults(struct irq_chip *chip)
86{
87}
88
Joerg Roedel2976fd82012-09-26 12:44:48 +020089static inline bool setup_remapped_irq(int irq,
90 struct irq_cfg *cfg,
91 struct irq_chip *chip)
92{
93 return false;
94}
Joerg Roedel736baef2012-03-30 11:47:00 -070095#endif /* CONFIG_IRQ_REMAP */
96
Suresh Siddha8a8f4222012-03-30 11:47:08 -070097#endif /* __X86_IRQ_REMAPPING_H */