blob: 5134f6ee9d2075e5d4300bb3cccca26175d33620 [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
Lawrence Tang5202bbb2022-08-12 14:54:36 +01004#include <json.h>
Lawrence Tang7f21db62022-07-06 11:09:39 +01005#include "../edk/Cper.h"
6
John Chungf8fc7052024-05-03 20:05:29 +08007#define MEMORY_ERROR_VALID_BITFIELD_NAMES \
8 (const char *[]) \
9 { \
10 "errorStatusValid", "physicalAddressValid", \
11 "physicalAddressMaskValid", "nodeValid", "cardValid", \
12 "moduleValid", "bankValid", "deviceValid", "rowValid", \
13 "columnValid", "bitPositionValid", \
14 "platformRequestorIDValid", \
15 "platformResponderIDValid", \
16 "memoryPlatformTargetValid", "memoryErrorTypeValid", \
17 "rankNumberValid", "cardHandleValid", \
18 "moduleHandleValid", "extendedRowBitsValid", \
19 "bankGroupValid", "bankAddressValid", \
20 "chipIdentificationValid" \
21 }
22#define MEMORY_ERROR_TYPES_KEYS \
23 (int[]) \
24 { \
25 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 \
26 }
27#define MEMORY_ERROR_TYPES_VALUES \
28 (const char *[]) \
29 { \
30 "Unknown", "No Error", "Single-bit ECC", "Multi-bit ECC", \
31 "Single-symbol ChipKill ECC", \
32 "Multi-symbol ChipKill ECC", "Master Abort", \
33 "Target Abort", "Parity Error", "Watchdog Timeout", \
34 "Invalid Address", "Mirror Broken", "Memory Sparing", \
35 "Scrub Corrected Error", "Scrub Uncorrected Error", \
36 "Physical Memory Map-out Event" \
37 }
38#define MEMORY_ERROR_2_VALID_BITFIELD_NAMES \
39 (const char *[]) \
40 { \
41 "errorStatusValid", "physicalAddressValid", \
42 "physicalAddressMaskValid", "nodeValid", "cardValid", \
43 "moduleValid", "bankValid", "deviceValid", "rowValid", \
44 "columnValid", "rankValid", "bitPositionValid", \
45 "chipIDValid", "memoryErrorTypeValid", "statusValid", \
46 "requestorIDValid", "responderIDValid", \
47 "targetIDValid", "cardHandleValid", \
48 "moduleHandleValid", "bankGroupValid", \
49 "bankAddressValid" \
50 }
Lawrence Tang7f21db62022-07-06 11:09:39 +010051
John Chungf8fc7052024-05-03 20:05:29 +080052json_object *cper_section_platform_memory_to_ir(void *section);
53json_object *cper_section_platform_memory2_to_ir(void *section);
54void ir_section_memory_to_cper(json_object *section, FILE *out);
55void ir_section_memory2_to_cper(json_object *section, FILE *out);
Lawrence Tang3b7f45b2022-07-14 14:14:30 +010056
John Chungf8fc7052024-05-03 20:05:29 +080057#endif