diff options
author | Christoph Egger <Christoph.Egger@amd.com> | 2012-10-29 15:04:35 +0100 |
---|---|---|
committer | Christoph Egger <Christoph.Egger@amd.com> | 2012-10-29 15:04:35 +0100 |
commit | 34e8234f0fc88955d74b88a46cbaa77f6a67be26 (patch) | |
tree | 85637884788eab9db4316c0ebebbbdf1c9c5f31f /xen/arch/x86/cpu | |
parent | 127c78b8b7615b2e895a879792f4b0b825a02a81 (diff) | |
download | xen-34e8234f0fc88955d74b88a46cbaa77f6a67be26.tar.gz xen-34e8234f0fc88955d74b88a46cbaa77f6a67be26.tar.bz2 xen-34e8234f0fc88955d74b88a46cbaa77f6a67be26.zip |
x86/MCE: consolidate AMD initialization
Move AMD specific initialization to AMD files.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/arch/x86/cpu')
-rw-r--r-- | xen/arch/x86/cpu/mcheck/mce.c | 24 | ||||
-rw-r--r-- | xen/arch/x86/cpu/mcheck/mce.h | 5 | ||||
-rw-r--r-- | xen/arch/x86/cpu/mcheck/mce_amd.c | 26 | ||||
-rw-r--r-- | xen/arch/x86/cpu/mcheck/mce_amd.h | 4 |
4 files changed, 31 insertions, 28 deletions
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c index 7d4743e8ed..bcbd6a383f 100644 --- a/xen/arch/x86/cpu/mcheck/mce.c +++ b/xen/arch/x86/cpu/mcheck/mce.c @@ -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) { diff --git a/xen/arch/x86/cpu/mcheck/mce.h b/xen/arch/x86/cpu/mcheck/mce.h index 21f65d2384..4c5042968b 100644 --- a/xen/arch/x86/cpu/mcheck/mce.h +++ b/xen/arch/x86/cpu/mcheck/mce.h @@ -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); diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.c b/xen/arch/x86/cpu/mcheck/mce_amd.c index 0691f6a5a6..2203fa48ab 100644 --- a/xen/arch/x86/cpu/mcheck/mce_amd.c +++ b/xen/arch/x86/cpu/mcheck/mce_amd.c @@ -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; +} diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.h b/xen/arch/x86/cpu/mcheck/mce_amd.h index de5fc48d91..8d67965acb 100644 --- a/xen/arch/x86/cpu/mcheck/mce_amd.h +++ b/xen/arch/x86/cpu/mcheck/mce_amd.h @@ -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); |