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