aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/amd64_edac.h
diff options
context:
space:
mode:
authorBorislav Petkov <borislav.petkov@amd.com>2009-06-25 13:32:38 -0400
committerBorislav Petkov <borislav.petkov@amd.com>2009-09-14 12:57:48 -0400
commitb70ef01016850de87b9a28a6af19fed8801df076 (patch)
tree78159c6e177c5557f2cc9342f8bc0833645d8da5 /drivers/edac/amd64_edac.h
parent74fca6a42863ffacaf7ba6f1936a9f228950f657 (diff)
EDAC: move MCE error descriptions to EDAC core
This is in preparation of adding AMD-specific MCE decoding functionality to the EDAC core. The error decoding macros originate from the AMD64 EDAC driver albeit in a simplified and cleaned up version here. While at it, add macros to generate the error description strings and use them in the error type decoders directly which removes a bunch of code and makes the decoding functions much more readable. Also, fix strings and shorten macro names. Remove superfluous htlink_msgs. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'drivers/edac/amd64_edac.h')
-rw-r--r--drivers/edac/amd64_edac.h17
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/edac/amd64_edac.h b/drivers/edac/amd64_edac.h
index ba73015af8e4..1ddef8d15d52 100644
--- a/drivers/edac/amd64_edac.h
+++ b/drivers/edac/amd64_edac.h
@@ -72,6 +72,7 @@
72#include <linux/edac.h> 72#include <linux/edac.h>
73#include <asm/msr.h> 73#include <asm/msr.h>
74#include "edac_core.h" 74#include "edac_core.h"
75#include "edac_mce_amd.h"
75 76
76#define amd64_printk(level, fmt, arg...) \ 77#define amd64_printk(level, fmt, arg...) \
77 edac_printk(level, "amd64", fmt, ##arg) 78 edac_printk(level, "amd64", fmt, ##arg)
@@ -303,9 +304,6 @@ enum {
303#define K8_NBSL 0x48 304#define K8_NBSL 0x48
304 305
305 306
306#define EXTRACT_HIGH_SYNDROME(x) (((x) >> 24) & 0xff)
307#define EXTRACT_EXT_ERROR_CODE(x) (((x) >> 16) & 0x1f)
308
309/* Family F10h: Normalized Extended Error Codes */ 307/* Family F10h: Normalized Extended Error Codes */
310#define F10_NBSL_EXT_ERR_RES 0x0 308#define F10_NBSL_EXT_ERR_RES 0x0
311#define F10_NBSL_EXT_ERR_CRC 0x1 309#define F10_NBSL_EXT_ERR_CRC 0x1
@@ -348,17 +346,6 @@ enum {
348#define K8_NBSL_EXT_ERR_CHIPKILL_ECC 0x8 346#define K8_NBSL_EXT_ERR_CHIPKILL_ECC 0x8
349#define K8_NBSL_EXT_ERR_DRAM_PARITY 0xD 347#define K8_NBSL_EXT_ERR_DRAM_PARITY 0xD
350 348
351#define EXTRACT_ERROR_CODE(x) ((x) & 0xffff)
352#define TEST_TLB_ERROR(x) (((x) & 0xFFF0) == 0x0010)
353#define TEST_MEM_ERROR(x) (((x) & 0xFF00) == 0x0100)
354#define TEST_BUS_ERROR(x) (((x) & 0xF800) == 0x0800)
355#define EXTRACT_TT_CODE(x) (((x) >> 2) & 0x3)
356#define EXTRACT_II_CODE(x) (((x) >> 2) & 0x3)
357#define EXTRACT_LL_CODE(x) (((x) >> 0) & 0x3)
358#define EXTRACT_RRRR_CODE(x) (((x) >> 4) & 0xf)
359#define EXTRACT_TO_CODE(x) (((x) >> 8) & 0x1)
360#define EXTRACT_PP_CODE(x) (((x) >> 9) & 0x3)
361
362/* 349/*
363 * The following are for BUS type errors AFTER values have been normalized by 350 * The following are for BUS type errors AFTER values have been normalized by
364 * shifting right 351 * shifting right
@@ -386,9 +373,7 @@ enum {
386#define K8_NBSH_CORE1 BIT(1) 373#define K8_NBSH_CORE1 BIT(1)
387#define K8_NBSH_CORE0 BIT(0) 374#define K8_NBSH_CORE0 BIT(0)
388 375
389#define EXTRACT_LDT_LINK(x) (((x) >> 4) & 0x7)
390#define EXTRACT_ERR_CPU_MAP(x) ((x) & 0xF) 376#define EXTRACT_ERR_CPU_MAP(x) ((x) & 0xF)
391#define EXTRACT_LOW_SYNDROME(x) (((x) >> 15) & 0xff)
392 377
393 378
394#define K8_NBEAL 0x50 379#define K8_NBEAL 0x50