Lawrence Tang | 54da441 | 2022-07-06 13:14:58 +0100 | [diff] [blame] | 1 | #ifndef CPER_SECTION_MEMORY_H |
| 2 | #define CPER_SECTION_MEMORY_H |
Lawrence Tang | 7f21db6 | 2022-07-06 11:09:39 +0100 | [diff] [blame] | 3 | |
| 4 | #include "json.h" |
| 5 | #include "../edk/Cper.h" |
| 6 | |
| 7 | #define MEMORY_ERROR_VALID_BITFIELD_NAMES (const char*[]) \ |
| 8 | {"errorStatusValid", "physicalAddressValid", "physicalAddressMaskValid", "nodeValid", "cardValid", "moduleValid", \ |
| 9 | "bankValid", "deviceValid", "rowValid", "columnValid", "bitPositionValid", "platformRequestorIDValid", \ |
| 10 | "platformResponderIDValid", "memoryPlatformTargetValid", "memoryErrorTypeValid", "rankNumberValid", \ |
| 11 | "cardHandleValid", "moduleHandleValid", "extendedRowBitsValid", "bankGroupValid", "bankAddressValid", \ |
| 12 | "chipIdentificationValid"} |
Lawrence Tang | a0865e3 | 2022-07-06 11:59:52 +0100 | [diff] [blame] | 13 | #define MEMORY_ERROR_TYPES_KEYS (int []){0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} |
| 14 | #define MEMORY_ERROR_TYPES_VALUES (const char*[]){"Unknown", "No Error", "Single-bit ECC", \ |
| 15 | "Multi-bit ECC", "Single-symbol ChipKill ECC", "Multi-symbol ChipKill ECC", "Master Abort", \ |
| 16 | "Target Abort", "Parity Error", "Watchdog Timeout", "Invalid Address", "Mirror Broken", \ |
| 17 | "Memory Sparing", "Scrub Corrected Error", "Scrub Uncorrected Error", "Physical Memory Map-out Event"} |
Lawrence Tang | 54da441 | 2022-07-06 13:14:58 +0100 | [diff] [blame] | 18 | #define MEMORY_ERROR_2_VALID_BITFIELD_NAMES (const char*[]) \ |
| 19 | {"errorStatusValid", "physicalAddressValid", "physicalAddressMaskValid", "nodeValid", "cardValid", "moduleValid", \ |
| 20 | "bankValid", "deviceValid", "rowValid", "columnValid", "rankValid", "bitPositionValid", "chipIDValid", \ |
| 21 | "memoryErrorTypeValid", "statusValid", "requestorIDValid", "responderIDValid", "targetIDValid", "cardHandleValid", \ |
| 22 | "moduleHandleValid", "bankGroupValid", "bankAddressValid"} |
Lawrence Tang | 7f21db6 | 2022-07-06 11:09:39 +0100 | [diff] [blame] | 23 | |
Lawrence Tang | a0865e3 | 2022-07-06 11:59:52 +0100 | [diff] [blame] | 24 | json_object* cper_section_platform_memory_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor); |
| 25 | json_object* cper_section_platform_memory2_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor); |
Lawrence Tang | 3b7f45b | 2022-07-14 14:14:30 +0100 | [diff] [blame] | 26 | void ir_section_memory_to_cper(json_object* section, FILE* out); |
| 27 | void ir_section_memory2_to_cper(json_object* section, FILE* out); |
| 28 | |
Lawrence Tang | 7f21db6 | 2022-07-06 11:09:39 +0100 | [diff] [blame] | 29 | |
| 30 | #endif |