-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 302715 b: refs/heads/master c: 736baef h: refs/heads/master i: 302713: 7eef88e 302711: 23c3850 v: v3
- Loading branch information
Joerg Roedel
committed
May 7, 2012
1 parent
fcb8086
commit 668d23a
Showing
12 changed files
with
197 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: eef93fdb7cd41ae36794db0e765059dc1039e940 | ||
refs/heads/master: 736baef4472d00574089f295bc759ac002b9558c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#ifndef __IA64_INTR_REMAPPING_H | ||
#define __IA64_INTR_REMAPPING_H | ||
#define intr_remapping_enabled 0 | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright (C) 2012 Advanced Micro Devices, Inc. | ||
* Author: Joerg Roedel <joerg.roedel@amd.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 as published | ||
* by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
* This header file contains the interface of the interrupt remapping code to | ||
* the x86 interrupt management code. | ||
*/ | ||
|
||
#ifndef __X86_INTR_REMAPPING_H | ||
#define __X86_INTR_REMAPPING_H | ||
|
||
#ifdef CONFIG_IRQ_REMAP | ||
|
||
extern int intr_remapping_enabled; | ||
|
||
extern void setup_intr_remapping(void); | ||
extern int intr_remapping_supported(void); | ||
extern int intr_hardware_init(void); | ||
extern int intr_hardware_enable(void); | ||
|
||
#else /* CONFIG_IRQ_REMAP */ | ||
|
||
#define intr_remapping_enabled 0 | ||
|
||
static inline void setup_intr_remapping(void) { } | ||
static inline int intr_remapping_supported(void) { return 0; } | ||
static inline int intr_hardware_init(void) { return -ENODEV; } | ||
static inline int intr_hardware_enable(void) { return -ENODEV; } | ||
|
||
#endif /* CONFIG_IRQ_REMAP */ | ||
|
||
#endif /* __X86_INTR_REMAPPING_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#include <linux/kernel.h> | ||
#include <linux/string.h> | ||
#include <linux/errno.h> | ||
|
||
#include "intr_remapping.h" | ||
|
||
int intr_remapping_enabled; | ||
|
||
int disable_intremap; | ||
int disable_sourceid_checking; | ||
int no_x2apic_optout; | ||
|
||
static struct irq_remap_ops *remap_ops; | ||
|
||
static __init int setup_nointremap(char *str) | ||
{ | ||
disable_intremap = 1; | ||
return 0; | ||
} | ||
early_param("nointremap", setup_nointremap); | ||
|
||
static __init int setup_intremap(char *str) | ||
{ | ||
if (!str) | ||
return -EINVAL; | ||
|
||
while (*str) { | ||
if (!strncmp(str, "on", 2)) | ||
disable_intremap = 0; | ||
else if (!strncmp(str, "off", 3)) | ||
disable_intremap = 1; | ||
else if (!strncmp(str, "nosid", 5)) | ||
disable_sourceid_checking = 1; | ||
else if (!strncmp(str, "no_x2apic_optout", 16)) | ||
no_x2apic_optout = 1; | ||
|
||
str += strcspn(str, ","); | ||
while (*str == ',') | ||
str++; | ||
} | ||
|
||
return 0; | ||
} | ||
early_param("intremap", setup_intremap); | ||
|
||
void __init setup_intr_remapping(void) | ||
{ | ||
remap_ops = &intel_irq_remap_ops; | ||
} | ||
|
||
int intr_remapping_supported(void) | ||
{ | ||
if (disable_intremap) | ||
return 0; | ||
|
||
if (!remap_ops || !remap_ops->supported) | ||
return 0; | ||
|
||
return remap_ops->supported(); | ||
} | ||
|
||
int __init intr_hardware_init(void) | ||
{ | ||
if (!remap_ops || !remap_ops->hardware_init) | ||
return -ENODEV; | ||
|
||
return remap_ops->hardware_init(); | ||
} | ||
|
||
int __init intr_hardware_enable(void) | ||
{ | ||
if (!remap_ops || !remap_ops->hardware_enable) | ||
return -ENODEV; | ||
|
||
return remap_ops->hardware_enable(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (C) 2012 Advanced Micro Devices, Inc. | ||
* Author: Joerg Roedel <joerg.roedel@amd.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 as published | ||
* by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
* This header file contains stuff that is shared between different interrupt | ||
* remapping drivers but with no need to be visible outside of the IOMMU layer. | ||
*/ | ||
|
||
#ifndef __INTR_REMAPPING_H | ||
#define __INTR_REMAPPING_H | ||
|
||
#ifdef CONFIG_IRQ_REMAP | ||
|
||
extern int disable_intremap; | ||
extern int disable_sourceid_checking; | ||
extern int no_x2apic_optout; | ||
|
||
struct irq_remap_ops { | ||
/* Check whether Interrupt Remapping is supported */ | ||
int (*supported)(void); | ||
|
||
/* Initializes hardware and makes it ready for remapping interrupts */ | ||
int (*hardware_init)(void); | ||
|
||
/* Enables the remapping hardware */ | ||
int (*hardware_enable)(void); | ||
}; | ||
|
||
extern struct irq_remap_ops intel_irq_remap_ops; | ||
|
||
#endif /* CONFIG_IRQ_REMAP */ | ||
|
||
#endif /* __INTR_REMAPPING_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters