1 #ifndef CPER_SECTION_MEMORY_H
2 #define CPER_SECTION_MEMORY_H
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"}
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"}
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"}
23 
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);
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 
29 
30 #endif