xref: /openbmc/libcper/include/libcper/sections/cper-section-memory.h (revision c97c041e571841f0ce67292208e083f6d858cf5c)
1 #ifndef CPER_SECTION_MEMORY_H
2 #define CPER_SECTION_MEMORY_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #include <stdio.h>
9 #include <json.h>
10 #include <libcper/Cper.h>
11 
12 #define MEMORY_ERROR_VALID_BITFIELD_NAMES                                      \
13 	(const char *[]){ "errorStatusValid",                                  \
14 			  "physicalAddressValid",                              \
15 			  "physicalAddressMaskValid",                          \
16 			  "nodeValid",                                         \
17 			  "cardValid",                                         \
18 			  "moduleValid",                                       \
19 			  "bankValid",                                         \
20 			  "deviceValid",                                       \
21 			  "rowValid",                                          \
22 			  "columnValid",                                       \
23 			  "bitPositionValid",                                  \
24 			  "platformRequestorIDValid",                          \
25 			  "platformResponderIDValid",                          \
26 			  "memoryPlatformTargetValid",                         \
27 			  "memoryErrorTypeValid",                              \
28 			  "rankNumberValid",                                   \
29 			  "cardHandleValid",                                   \
30 			  "moduleHandleValid",                                 \
31 			  "extendedRowBitsValid",                              \
32 			  "bankGroupValid",                                    \
33 			  "bankAddressValid",                                  \
34 			  "chipIdentificationValid" }
35 #define MEMORY_ERROR_TYPES_KEYS                                                \
36 	(int[]){ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }
37 #define MEMORY_ERROR_TYPES_VALUES                                              \
38 	(const char *[]){ "Unknown",                                           \
39 			  "No Error",                                          \
40 			  "Single-bit ECC",                                    \
41 			  "Multi-bit ECC",                                     \
42 			  "Single-symbol ChipKill ECC",                        \
43 			  "Multi-symbol ChipKill ECC",                         \
44 			  "Master Abort",                                      \
45 			  "Target Abort",                                      \
46 			  "Parity Error",                                      \
47 			  "Watchdog Timeout",                                  \
48 			  "Invalid Address",                                   \
49 			  "Mirror Broken",                                     \
50 			  "Memory Sparing",                                    \
51 			  "Scrub Corrected Error",                             \
52 			  "Scrub Uncorrected Error",                           \
53 			  "Physical Memory Map-out Event" }
54 #define MEMORY_ERROR_2_VALID_BITFIELD_NAMES                                    \
55 	(const char *[]){ "errorStatusValid",                                  \
56 			  "physicalAddressValid",                              \
57 			  "physicalAddressMaskValid",                          \
58 			  "nodeValid",                                         \
59 			  "cardValid",                                         \
60 			  "moduleValid",                                       \
61 			  "bankValid",                                         \
62 			  "deviceValid",                                       \
63 			  "rowValid",                                          \
64 			  "columnValid",                                       \
65 			  "rankValid",                                         \
66 			  "bitPositionValid",                                  \
67 			  "chipIDValid",                                       \
68 			  "memoryErrorTypeValid",                              \
69 			  "statusValid",                                       \
70 			  "requestorIDValid",                                  \
71 			  "responderIDValid",                                  \
72 			  "targetIDValid",                                     \
73 			  "cardHandleValid",                                   \
74 			  "moduleHandleValid",                                 \
75 			  "bankGroupValid",                                    \
76 			  "bankAddressValid" }
77 
78 json_object *cper_section_platform_memory_to_ir(void *section);
79 json_object *cper_section_platform_memory2_to_ir(void *section);
80 void ir_section_memory_to_cper(json_object *section, FILE *out);
81 void ir_section_memory2_to_cper(json_object *section, FILE *out);
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 #endif
88