blob: e0d470c02da4f0cab14bed773b3552019200f61e [file] [log] [blame]
Lawrence Tang54da4412022-07-06 13:14:58 +01001#ifndef CPER_SECTION_MEMORY_H
2#define CPER_SECTION_MEMORY_H
Lawrence Tang7f21db62022-07-06 11:09:39 +01003
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 Tanga0865e32022-07-06 11:59:52 +010013#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 Tang54da4412022-07-06 13:14:58 +010018#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 Tang7f21db62022-07-06 11:09:39 +010023
Lawrence Tanga0865e32022-07-06 11:59:52 +010024json_object* cper_section_platform_memory_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor);
25json_object* cper_section_platform_memory2_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor);
Lawrence Tang3b7f45b2022-07-14 14:14:30 +010026void ir_section_memory_to_cper(json_object* section, FILE* out);
27void ir_section_memory2_to_cper(json_object* section, FILE* out);
28
Lawrence Tang7f21db62022-07-06 11:09:39 +010029
30#endif