blob: 944623752082e81c0197880893e9c9848f65b3b0 [file] [log] [blame]
Lawrence Tang1b0b00e2022-07-05 10:33:10 +01001#ifndef CPER_UTILS_H
2#define CPER_UTILS_H
3
4#define GUID_STRING_LENGTH 30
5#define TIMESTAMP_LENGTH 24
6
Lawrence Tang3c43f742022-07-05 11:37:17 +01007json_object* integer_to_readable_pair(int value, int len, int keys[], const char* values[], const char* default_value);
Lawrence Tang794312c2022-07-05 14:46:10 +01008json_object* bitfield8_to_ir(UINT8 bitfield, int num_fields, const char* names[]);
9json_object* bitfield_to_ir(UINT32 bitfield, int num_fields, const char* names[]);
10json_object* bitfield64_to_ir(UINT64 bitfield, int num_fields, const char* names[]);
Lawrence Tang1b0b00e2022-07-05 10:33:10 +010011json_object* revision_to_ir(UINT16 revision);
12const char* severity_to_string(UINT8 severity);
13void guid_to_string(char* out, EFI_GUID* guid);
14int guid_equal(EFI_GUID* a, EFI_GUID* b);
15
16//The available severity types for CPER.
17extern const char* CPER_SEVERITY_TYPES[4];
18
19#endif