[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1236530906-7175-3-git-send-email-James.Bottomley@HansenPartnership.com>
Date: Sun, 8 Mar 2009 11:48:15 -0500
From: James Bottomley <James.Bottomley@...senPartnership.com>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...ux.intel.com>,
Ingo Molnar <mingo@...e.hu>,
James Bottomley <James.Bottomley@...senPartnership.com>
Subject: [PATCH 02/13] [VOYAGER] x86/mca: make mca_nmi_hook external
Part of the apic rework brought the mca_nmi_hook to a place where it
can't be accessed by architecture specific code. Publish it again,
this time as a settable function vector so that voyager can use it.
If there were more than one possible architecture wanting to use this,
it could become a call chain, but there's only one and MCA is an old
bus, so leave it as a single call hook.
Signed-off-by: James Bottomley <James.Bottomley@...senPartnership.com>
---
arch/x86/include/asm/mca.h | 3 +++
arch/x86/kernel/mca_32.c | 12 ++++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/mca.h b/arch/x86/include/asm/mca.h
index eedbb6c..785a2a4 100644
--- a/arch/x86/include/asm/mca.h
+++ b/arch/x86/include/asm/mca.h
@@ -4,6 +4,9 @@
#ifndef _ASM_X86_MCA_H
#define _ASM_X86_MCA_H
+/* hook for the bus chain of the MCA NMI */
+extern void (*mca_nmi_hook)(void);
+
/* Maximal number of MCA slots - actually, some machines have less, but
* they all have sufficient number of POS registers to cover 8.
*/
diff --git a/arch/x86/kernel/mca_32.c b/arch/x86/kernel/mca_32.c
index 845d80c..4bb3cc9 100644
--- a/arch/x86/kernel/mca_32.c
+++ b/arch/x86/kernel/mca_32.c
@@ -466,6 +466,13 @@ static int __kprobes mca_handle_nmi_callback(struct device *dev, void *data)
return 0;
}
+/*
+ * The MCA (Microchannel Architecture) has an NMI chain for NMI sources
+ * along the MCA bus. Use this to hook into that chain if you will need
+ * it.
+ */
+void (*mca_nmi_hook)(void) = NULL;
+
void __kprobes mca_handle_nmi(void)
{
/*
@@ -473,4 +480,9 @@ void __kprobes mca_handle_nmi(void)
* adapter was responsible for the error.
*/
bus_for_each_dev(&mca_bus_type, NULL, NULL, mca_handle_nmi_callback);
+
+ if (mca_nmi_hook)
+ mca_nmi_hook();
+ else
+ pr_warning("NMI generated from unknown source!\n");
}
--
1.6.1.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists