aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_mce_amd.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/edac_mce_amd.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/edac_mce_amd.h')
-rw-r--r--drivers/edac/edac_mce_amd.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/edac/edac_mce_amd.h b/drivers/edac/edac_mce_amd.h
new file mode 100644
index 000000000000..81f9dcf9990a
--- /dev/null
+++ b/drivers/edac/edac_mce_amd.h
@@ -0,0 +1,29 @@
1#define ERROR_CODE(x) ((x) & 0xffff)
2#define EXT_ERROR_CODE(x) (((x) >> 16) & 0x1f)
3#define LOW_SYNDROME(x) (((x) >> 15) & 0xff)
4#define HIGH_SYNDROME(x) (((x) >> 24) & 0xff)
5
6#define TLB_ERROR(x) (((x) & 0xFFF0) == 0x0010)
7#define MEM_ERROR(x) (((x) & 0xFF00) == 0x0100)
8#define BUS_ERROR(x) (((x) & 0xF800) == 0x0800)
9
10#define TT(x) (((x) >> 2) & 0x3)
11#define TT_MSG(x) tt_msgs[TT(x)]
12#define II(x) (((x) >> 2) & 0x3)
13#define II_MSG(x) ii_msgs[II(x)]
14#define LL(x) (((x) >> 0) & 0x3)
15#define LL_MSG(x) ll_msgs[LL(x)]
16#define RRRR(x) (((x) >> 4) & 0xf)
17#define RRRR_MSG(x) rrrr_msgs[RRRR(x)]
18#define TO(x) (((x) >> 8) & 0x1)
19#define TO_MSG(x) to_msgs[TO(x)]
20#define PP(x) (((x) >> 9) & 0x3)
21#define PP_MSG(x) pp_msgs[PP(x)]
22
23extern const char *tt_msgs[];
24extern const char *ll_msgs[];
25extern const char *rrrr_msgs[];
26extern const char *pp_msgs[];
27extern const char *to_msgs[];
28extern const char *ii_msgs[];
29extern const char *ext_msgs[];