blob: 59a3e60dbdf12a2301b009f25ca5546f20fc6aff [file] [log] [blame]
Lawrence Tang794312c2022-07-05 14:46:10 +01001#ifndef CPER_SECTION_IA32X64_H
2#define CPER_SECTION_IA32X64_H
3
Lawrence Tang5202bbb2022-08-12 14:54:36 +01004#include <json.h>
Lawrence Tang794312c2022-07-05 14:46:10 +01005#include "../edk/Cper.h"
6
John Chungf8fc7052024-05-03 20:05:29 +08007#define IA32X64_PROCESSOR_ERROR_VALID_BITFIELD_NAMES \
8 (const char *[]) \
9 { \
10 "checkInfoValid", "targetAddressIDValid", "requestorIDValid", \
11 "responderIDValid", "instructionPointerValid" \
12 }
13#define IA32X64_CHECK_INFO_VALID_BITFIELD_NAMES \
14 (const char *[]) \
15 { \
16 "transactionTypeValid", "operationValid", "levelValid", \
17 "processorContextCorruptValid", "uncorrectedValid", \
18 "preciseIPValid", "restartableIPValid", \
19 "overflowValid", "participationTypeValid", \
20 "timedOutValid", "addressSpaceValid" \
21 }
22#define IA32X64_CHECK_INFO_MS_CHECK_VALID_BITFIELD_NAMES \
23 (const char *[]) \
24 { \
25 "errorTypeValid", "processorContextCorruptValid", \
26 "uncorrectedValid", "preciseIPValid", \
27 "restartableIPValid", "overflowValid" \
28 }
29#define IA32X64_CHECK_INFO_TRANSACTION_TYPES_KEYS \
30 (int[]) \
31 { \
32 0, 1, 2 \
33 }
34#define IA32X64_CHECK_INFO_TRANSACTION_TYPES_VALUES \
35 (const char *[]) \
36 { \
37 "Instruction", "Data Access", "Generic" \
38 }
39#define IA32X64_CHECK_INFO_OPERATION_TYPES_KEYS \
40 (int[]) \
41 { \
42 0, 1, 2, 3, 4, 5, 6, 7, 8 \
43 }
44#define IA32X64_CHECK_INFO_OPERATION_TYPES_VALUES \
45 (const char *[]) \
46 { \
47 "Generic Error", "Generic Read", \
48 "Generic Write" \
49 "Data Read", \
50 "Data Write", "Instruction Fetch", "Prefetch", \
51 "Eviction", "Snoop" \
52 }
53#define IA32X64_BUS_CHECK_INFO_PARTICIPATION_TYPES_KEYS \
54 (int[]) \
55 { \
56 0, 1, 2, 3 \
57 }
58#define IA32X64_BUS_CHECK_INFO_PARTICIPATION_TYPES_VALUES \
59 (const char *[]) \
60 { \
61 "Local processor originated request", \
62 "Local processor responded to request", \
63 "Local processor observed", "Generic" \
64 }
65#define IA32X64_BUS_CHECK_INFO_ADDRESS_SPACE_TYPES_KEYS \
66 (int[]) \
67 { \
68 0, 1, 2, 3 \
69 }
70#define IA32X64_BUS_CHECK_INFO_ADDRESS_SPACE_TYPES_VALUES \
71 (const char *[]) \
72 { \
73 "Memory Access", "Reserved", "I/O", "Other Transaction" \
74 }
75#define IA32X64_MS_CHECK_INFO_ERROR_TYPES_KEYS \
76 (int[]) \
77 { \
78 0, 1, 2, 3, 4, 5 \
79 }
80#define IA32X64_MS_CHECK_INFO_ERROR_TYPES_VALUES \
81 (const char *[]) \
82 { \
83 "No Error", "Unclassified", "Microcode ROM Parity Error", \
84 "External Error", "FRC Error", "Internal Unclassified" \
85 }
86#define IA32X64_REGISTER_CONTEXT_TYPES_KEYS \
87 (int[]) \
88 { \
89 0, 1, 2, 3, 4, 5, 6, 7 \
90 }
91#define IA32X64_REGISTER_CONTEXT_TYPES_VALUES \
92 (const char *[]) \
93 { \
94 "Unclassified Data", "MSR Registers", \
95 "32-bit Mode Execution Context", \
96 "64-bit Mode Execution Context", "FXSave Context", \
97 "32-bit Mode Debug Registers", \
98 "64-bit Mode Debug Registers", \
99 "Memory Mapper Registers" \
100 }
Lawrence Tang794312c2022-07-05 14:46:10 +0100101
Lawrence Tang9a785c22022-07-07 15:47:17 +0100102typedef struct {
John Chungf8fc7052024-05-03 20:05:29 +0800103 UINT64 Eax;
104 UINT64 Ebx;
105 UINT64 Ecx;
106 UINT64 Edx;
107 UINT64 Reserved[2];
Lawrence Tang9a785c22022-07-07 15:47:17 +0100108} EFI_IA32_X64_CPU_ID;
109
John Chungf8fc7052024-05-03 20:05:29 +0800110json_object *cper_section_ia32x64_to_ir(void *section);
111void ir_section_ia32x64_to_cper(json_object *section, FILE *out);
Lawrence Tang794312c2022-07-05 14:46:10 +0100112
John Chungf8fc7052024-05-03 20:05:29 +0800113#endif