Lawrence Tang | 794312c | 2022-07-05 14:46:10 +0100 | [diff] [blame] | 1 | #ifndef CPER_SECTION_IA32X64_H |
| 2 | #define CPER_SECTION_IA32X64_H |
| 3 | |
Lawrence Tang | 5202bbb | 2022-08-12 14:54:36 +0100 | [diff] [blame] | 4 | #include <json.h> |
Lawrence Tang | 794312c | 2022-07-05 14:46:10 +0100 | [diff] [blame] | 5 | #include "../edk/Cper.h" |
| 6 | |
| 7 | #define IA32X64_PROCESSOR_ERROR_VALID_BITFIELD_NAMES (const char*[]) \ |
Lawrence Tang | 3636d3c | 2022-07-11 12:16:25 +0100 | [diff] [blame] | 8 | {"checkInfoValid", "targetAddressIDValid", "requestorIDValid", "responderIDValid", \ |
Lawrence Tang | 794312c | 2022-07-05 14:46:10 +0100 | [diff] [blame] | 9 | "instructionPointerValid"} |
| 10 | #define IA32X64_CHECK_INFO_VALID_BITFIELD_NAMES (const char*[]) \ |
Lawrence Tang | d34f2b1 | 2022-07-19 15:36:31 +0100 | [diff] [blame] | 11 | {"transactionTypeValid", "operationValid", "levelValid", "processorContextCorruptValid", "uncorrectedValid", \ |
| 12 | "preciseIPValid", "restartableIPValid", "overflowValid", "participationTypeValid", "timedOutValid", \ |
Lawrence Tang | 794312c | 2022-07-05 14:46:10 +0100 | [diff] [blame] | 13 | "addressSpaceValid"} |
Lawrence Tang | 3636d3c | 2022-07-11 12:16:25 +0100 | [diff] [blame] | 14 | #define IA32X64_CHECK_INFO_MS_CHECK_VALID_BITFIELD_NAMES (const char*[]) \ |
| 15 | {"errorTypeValid", "processorContextCorruptValid", "uncorrectedValid", "preciseIPValid", "restartableIPValid", \ |
| 16 | "overflowValid"} |
Lawrence Tang | 794312c | 2022-07-05 14:46:10 +0100 | [diff] [blame] | 17 | #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 Tang | 9a785c2 | 2022-07-07 15:47:17 +0100 | [diff] [blame] | 36 | typedef 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 Tang | 794312c | 2022-07-05 14:46:10 +0100 | [diff] [blame] | 44 | json_object* cper_section_ia32x64_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor); |
Lawrence Tang | d0c8884 | 2022-07-13 14:51:17 +0100 | [diff] [blame] | 45 | void ir_section_ia32x64_to_cper(json_object* section, FILE* out); |
Lawrence Tang | 794312c | 2022-07-05 14:46:10 +0100 | [diff] [blame] | 46 | |
| 47 | #endif |