aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/uv_irq.c
diff options
context:
space:
mode:
authorDean Nelson <dcn@sgi.com>2008-10-02 13:18:21 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-16 10:53:12 -0400
commit4173a0e7371ece227559b44943c6fd456ee470d1 (patch)
treee9a6dd475bfc72b373c1db13c21c8d82591636ec /arch/x86/kernel/uv_irq.c
parent5f79f2f2ad39b5177c52ed08ffd066ea0c1da924 (diff)
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>
Diffstat (limited to 'arch/x86/kernel/uv_irq.c')
-rw-r--r--arch/x86/kernel/uv_irq.c77
1 files changed, 77 insertions, 0 deletions
diff --git a/arch/x86/kernel/uv_irq.c b/arch/x86/kernel/uv_irq.c
new file mode 100644
index 000000000000..6bd26c91c30b
--- /dev/null
+++ b/arch/x86/kernel/uv_irq.c
@@ -0,0 +1,77 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * SGI UV IRQ functions
7 *
8 * Copyright (C) 2008 Silicon Graphics, Inc. All rights reserved.
9 */
10
11#include <linux/module.h>
12#include <linux/irq.h>
13#include <asm/uv/uv_irq.h>
14
15static void uv_noop(unsigned int irq)
16{
17}
18
19static unsigned int uv_noop_ret(unsigned int irq)
20{
21 return 0;
22}
23
24static void uv_ack_apic(unsigned int irq)
25{
26 ack_APIC_irq();
27}
28
29struct irq_chip uv_irq_chip = {
30 .name = "UV-CORE",
31 .startup = uv_noop_ret,
32 .shutdown = uv_noop,
33 .enable = uv_noop,
34 .disable = uv_noop,
35 .ack = uv_noop,
36 .mask = uv_noop,
37 .unmask = uv_noop,
38 .eoi = uv_ack_apic,
39 .end = uv_noop,
40};
41
42/*
43 * Set up a mapping of an available irq and vector, and enable the specified
44 * MMR that defines the MSI that is to be sent to the specified CPU when an
45 * interrupt is raised.
46 */
47int uv_setup_irq(char *irq_name, int cpu, int mmr_blade,
48 unsigned long mmr_offset)
49{
50 int irq;
51 int ret;
52
53 irq = create_irq();
54 if (irq <= 0)
55 return -EBUSY;
56
57 ret = arch_enable_uv_irq(irq_name, irq, cpu, mmr_blade, mmr_offset);
58 if (ret != irq)
59 destroy_irq(irq);
60
61 return ret;
62}
63EXPORT_SYMBOL_GPL(uv_setup_irq);
64
65/*
66 * Tear down a mapping of an irq and vector, and disable the specified MMR that
67 * defined the MSI that was to be sent to the specified CPU when an interrupt
68 * was raised.
69 *
70 * Set mmr_blade and mmr_offset to what was passed in on uv_setup_irq().
71 */
72void uv_teardown_irq(unsigned int irq, int mmr_blade, unsigned long mmr_offset)
73{
74 arch_disable_uv_irq(mmr_blade, mmr_offset);
75 destroy_irq(irq);
76}
77EXPORT_SYMBOL_GPL(uv_teardown_irq);