mce-internal.h 1.1 KB
Newer Older
1
#include <linux/device.h>
2 3 4 5
#include <asm/mce.h>

enum severity_level {
	MCE_NO_SEVERITY,
A
Andi Kleen 已提交
6
	MCE_KEEP_SEVERITY,
7
	MCE_SOME_SEVERITY,
A
Andi Kleen 已提交
8
	MCE_AO_SEVERITY,
9
	MCE_UC_SEVERITY,
A
Andi Kleen 已提交
10
	MCE_AR_SEVERITY,
11 12 13
	MCE_PANIC_SEVERITY,
};

14 15 16 17 18 19
#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? */
20
	struct device_attribute attr;			/* device attribute */
21 22 23
	char			attrname[ATTR_LEN];	/* attribute name */
};

24
int mce_severity(struct mce *a, int tolerant, char **msg);
25
struct dentry *mce_get_debugfs_dir(void);
A
Andi Kleen 已提交
26 27

extern int mce_ser;
28 29 30

extern struct mce_bank *mce_banks;

31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
#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