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 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 7 | #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 Tanous | 6981acb | 2024-06-18 13:14:49 -0700 | [diff] [blame] | 47 | "Generic Error", "Generic Read", "Generic Write", "Data Read", \ |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 48 | "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 Tang | 794312c | 2022-07-05 14:46:10 +0100 | [diff] [blame] | 99 | |
Lawrence Tang | 9a785c2 | 2022-07-07 15:47:17 +0100 | [diff] [blame] | 100 | typedef struct { |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 101 | UINT64 Eax; |
| 102 | UINT64 Ebx; |
| 103 | UINT64 Ecx; |
| 104 | UINT64 Edx; |
| 105 | UINT64 Reserved[2]; |
Lawrence Tang | 9a785c2 | 2022-07-07 15:47:17 +0100 | [diff] [blame] | 106 | } EFI_IA32_X64_CPU_ID; |
| 107 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 108 | json_object *cper_section_ia32x64_to_ir(void *section); |
| 109 | void ir_section_ia32x64_to_cper(json_object *section, FILE *out); |
Lawrence Tang | 794312c | 2022-07-05 14:46:10 +0100 | [diff] [blame] | 110 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 111 | #endif |