1#include <linux/device.h> 2#include <asm/mce.h> 3 4enum severity_level { 5 MCE_NO_SEVERITY, 6 MCE_KEEP_SEVERITY, 7 MCE_SOME_SEVERITY, 8 MCE_AO_SEVERITY, 9 MCE_UC_SEVERITY, 10 MCE_AR_SEVERITY, 11 MCE_PANIC_SEVERITY, 12}; 13 14#define ATTR_LEN 16 15 16/* One object for each MCE bank, shared by all CPUs */ 17struct mce_bank { 18 u64 ctl; /* subevents to enable */ 19 unsigned char init; /* initialise bank? */ 20 struct device_attribute attr; /* device attribute */ 21 char attrname[ATTR_LEN]; /* attribute name */ 22}; 23 24int mce_severity(struct mce *a, int tolerant, char **msg); 25struct dentry *mce_get_debugfs_dir(void); 26 27extern int mce_ser; 28 29extern struct mce_bank *mce_banks; 30 31#ifdef CONFIG_ACPI_APEI 32int apei_write_mce(struct mce *m); 33ssize_t apei_read_mce(struct mce *m, u64 *record_id); 34int apei_check_mce(void); 35int apei_clear_mce(u64 record_id); 36#else 37static inline int apei_write_mce(struct mce *m) 38{ 39 return -EINVAL; 40} 41static inline ssize_t apei_read_mce(struct mce *m, u64 *record_id) 42{ 43 return 0; 44} 45static inline int apei_check_mce(void) 46{ 47 return 0; 48} 49static inline int apei_clear_mce(u64 record_id) 50{ 51 return -EINVAL; 52} 53#endif 54