2011-12-21 14:29:42 -08:00
|
|
|
#include <linux/device.h>
|
2009-05-27 21:56:54 +02:00
|
|
|
#include <asm/mce.h>
|
|
|
|
|
|
|
|
|
|
enum severity_level {
|
|
|
|
|
MCE_NO_SEVERITY,
|
2009-05-27 21:56:57 +02:00
|
|
|
MCE_KEEP_SEVERITY,
|
2009-05-27 21:56:54 +02:00
|
|
|
MCE_SOME_SEVERITY,
|
2009-05-27 21:56:57 +02:00
|
|
|
MCE_AO_SEVERITY,
|
2009-05-27 21:56:54 +02:00
|
|
|
MCE_UC_SEVERITY,
|
2009-05-27 21:56:57 +02:00
|
|
|
MCE_AR_SEVERITY,
|
2009-05-27 21:56:54 +02:00
|
|
|
MCE_PANIC_SEVERITY,
|
|
|
|
|
};
|
|
|
|
|
|
2009-07-09 00:31:43 +02:00
|
|
|
#define ATTR_LEN 16
|
|
|
|
|
|
|
|
|
|
/* One object for each MCE bank, shared by all CPUs */
|
|
|
|
|
struct mce_bank {
|
|
|
|
|
u64 ctl; /* subevents to enable */
|
|
|
|
|
unsigned char init; /* initialise bank? */
|
2011-12-21 14:29:42 -08:00
|
|
|
struct device_attribute attr; /* device attribute */
|
2009-07-09 00:31:43 +02:00
|
|
|
char attrname[ATTR_LEN]; /* attribute name */
|
|
|
|
|
};
|
|
|
|
|
|
2009-05-27 21:56:54 +02:00
|
|
|
int mce_severity(struct mce *a, int tolerant, char **msg);
|
2009-07-31 09:41:42 +08:00
|
|
|
struct dentry *mce_get_debugfs_dir(void);
|
2009-05-27 21:56:57 +02:00
|
|
|
|
|
|
|
|
extern int mce_ser;
|
2009-07-09 00:31:43 +02:00
|
|
|
|
|
|
|
|
extern struct mce_bank *mce_banks;
|
|
|
|
|
|
2010-05-18 14:35:22 +08:00
|
|
|
#ifdef CONFIG_ACPI_APEI
|
|
|
|
|
int apei_write_mce(struct mce *m);
|
|
|
|
|
ssize_t apei_read_mce(struct mce *m, u64 *record_id);
|
|
|
|
|
int apei_check_mce(void);
|
|
|
|
|
int apei_clear_mce(u64 record_id);
|
|
|
|
|
#else
|
|
|
|
|
static inline int apei_write_mce(struct mce *m)
|
|
|
|
|
{
|
|
|
|
|
return -EINVAL;
|
|
|
|
|
}
|
|
|
|
|
static inline ssize_t apei_read_mce(struct mce *m, u64 *record_id)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
static inline int apei_check_mce(void)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
static inline int apei_clear_mce(u64 record_id)
|
|
|
|
|
{
|
|
|
|
|
return -EINVAL;
|
|
|
|
|
}
|
|
|
|
|
#endif
|