[PATCH 02/13] [VOYAGER] x86/mca: make mca_nmi_hook external

From: James Bottomley
Date: Sun Mar 08 2009 - 12:49:43 EST


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@xxxxxxxxxxxxxxxxxxxxx>
---
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/