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