blob: 875681eff02b14dd89b3966ce86961d9eba101be [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
7#define IA32X64_PROCESSOR_ERROR_VALID_BITFIELD_NAMES (const char*[]) \
Lawrence Tang3636d3c2022-07-11 12:16:25 +01008 {"checkInfoValid", "targetAddressIDValid", "requestorIDValid", "responderIDValid", \
Lawrence Tang794312c2022-07-05 14:46:10 +01009 "instructionPointerValid"}
10#define IA32X64_CHECK_INFO_VALID_BITFIELD_NAMES (const char*[]) \
Lawrence Tangd34f2b12022-07-19 15:36:31 +010011 {"transactionTypeValid", "operationValid", "levelValid", "processorContextCorruptValid", "uncorrectedValid", \
12 "preciseIPValid", "restartableIPValid", "overflowValid", "participationTypeValid", "timedOutValid", \
Lawrence Tang794312c2022-07-05 14:46:10 +010013 "addressSpaceValid"}
Lawrence Tang3636d3c2022-07-11 12:16:25 +010014#define IA32X64_CHECK_INFO_MS_CHECK_VALID_BITFIELD_NAMES (const char*[]) \
15 {"errorTypeValid", "processorContextCorruptValid", "uncorrectedValid", "preciseIPValid", "restartableIPValid", \
16 "overflowValid"}
Lawrence Tang794312c2022-07-05 14:46:10 +010017#define IA32X64_CHECK_INFO_TRANSACTION_TYPES_KEYS (int []){0, 1, 2}
18#define IA32X64_CHECK_INFO_TRANSACTION_TYPES_VALUES (const char*[]){"Instruction", "Data Access", "Generic"}
19#define IA32X64_CHECK_INFO_OPERATION_TYPES_KEYS (int []){0, 1, 2, 3, 4, 5, 6, 7, 8}
20#define IA32X64_CHECK_INFO_OPERATION_TYPES_VALUES (const char*[]){"Generic Error", "Generic Read", "Generic Write" \
21 "Data Read", "Data Write", "Instruction Fetch", "Prefetch", "Eviction", "Snoop"}
22#define IA32X64_BUS_CHECK_INFO_PARTICIPATION_TYPES_KEYS (int []){0, 1, 2, 3}
23#define IA32X64_BUS_CHECK_INFO_PARTICIPATION_TYPES_VALUES (const char*[]){"Local processor originated request", \
24 "Local processor responded to request", "Local processor observed", "Generic"}
25#define IA32X64_BUS_CHECK_INFO_ADDRESS_SPACE_TYPES_KEYS (int []){0, 1, 2, 3}
26#define IA32X64_BUS_CHECK_INFO_ADDRESS_SPACE_TYPES_VALUES (const char*[]){"Memory Access", "Reserved", "I/O", \
27 "Other Transaction"}
28#define IA32X64_MS_CHECK_INFO_ERROR_TYPES_KEYS (int []){0, 1, 2, 3, 4, 5}
29#define IA32X64_MS_CHECK_INFO_ERROR_TYPES_VALUES (const char*[]){"No Error", "Unclassified", "Microcode ROM Parity Error", \
30 "External Error", "FRC Error", "Internal Unclassified"}
31#define IA32X64_REGISTER_CONTEXT_TYPES_KEYS (int []){0, 1, 2, 3, 4, 5, 6, 7}
32#define IA32X64_REGISTER_CONTEXT_TYPES_VALUES (const char*[]){"Unclassified Data", "MSR Registers", \
33 "32-bit Mode Execution Context", "64-bit Mode Execution Context", "FXSave Context", \
34 "32-bit Mode Debug Registers", "64-bit Mode Debug Registers", "Memory Mapper Registers"}
35
Lawrence Tang9a785c22022-07-07 15:47:17 +010036typedef struct {
37 UINT64 Eax;
38 UINT64 Ebx;
39 UINT64 Ecx;
40 UINT64 Edx;
41 UINT64 Reserved[2];
42} EFI_IA32_X64_CPU_ID;
43
Lawrence Tang794312c2022-07-05 14:46:10 +010044json_object* cper_section_ia32x64_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor);
Lawrence Tangd0c88842022-07-13 14:51:17 +010045void ir_section_ia32x64_to_cper(json_object* section, FILE* out);
Lawrence Tang794312c2022-07-05 14:46:10 +010046
47#endif