blob: 07ad20fd54f64fdff64c93576a4828d800407ef5 [file] [log] [blame]
#ifndef CPER_UTILS_H
#define CPER_UTILS_H
#define GUID_STRING_LENGTH 30
#define TIMESTAMP_LENGTH 24
json_object* cper_generic_error_status_to_ir(EFI_GENERIC_ERROR_STATUS* error_status);
json_object* uniform_struct_to_ir(UINT32* start, int len, const char* names[]);
json_object* uniform_struct64_to_ir(UINT64* start, int len, const char* names[]);
json_object* integer_to_readable_pair(int value, int len, int keys[], const char* values[], const char* default_value);
json_object* integer_to_readable_pair_with_desc(int value, int len, int keys[], const char* values[], const char* descriptions[], const char* default_value);
json_object* bitfield_to_ir(UINT64 bitfield, int num_fields, const char* names[]);
json_object* revision_to_ir(UINT16 revision);
const char* severity_to_string(UINT8 severity);
void guid_to_string(char* out, EFI_GUID* guid);
int guid_equal(EFI_GUID* a, EFI_GUID* b);
int bcd_to_int(UINT8 bcd);
//The available severity types for CPER.
extern const char* CPER_SEVERITY_TYPES[4];
#endif