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 | |
Lawrence Tang | 5202bbb | 2022-08-12 14:54:36 +0100 | [diff] [blame] | 4 | #include <json.h> |
Lawrence Tang | 7f21db6 | 2022-07-06 11:09:39 +0100 | [diff] [blame] | 5 | #include "../edk/Cper.h" |
| 6 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 7 | #define MEMORY_ERROR_VALID_BITFIELD_NAMES \ |
| 8 | (const char *[]) \ |
| 9 | { \ |
| 10 | "errorStatusValid", "physicalAddressValid", \ |
| 11 | "physicalAddressMaskValid", "nodeValid", "cardValid", \ |
| 12 | "moduleValid", "bankValid", "deviceValid", "rowValid", \ |
| 13 | "columnValid", "bitPositionValid", \ |
| 14 | "platformRequestorIDValid", \ |
| 15 | "platformResponderIDValid", \ |
| 16 | "memoryPlatformTargetValid", "memoryErrorTypeValid", \ |
| 17 | "rankNumberValid", "cardHandleValid", \ |
| 18 | "moduleHandleValid", "extendedRowBitsValid", \ |
| 19 | "bankGroupValid", "bankAddressValid", \ |
| 20 | "chipIdentificationValid" \ |
| 21 | } |
| 22 | #define MEMORY_ERROR_TYPES_KEYS \ |
| 23 | (int[]) \ |
| 24 | { \ |
| 25 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 \ |
| 26 | } |
| 27 | #define MEMORY_ERROR_TYPES_VALUES \ |
| 28 | (const char *[]) \ |
| 29 | { \ |
| 30 | "Unknown", "No Error", "Single-bit ECC", "Multi-bit ECC", \ |
| 31 | "Single-symbol ChipKill ECC", \ |
| 32 | "Multi-symbol ChipKill ECC", "Master Abort", \ |
| 33 | "Target Abort", "Parity Error", "Watchdog Timeout", \ |
| 34 | "Invalid Address", "Mirror Broken", "Memory Sparing", \ |
| 35 | "Scrub Corrected Error", "Scrub Uncorrected Error", \ |
| 36 | "Physical Memory Map-out Event" \ |
| 37 | } |
| 38 | #define MEMORY_ERROR_2_VALID_BITFIELD_NAMES \ |
| 39 | (const char *[]) \ |
| 40 | { \ |
| 41 | "errorStatusValid", "physicalAddressValid", \ |
| 42 | "physicalAddressMaskValid", "nodeValid", "cardValid", \ |
| 43 | "moduleValid", "bankValid", "deviceValid", "rowValid", \ |
| 44 | "columnValid", "rankValid", "bitPositionValid", \ |
| 45 | "chipIDValid", "memoryErrorTypeValid", "statusValid", \ |
| 46 | "requestorIDValid", "responderIDValid", \ |
| 47 | "targetIDValid", "cardHandleValid", \ |
| 48 | "moduleHandleValid", "bankGroupValid", \ |
| 49 | "bankAddressValid" \ |
| 50 | } |
Lawrence Tang | 7f21db6 | 2022-07-06 11:09:39 +0100 | [diff] [blame] | 51 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 52 | json_object *cper_section_platform_memory_to_ir(void *section); |
| 53 | json_object *cper_section_platform_memory2_to_ir(void *section); |
| 54 | void ir_section_memory_to_cper(json_object *section, FILE *out); |
| 55 | void ir_section_memory2_to_cper(json_object *section, FILE *out); |
Lawrence Tang | 3b7f45b | 2022-07-14 14:14:30 +0100 | [diff] [blame] | 56 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 57 | #endif |