1 #ifndef _EDAC_MCE_AMD_H
2 #define _EDAC_MCE_AMD_H
4 #include <linux/notifier.h>
8 #define BIT_64(n) (U64_C(1) << (n))
10 #define EC(x) ((x) & 0xffff)
11 #define XEC(x, mask) (((x) >> 16) & mask)
13 #define LOW_SYNDROME(x) (((x) >> 15) & 0xff)
14 #define HIGH_SYNDROME(x) (((x) >> 24) & 0xff)
16 #define TLB_ERROR(x) (((x) & 0xFFF0) == 0x0010)
17 #define MEM_ERROR(x) (((x) & 0xFF00) == 0x0100)
18 #define BUS_ERROR(x) (((x) & 0xF800) == 0x0800)
20 #define TT(x) (((x) >> 2) & 0x3)
21 #define TT_MSG(x) tt_msgs[TT(x)]
22 #define II(x) (((x) >> 2) & 0x3)
23 #define II_MSG(x) ii_msgs[II(x)]
24 #define LL(x) ((x) & 0x3)
25 #define LL_MSG(x) ll_msgs[LL(x)]
26 #define TO(x) (((x) >> 8) & 0x1)
27 #define TO_MSG(x) to_msgs[TO(x)]
28 #define PP(x) (((x) >> 9) & 0x3)
29 #define PP_MSG(x) pp_msgs[PP(x)]
31 #define R4(x) (((x) >> 4) & 0xf)
32 #define R4_MSG(x) ((R4(x) < 9) ? rrrr_msgs[R4(x)] : "Wrong R4!")
35 * F3x4C bits (MCi_STATUS' high half)
37 #define NBSH_ERR_CPU_VAL BIT(24)
72 extern const char *tt_msgs
[];
73 extern const char *ll_msgs
[];
74 extern const char *rrrr_msgs
[];
75 extern const char *pp_msgs
[];
76 extern const char *to_msgs
[];
77 extern const char *ii_msgs
[];
80 * per-family decoder ops
82 struct amd_decoder_ops
{
83 bool (*dc_mce
)(u16
, u8
);
84 bool (*ic_mce
)(u16
, u8
);
85 bool (*nb_mce
)(u16
, u8
);
88 void amd_report_gart_errors(bool);
89 void amd_register_ecc_decoder(void (*f
)(int, struct mce
*, u32
));
90 void amd_unregister_ecc_decoder(void (*f
)(int, struct mce
*, u32
));
91 void amd_decode_nb_mce(int, struct mce
*, u32
);
92 int amd_decode_mce(struct notifier_block
*nb
, unsigned long val
, void *data
);
94 #endif /* _EDAC_MCE_AMD_H */