blob: e50d0cc15059dc32181446cfa56931efb5284f3b [file] [log] [blame]
Lawrence Tang1b0b00e2022-07-05 10:33:10 +01001#ifndef CPER_PARSE_H
2#define CPER_PARSE_H
Karthik Rajagopalan255bd812024-09-06 14:36:34 -07003
4#ifdef __cplusplus
5extern "C" {
6#endif
7
Lawrence Tang5202bbb2022-08-12 14:54:36 +01008#include <json.h>
Lawrence Tang1b0b00e2022-07-05 10:33:10 +01009
John Chungf8fc7052024-05-03 20:05:29 +080010#define CPER_HEADER_VALID_BITFIELD_NAMES \
11 (const char *[]) \
12 { \
13 "platformIDValid", "timestampValid", "partitionIDValid" \
14 }
15#define CPER_SECTION_DESCRIPTOR_VALID_BITFIELD_NAMES \
16 (const char *[]) \
17 { \
18 "fruIDValid", "fruStringValid" \
19 }
20#define CPER_SECTION_DESCRIPTOR_FLAGS_BITFIELD_NAMES \
21 (const char *[]) \
22 { \
23 "primary", "containmentWarning", "reset", \
24 "errorThresholdExceeded", "resourceNotAccessible", \
25 "latentError", "propagated", "overflow" \
26 }
27#define CPER_HEADER_FLAG_TYPES_KEYS \
28 (int[]) \
29 { \
30 1, 2, 4 \
31 }
32#define CPER_HEADER_FLAG_TYPES_VALUES \
33 (const char *[]) \
34 { \
35 "HW_ERROR_FLAGS_RECOVERED", "HW_ERROR_FLAGS_PREVERR", \
36 "HW_ERROR_FLAGS_SIMULATED" \
37 }
Lawrence Tang3c43f742022-07-05 11:37:17 +010038
John Chungf8fc7052024-05-03 20:05:29 +080039json_object *cper_to_ir(FILE *cper_file);
40json_object *cper_single_section_to_ir(FILE *cper_section_file);
41void ir_to_cper(json_object *ir, FILE *out);
42void ir_single_section_to_cper(json_object *ir, FILE *out);
Lawrence Tang1b0b00e2022-07-05 10:33:10 +010043
Karthik Rajagopalan255bd812024-09-06 14:36:34 -070044#ifdef __cplusplus
45}
46#endif
47
John Chungf8fc7052024-05-03 20:05:29 +080048#endif