154da4414SLawrence Tang #ifndef CPER_SECTION_MEMORY_H 254da4414SLawrence Tang #define CPER_SECTION_MEMORY_H 37f21db6cSLawrence Tang 4*255bd81aSKarthik Rajagopalan #ifdef __cplusplus 5*255bd81aSKarthik Rajagopalan extern "C" { 6*255bd81aSKarthik Rajagopalan #endif 7*255bd81aSKarthik Rajagopalan 85202bbb4SLawrence Tang #include <json.h> 97f21db6cSLawrence Tang #include "../edk/Cper.h" 107f21db6cSLawrence Tang 11f8fc7052SJohn Chung #define MEMORY_ERROR_VALID_BITFIELD_NAMES \ 12f8fc7052SJohn Chung (const char *[]) \ 13f8fc7052SJohn Chung { \ 14f8fc7052SJohn Chung "errorStatusValid", "physicalAddressValid", \ 15f8fc7052SJohn Chung "physicalAddressMaskValid", "nodeValid", "cardValid", \ 16f8fc7052SJohn Chung "moduleValid", "bankValid", "deviceValid", "rowValid", \ 17f8fc7052SJohn Chung "columnValid", "bitPositionValid", \ 18f8fc7052SJohn Chung "platformRequestorIDValid", \ 19f8fc7052SJohn Chung "platformResponderIDValid", \ 20f8fc7052SJohn Chung "memoryPlatformTargetValid", "memoryErrorTypeValid", \ 21f8fc7052SJohn Chung "rankNumberValid", "cardHandleValid", \ 22f8fc7052SJohn Chung "moduleHandleValid", "extendedRowBitsValid", \ 23f8fc7052SJohn Chung "bankGroupValid", "bankAddressValid", \ 24f8fc7052SJohn Chung "chipIdentificationValid" \ 25f8fc7052SJohn Chung } 26f8fc7052SJohn Chung #define MEMORY_ERROR_TYPES_KEYS \ 27f8fc7052SJohn Chung (int[]) \ 28f8fc7052SJohn Chung { \ 29f8fc7052SJohn Chung 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 \ 30f8fc7052SJohn Chung } 31f8fc7052SJohn Chung #define MEMORY_ERROR_TYPES_VALUES \ 32f8fc7052SJohn Chung (const char *[]) \ 33f8fc7052SJohn Chung { \ 34f8fc7052SJohn Chung "Unknown", "No Error", "Single-bit ECC", "Multi-bit ECC", \ 35f8fc7052SJohn Chung "Single-symbol ChipKill ECC", \ 36f8fc7052SJohn Chung "Multi-symbol ChipKill ECC", "Master Abort", \ 37f8fc7052SJohn Chung "Target Abort", "Parity Error", "Watchdog Timeout", \ 38f8fc7052SJohn Chung "Invalid Address", "Mirror Broken", "Memory Sparing", \ 39f8fc7052SJohn Chung "Scrub Corrected Error", "Scrub Uncorrected Error", \ 40f8fc7052SJohn Chung "Physical Memory Map-out Event" \ 41f8fc7052SJohn Chung } 42f8fc7052SJohn Chung #define MEMORY_ERROR_2_VALID_BITFIELD_NAMES \ 43f8fc7052SJohn Chung (const char *[]) \ 44f8fc7052SJohn Chung { \ 45f8fc7052SJohn Chung "errorStatusValid", "physicalAddressValid", \ 46f8fc7052SJohn Chung "physicalAddressMaskValid", "nodeValid", "cardValid", \ 47f8fc7052SJohn Chung "moduleValid", "bankValid", "deviceValid", "rowValid", \ 48f8fc7052SJohn Chung "columnValid", "rankValid", "bitPositionValid", \ 49f8fc7052SJohn Chung "chipIDValid", "memoryErrorTypeValid", "statusValid", \ 50f8fc7052SJohn Chung "requestorIDValid", "responderIDValid", \ 51f8fc7052SJohn Chung "targetIDValid", "cardHandleValid", \ 52f8fc7052SJohn Chung "moduleHandleValid", "bankGroupValid", \ 53f8fc7052SJohn Chung "bankAddressValid" \ 54f8fc7052SJohn Chung } 557f21db6cSLawrence Tang 56f8fc7052SJohn Chung json_object *cper_section_platform_memory_to_ir(void *section); 57f8fc7052SJohn Chung json_object *cper_section_platform_memory2_to_ir(void *section); 583b7f45b5SLawrence Tang void ir_section_memory_to_cper(json_object *section, FILE *out); 593b7f45b5SLawrence Tang void ir_section_memory2_to_cper(json_object *section, FILE *out); 603b7f45b5SLawrence Tang 61*255bd81aSKarthik Rajagopalan #ifdef __cplusplus 62*255bd81aSKarthik Rajagopalan } 63*255bd81aSKarthik Rajagopalan #endif 64*255bd81aSKarthik Rajagopalan 657f21db6cSLawrence Tang #endif 66