blob: c020ff4972f270bab4ebe5ff315297d8b1ca195a [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 { \
Ed Tanous6981acb2024-06-18 13:14:49 -070047 "Generic Error", "Generic Read", "Generic Write", "Data Read", \
John Chungf8fc7052024-05-03 20:05:29 +080048 "Data Write", "Instruction Fetch", "Prefetch", \
49 "Eviction", "Snoop" \
50 }
51#define IA32X64_BUS_CHECK_INFO_PARTICIPATION_TYPES_KEYS \
52 (int[]) \
53 { \
54 0, 1, 2, 3 \
55 }
56#define IA32X64_BUS_CHECK_INFO_PARTICIPATION_TYPES_VALUES \
57 (const char *[]) \
58 { \
59 "Local processor originated request", \
60 "Local processor responded to request", \
61 "Local processor observed", "Generic" \
62 }
63#define IA32X64_BUS_CHECK_INFO_ADDRESS_SPACE_TYPES_KEYS \
64 (int[]) \
65 { \
66 0, 1, 2, 3 \
67 }
68#define IA32X64_BUS_CHECK_INFO_ADDRESS_SPACE_TYPES_VALUES \
69 (const char *[]) \
70 { \
71 "Memory Access", "Reserved", "I/O", "Other Transaction" \
72 }
73#define IA32X64_MS_CHECK_INFO_ERROR_TYPES_KEYS \
74 (int[]) \
75 { \
76 0, 1, 2, 3, 4, 5 \
77 }
78#define IA32X64_MS_CHECK_INFO_ERROR_TYPES_VALUES \
79 (const char *[]) \
80 { \
81 "No Error", "Unclassified", "Microcode ROM Parity Error", \
82 "External Error", "FRC Error", "Internal Unclassified" \
83 }
84#define IA32X64_REGISTER_CONTEXT_TYPES_KEYS \
85 (int[]) \
86 { \
87 0, 1, 2, 3, 4, 5, 6, 7 \
88 }
89#define IA32X64_REGISTER_CONTEXT_TYPES_VALUES \
90 (const char *[]) \
91 { \
92 "Unclassified Data", "MSR Registers", \
93 "32-bit Mode Execution Context", \
94 "64-bit Mode Execution Context", "FXSave Context", \
95 "32-bit Mode Debug Registers", \
96 "64-bit Mode Debug Registers", \
97 "Memory Mapper Registers" \
98 }
Lawrence Tang794312c2022-07-05 14:46:10 +010099
Lawrence Tang9a785c22022-07-07 15:47:17 +0100100typedef struct {
John Chungf8fc7052024-05-03 20:05:29 +0800101 UINT64 Eax;
102 UINT64 Ebx;
103 UINT64 Ecx;
104 UINT64 Edx;
105 UINT64 Reserved[2];
Lawrence Tang9a785c22022-07-07 15:47:17 +0100106} EFI_IA32_X64_CPU_ID;
107
John Chungf8fc7052024-05-03 20:05:29 +0800108json_object *cper_section_ia32x64_to_ir(void *section);
109void ir_section_ia32x64_to_cper(json_object *section, FILE *out);
Lawrence Tang794312c2022-07-05 14:46:10 +0100110
John Chungf8fc7052024-05-03 20:05:29 +0800111#endif