-
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.
x86, UV: add uv_setup_irq() and uv_teardown_irq() functions, v3
Provide a means for UV interrupt MMRs to be setup with the message to be sent when an MSI is raised. Signed-off-by: Dean Nelson <dcn@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
- Loading branch information
Dean Nelson
authored and
Ingo Molnar
committed
Oct 16, 2008
1 parent
5f79f2f
commit 4173a0e
Showing
4 changed files
with
182 additions
and
1 deletion.
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
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,77 @@ | ||
/* | ||
* This file is subject to the terms and conditions of the GNU General Public | ||
* License. See the file "COPYING" in the main directory of this archive | ||
* for more details. | ||
* | ||
* SGI UV IRQ functions | ||
* | ||
* Copyright (C) 2008 Silicon Graphics, Inc. All rights reserved. | ||
*/ | ||
|
||
#include <linux/module.h> | ||
#include <linux/irq.h> | ||
#include <asm/uv/uv_irq.h> | ||
|
||
static void uv_noop(unsigned int irq) | ||
{ | ||
} | ||
|
||
static unsigned int uv_noop_ret(unsigned int irq) | ||
{ | ||
return 0; | ||
} | ||
|
||
static void uv_ack_apic(unsigned int irq) | ||
{ | ||
ack_APIC_irq(); | ||
} | ||
|
||
struct irq_chip uv_irq_chip = { | ||
.name = "UV-CORE", | ||
.startup = uv_noop_ret, | ||
.shutdown = uv_noop, | ||
.enable = uv_noop, | ||
.disable = uv_noop, | ||
.ack = uv_noop, | ||
.mask = uv_noop, | ||
.unmask = uv_noop, | ||
.eoi = uv_ack_apic, | ||
.end = uv_noop, | ||
}; | ||
|
||
/* | ||
* Set up a mapping of an available irq and vector, and enable the specified | ||
* MMR that defines the MSI that is to be sent to the specified CPU when an | ||
* interrupt is raised. | ||
*/ | ||
int uv_setup_irq(char *irq_name, int cpu, int mmr_blade, | ||
unsigned long mmr_offset) | ||
{ | ||
int irq; | ||
int ret; | ||
|
||
irq = create_irq(); | ||
if (irq <= 0) | ||
return -EBUSY; | ||
|
||
ret = arch_enable_uv_irq(irq_name, irq, cpu, mmr_blade, mmr_offset); | ||
if (ret != irq) | ||
destroy_irq(irq); | ||
|
||
return ret; | ||
} | ||
EXPORT_SYMBOL_GPL(uv_setup_irq); | ||
|
||
/* | ||
* Tear down a mapping of an irq and vector, and disable the specified MMR that | ||
* defined the MSI that was to be sent to the specified CPU when an interrupt | ||
* was raised. | ||
* | ||
* Set mmr_blade and mmr_offset to what was passed in on uv_setup_irq(). | ||
*/ | ||
void uv_teardown_irq(unsigned int irq, int mmr_blade, unsigned long mmr_offset) | ||
{ | ||
arch_disable_uv_irq(mmr_blade, mmr_offset); | ||
destroy_irq(irq); | ||
} | ||
EXPORT_SYMBOL_GPL(uv_teardown_irq); |
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,36 @@ | ||
/* | ||
* This file is subject to the terms and conditions of the GNU General Public | ||
* License. See the file "COPYING" in the main directory of this archive | ||
* for more details. | ||
* | ||
* SGI UV IRQ definitions | ||
* | ||
* Copyright (C) 2008 Silicon Graphics, Inc. All rights reserved. | ||
*/ | ||
|
||
#ifndef ASM_X86__UV__UV_IRQ_H | ||
#define ASM_X86__UV__UV_IRQ_H | ||
|
||
/* If a generic version of this structure gets defined, eliminate this one. */ | ||
struct uv_IO_APIC_route_entry { | ||
__u64 vector : 8, | ||
delivery_mode : 3, | ||
dest_mode : 1, | ||
delivery_status : 1, | ||
polarity : 1, | ||
__reserved_1 : 1, | ||
trigger : 1, | ||
mask : 1, | ||
__reserved_2 : 15, | ||
dest : 32; | ||
}; | ||
|
||
extern struct irq_chip uv_irq_chip; | ||
|
||
extern int arch_enable_uv_irq(char *, unsigned int, int, int, unsigned long); | ||
extern void arch_disable_uv_irq(int, unsigned long); | ||
|
||
extern int uv_setup_irq(char *, int, int, unsigned long); | ||
extern void uv_teardown_irq(unsigned int, int, unsigned long); | ||
|
||
#endif /* ASM_X86__UV__UV_IRQ_H */ |