blob: 77c5ea96b555e0ad245378879d34024b18a29757 [file] [log] [blame]
Lawrence Tang1b0b00e2022-07-05 10:33:10 +01001#ifndef CPER_PARSE_H
2#define CPER_PARSE_H
3#include "json.h"
4
Lawrence Tang3c878352022-07-08 14:04:50 +01005#define CPER_HEADER_VALID_BITFIELD_NAMES (const char*[]) {"platformIDValid", "timestampValid", "partitionIDValid"}
Lawrence Tang2800cd82022-07-05 16:08:20 +01006#define CPER_SECTION_DESCRIPTOR_FLAGS_BITFIELD_NAMES (const char*[]) \
7 {"primary", "containmentWarning", "reset", "errorThresholdExceeded", "resourceNotAccessible", "latentError", \
8 "propagated", "overflow"}
Lawrence Tang3c43f742022-07-05 11:37:17 +01009#define CPER_HEADER_FLAG_TYPES_KEYS (int []){1, 2, 3}
10#define CPER_HEADER_FLAG_TYPES_VALUES (const char*[]){"HW_ERROR_FLAGS_RECOVERED", "HW_ERROR_FLAGS_PREVERR", "HW_ERROR_FLAGS_SIMULATED"}
11
Lawrence Tangf0f95572022-07-07 16:56:22 +010012json_object* cper_to_ir(FILE* cper_file);
13void ir_to_cper(json_object* ir, FILE* out);
Lawrence Tang1b0b00e2022-07-05 10:33:10 +010014
15#endif