xref: /openbmc/libcper/cper-utils.h (revision a0865e38)
11b0b00e3SLawrence Tang #ifndef CPER_UTILS_H
21b0b00e3SLawrence Tang #define CPER_UTILS_H
31b0b00e3SLawrence Tang 
41b0b00e3SLawrence Tang #define GUID_STRING_LENGTH 30
51b0b00e3SLawrence Tang #define TIMESTAMP_LENGTH 24
61b0b00e3SLawrence Tang 
7*a0865e38SLawrence Tang json_object* cper_generic_error_status_to_ir(EFI_GENERIC_ERROR_STATUS* error_status);
87f21db6cSLawrence Tang json_object* uniform_struct_to_ir(UINT32* start, int len, const char* names[]);
97f21db6cSLawrence Tang json_object* uniform_struct64_to_ir(UINT64* start, int len, const char* names[]);
103c43f743SLawrence Tang json_object* integer_to_readable_pair(int value, int len, int keys[], const char* values[], const char* default_value);
117f21db6cSLawrence Tang json_object* integer_to_readable_pair_with_desc(int value, int len, int keys[], const char* values[], const char* descriptions[], const char* default_value);
123d0e4f24SLawrence Tang json_object* bitfield_to_ir(UINT64 bitfield, int num_fields, const char* names[]);
131b0b00e3SLawrence Tang json_object* revision_to_ir(UINT16 revision);
141b0b00e3SLawrence Tang const char* severity_to_string(UINT8 severity);
151b0b00e3SLawrence Tang void guid_to_string(char* out, EFI_GUID* guid);
161b0b00e3SLawrence Tang int guid_equal(EFI_GUID* a, EFI_GUID* b);
171b0b00e3SLawrence Tang 
181b0b00e3SLawrence Tang //The available severity types for CPER.
191b0b00e3SLawrence Tang extern const char* CPER_SEVERITY_TYPES[4];
201b0b00e3SLawrence Tang 
211b0b00e3SLawrence Tang #endif