blob: 40c2bf43d0a7a5685678953108df3c2ac1243bbe [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
Lawrence Tang3c878352022-07-08 14:04:50 +01005#define CPER_HEADER_VALID_BITFIELD_NAMES (const char*[]) {"platformIDValid", "timestampValid", "partitionIDValid"}
Lawrence Tang0cb33792022-07-13 13:51:39 +01006#define CPER_SECTION_DESCRIPTOR_VALID_BITFIELD_NAMES (const char*[]) {"fruIDValid", "fruStringValid"}
Lawrence Tang2800cd82022-07-05 16:08:20 +01007#define CPER_SECTION_DESCRIPTOR_FLAGS_BITFIELD_NAMES (const char*[]) \
8 {"primary", "containmentWarning", "reset", "errorThresholdExceeded", "resourceNotAccessible", "latentError", \
9 "propagated", "overflow"}
Lawrence Tang02c801a2022-07-18 14:43:52 +010010#define CPER_HEADER_FLAG_TYPES_KEYS (int []){1, 2, 4}
Lawrence Tang3c43f742022-07-05 11:37:17 +010011#define CPER_HEADER_FLAG_TYPES_VALUES (const char*[]){"HW_ERROR_FLAGS_RECOVERED", "HW_ERROR_FLAGS_PREVERR", "HW_ERROR_FLAGS_SIMULATED"}
12
Lawrence Tangf0f95572022-07-07 16:56:22 +010013json_object* cper_to_ir(FILE* cper_file);
Lawrence Tang617949e2022-08-08 14:21:42 +010014json_object* cper_single_section_to_ir(FILE* cper_section_file);
Lawrence Tangf0f95572022-07-07 16:56:22 +010015void ir_to_cper(json_object* ir, FILE* out);
Lawrence Tang617949e2022-08-08 14:21:42 +010016void ir_single_section_to_cper(json_object* ir, FILE* out);
Lawrence Tang1b0b00e2022-07-05 10:33:10 +010017
18#endif