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

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

16
#define ATTR_LEN		16
17
#define INITIAL_CHECK_INTERVAL	5 * 60 /* 5 minutes */
18 19 20 21 22

/* One object for each MCE bank, shared by all CPUs */
struct mce_bank {
	u64			ctl;			/* subevents to enable */
	unsigned char init;				/* initialise bank? */
23
	struct device_attribute attr;			/* device attribute */
24 25 26
	char			attrname[ATTR_LEN];	/* attribute name */
};

27
extern int (*mce_severity)(struct mce *a, int tolerant, char **msg, bool is_excp);
28
struct dentry *mce_get_debugfs_dir(void);
A
Andi Kleen 已提交
29

30
extern struct mce_bank *mce_banks;
31
extern mce_banks_t mce_banks_ce_disabled;
32

C
Chen Gong 已提交
33
#ifdef CONFIG_X86_MCE_INTEL
34 35
unsigned long cmci_intel_adjust_timer(unsigned long interval);
bool mce_intel_cmci_poll(void);
C
Chen Gong 已提交
36
void mce_intel_hcpu_update(unsigned long cpu);
37
void cmci_disable_bank(int bank);
C
Chen Gong 已提交
38
#else
39 40
# define cmci_intel_adjust_timer mce_adjust_timer_default
static inline bool mce_intel_cmci_poll(void) { return false; }
C
Chen Gong 已提交
41
static inline void mce_intel_hcpu_update(unsigned long cpu) { }
42
static inline void cmci_disable_bank(int bank) { }
C
Chen Gong 已提交
43 44 45 46
#endif

void mce_timer_kick(unsigned long interval);

47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
#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