4 #include <linux/types.h>
5 #include <asm/ioctls.h>
12 #define MCG_BANKCNT_MASK 0xff
13 #define MCG_CTL_P (1ULL<<8)
14 #define MCG_EXT_P (1ULL<<9)
15 #define MCG_CMCI_P (1ULL<<10)
16 #define MCG_EXT_CNT_MASK 0xff0000
17 #define MCG_EXT_CNT_SHIFT 16
18 #define MCG_EXT_CNT(c) (((c) & MCG_EXT_CNT_MASK) >> MCG_EXT_CNT_SHIFT)
19 #define MCG_SER_P (1ULL<<24)
22 #define MCG_STATUS_RIPV (1ULL<<0)
23 #define MCG_STATUS_EIPV (1ULL<<1)
24 #define MCG_STATUS_MCIP (1ULL<<2)
27 #define MCI_STATUS_VAL (1ULL<<63)
28 #define MCI_STATUS_OVER (1ULL<<62)
29 #define MCI_STATUS_UC (1ULL<<61)
30 #define MCI_STATUS_EN (1ULL<<60)
31 #define MCI_STATUS_MISCV (1ULL<<59)
32 #define MCI_STATUS_ADDRV (1ULL<<58)
33 #define MCI_STATUS_PCC (1ULL<<57)
34 #define MCI_STATUS_S (1ULL<<56)
35 #define MCI_STATUS_AR (1ULL<<55)
39 #define MCACOD_SCRUB 0x00C0
40 #define MCACOD_SCRUBMSK 0xfff0
41 #define MCACOD_L3WB 0x017A
42 #define MCACOD_DATA 0x0134
43 #define MCACOD_INSTR 0x0150
46 #define MCI_MISC_ADDR_LSB(m) ((m) & 0x3f)
47 #define MCI_MISC_ADDR_MODE(m) (((m) >> 6) & 7)
48 #define MCI_MISC_ADDR_SEGOFF 0
49 #define MCI_MISC_ADDR_LINEAR 1
50 #define MCI_MISC_ADDR_PHYS 2
51 #define MCI_MISC_ADDR_MEM 3
52 #define MCI_MISC_ADDR_GENERIC 7
55 #define MCI_CTL2_CMCI_EN (1ULL << 30)
56 #define MCI_CTL2_CMCI_THRESHOLD_MASK 0x7fffULL
58 #define MCJ_CTX_MASK 3
59 #define MCJ_CTX(flags) ((flags) & MCJ_CTX_MASK)
60 #define MCJ_CTX_RANDOM 0
61 #define MCJ_CTX_PROCESS 0x1
62 #define MCJ_CTX_IRQ 0x2
63 #define MCJ_NMI_BROADCAST 0x4
64 #define MCJ_EXCEPTION 0x8
65 #define MCJ_IRQ_BRAODCAST 0x10
97 #define MCE_LOG_LEN 32
108 #define MCE_OVERFLOW 0
110 #define MCE_LOG_SIGNATURE "MACHINECHECK"
112 #define MCE_GET_RECORD_LEN _IOR('M', 1, int)
113 #define MCE_GET_LOG_LEN _IOR('M', 2, int)
114 #define MCE_GETCLEAR_FLAGS _IOR('M', 3, int)
117 #define MCE_EXTENDED_BANK 128
118 #define MCE_THERMAL_BANK MCE_EXTENDED_BANK + 0
119 #define K8_MCE_THRESHOLD_BASE (MCE_EXTENDED_BANK + 1)
129 extern int mce_disabled;
130 extern int mce_p5_enabled;
132 #ifdef CONFIG_X86_MCE
140 #ifdef CONFIG_X86_ANCIENT_MCE
143 static inline void enable_p5_mce(
void) { mce_p5_enabled = 1; }
147 static inline void enable_p5_mce(
void) {}
159 #define MAX_NR_BANKS 32
161 #ifdef CONFIG_X86_MCE_INTEL
162 extern int mce_cmci_disabled;
163 extern int mce_ignore_ce;
164 extern int mce_bios_cmci_threshold;
178 #ifdef CONFIG_X86_MCE_AMD
195 MCP_TIMESTAMP = (1 << 0),
197 MCP_DONTLOG = (1 << 2),
207 const char __user *ubuf,
208 size_t usize, loff_t *off));
236 #ifdef CONFIG_X86_THERMAL_VECTOR