blob: 752036efe31e65932cd02ef9c862825d16e320f5 [file] [log] [blame]
Lawrence Tang1b0b00e2022-07-05 10:33:10 +01001#ifndef CPER_PARSE_H
2#define CPER_PARSE_H
Lawrence Tang5202bbb2022-08-12 14:54:36 +01003#include <json.h>
Lawrence Tang1b0b00e2022-07-05 10:33:10 +01004
John Chungf8fc7052024-05-03 20:05:29 +08005#define CPER_HEADER_VALID_BITFIELD_NAMES \
6 (const char *[]) \
7 { \
8 "platformIDValid", "timestampValid", "partitionIDValid" \
9 }
10#define CPER_SECTION_DESCRIPTOR_VALID_BITFIELD_NAMES \
11 (const char *[]) \
12 { \
13 "fruIDValid", "fruStringValid" \
14 }
15#define CPER_SECTION_DESCRIPTOR_FLAGS_BITFIELD_NAMES \
16 (const char *[]) \
17 { \
18 "primary", "containmentWarning", "reset", \
19 "errorThresholdExceeded", "resourceNotAccessible", \
20 "latentError", "propagated", "overflow" \
21 }
22#define CPER_HEADER_FLAG_TYPES_KEYS \
23 (int[]) \
24 { \
25 1, 2, 4 \
26 }
27#define CPER_HEADER_FLAG_TYPES_VALUES \
28 (const char *[]) \
29 { \
30 "HW_ERROR_FLAGS_RECOVERED", "HW_ERROR_FLAGS_PREVERR", \
31 "HW_ERROR_FLAGS_SIMULATED" \
32 }
Lawrence Tang3c43f742022-07-05 11:37:17 +010033
John Chungf8fc7052024-05-03 20:05:29 +080034json_object *cper_to_ir(FILE *cper_file);
35json_object *cper_single_section_to_ir(FILE *cper_section_file);
36void ir_to_cper(json_object *ir, FILE *out);
37void ir_single_section_to_cper(json_object *ir, FILE *out);
Lawrence Tang1b0b00e2022-07-05 10:33:10 +010038
John Chungf8fc7052024-05-03 20:05:29 +080039#endif