x86/MCE: consolidate AMD initialization
authorChristoph Egger <Christoph.Egger@amd.com>
Mon, 29 Oct 2012 14:04:35 +0000 (15:04 +0100)
committerChristoph Egger <Christoph.Egger@amd.com>
Mon, 29 Oct 2012 14:04:35 +0000 (15:04 +0100)
Move AMD specific initialization to AMD files.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpu/mcheck/mce.c
xen/arch/x86/cpu/mcheck/mce.h
xen/arch/x86/cpu/mcheck/mce_amd.c
xen/arch/x86/cpu/mcheck/mce_amd.h

index 7d4743e8ed73066e257775d3e6abc570f6951f54..bcbd6a383f74d279dc2b74376210c92617040e59 100644 (file)
@@ -560,30 +560,6 @@ void mcheck_mca_clearbanks(struct mca_banks *bankmask)
     }
 }
 
-static enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *ci)
-{
-    enum mcheck_type rc = mcheck_none;
-
-    switch (ci->x86) {
-    case 6:
-        rc = amd_k7_mcheck_init(ci);
-        break;
-
-    default:
-        /* Assume that machine check support is available.
-         * The minimum provided support is at least the K8. */
-    case 0xf:
-        rc = amd_k8_mcheck_init(ci);
-        break;
-
-    case 0x10 ... 0x17:
-        rc = amd_f10_mcheck_init(ci);
-        break;
-    }
-
-    return rc;
-}
-
 /*check the existence of Machine Check*/
 int mce_available(struct cpuinfo_x86 *c)
 {
index 21f65d2384109f2eaed5bf3451ce380b49ae58e4..4c5042968b462801b873e95c74bb222af58fba30 100644 (file)
@@ -39,10 +39,7 @@ enum mcheck_type {
 };
 
 /* Init functions */
-enum mcheck_type amd_k7_mcheck_init(struct cpuinfo_x86 *c);
-enum mcheck_type amd_k8_mcheck_init(struct cpuinfo_x86 *c);
-enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c);
-
+enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *c);
 enum mcheck_type intel_mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
 
 void intel_mcheck_timer(struct cpuinfo_x86 *c);
index 0691f6a5a69d4d00864b4462d4b19bffa52bcb87..2203fa48abd76756bf259064b2f7f8175ed3f143 100644 (file)
@@ -98,3 +98,29 @@ mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype)
     BUG();
     return 0;
 }
+
+enum mcheck_type
+amd_mcheck_init(struct cpuinfo_x86 *ci)
+{
+    enum mcheck_type rc = mcheck_none;
+
+    switch ( ci->x86 )
+    {
+    case 6:
+        rc = amd_k7_mcheck_init(ci);
+        break;
+
+    default:
+        /* Assume that machine check support is available.
+         * The minimum provided support is at least the K8. */
+    case 0xf:
+        rc = amd_k8_mcheck_init(ci);
+        break;
+
+    case 0x10 ... 0x17:
+        rc = amd_f10_mcheck_init(ci);
+        break;
+    }
+
+    return rc;
+}
index de5fc48d91009d09037cf72a8fba7c4b4f46343c..8d67965acb13ae1b188271cdaa02c090573fe247 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef _MCHECK_AMD_H
 #define _MCHECK_AMD_H
 
+enum mcheck_type amd_k7_mcheck_init(struct cpuinfo_x86 *c);
+enum mcheck_type amd_k8_mcheck_init(struct cpuinfo_x86 *c);
+enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c);
+
 int mc_amd_recoverable_scan(uint64_t status);
 int mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype);