blob: 4d293d867b77bdbaf944dd6848663a2cb66c20d7 [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
Karthik Rajagopalan255bd812024-09-06 14:36:34 -07004#ifdef __cplusplus
5extern "C" {
6#endif
7
Lawrence Tang5202bbb2022-08-12 14:54:36 +01008#include <json.h>
Lawrence Tang7f21db62022-07-06 11:09:39 +01009#include "../edk/Cper.h"
10
John Chungf8fc7052024-05-03 20:05:29 +080011#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 Tang7f21db62022-07-06 11:09:39 +010055
John Chungf8fc7052024-05-03 20:05:29 +080056json_object *cper_section_platform_memory_to_ir(void *section);
57json_object *cper_section_platform_memory2_to_ir(void *section);
58void ir_section_memory_to_cper(json_object *section, FILE *out);
59void ir_section_memory2_to_cper(json_object *section, FILE *out);
Lawrence Tang3b7f45b2022-07-14 14:14:30 +010060
Karthik Rajagopalan255bd812024-09-06 14:36:34 -070061#ifdef __cplusplus
62}
63#endif
64
John Chungf8fc7052024-05-03 20:05:29 +080065#endif