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 | |
Karthik Rajagopalan | 255bd81 | 2024-09-06 14:36:34 -0700 | [diff] [blame] | 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
Lawrence Tang | 5202bbb | 2022-08-12 14:54:36 +0100 | [diff] [blame] | 8 | #include <json.h> |
Lawrence Tang | 794312c | 2022-07-05 14:46:10 +0100 | [diff] [blame] | 9 | #include "../edk/Cper.h" |
| 10 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 11 | #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 Tanous | 6981acb | 2024-06-18 13:14:49 -0700 | [diff] [blame] | 51 | "Generic Error", "Generic Read", "Generic Write", "Data Read", \ |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 52 | "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 Tang | 794312c | 2022-07-05 14:46:10 +0100 | [diff] [blame] | 103 | |
Lawrence Tang | 9a785c2 | 2022-07-07 15:47:17 +0100 | [diff] [blame] | 104 | typedef struct { |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 105 | UINT64 Eax; |
| 106 | UINT64 Ebx; |
| 107 | UINT64 Ecx; |
| 108 | UINT64 Edx; |
| 109 | UINT64 Reserved[2]; |
Lawrence Tang | 9a785c2 | 2022-07-07 15:47:17 +0100 | [diff] [blame] | 110 | } EFI_IA32_X64_CPU_ID; |
| 111 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 112 | json_object *cper_section_ia32x64_to_ir(void *section); |
| 113 | void ir_section_ia32x64_to_cper(json_object *section, FILE *out); |
Lawrence Tang | 794312c | 2022-07-05 14:46:10 +0100 | [diff] [blame] | 114 | |
Karthik Rajagopalan | 255bd81 | 2024-09-06 14:36:34 -0700 | [diff] [blame] | 115 | #ifdef __cplusplus |
| 116 | } |
| 117 | #endif |
| 118 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 119 | #endif |