Lawrence Tang | 1b0b00e | 2022-07-05 10:33:10 +0100 | [diff] [blame] | 1 | #ifndef CPER_UTILS_H |
| 2 | #define CPER_UTILS_H |
| 3 | |
| 4 | #define GUID_STRING_LENGTH 30 |
| 5 | #define TIMESTAMP_LENGTH 24 |
| 6 | |
Lawrence Tang | 7f21db6 | 2022-07-06 11:09:39 +0100 | [diff] [blame^] | 7 | json_object* uniform_struct_to_ir(UINT32* start, int len, const char* names[]); |
| 8 | json_object* uniform_struct64_to_ir(UINT64* start, int len, const char* names[]); |
Lawrence Tang | 3c43f74 | 2022-07-05 11:37:17 +0100 | [diff] [blame] | 9 | json_object* integer_to_readable_pair(int value, int len, int keys[], const char* values[], const char* default_value); |
Lawrence Tang | 7f21db6 | 2022-07-06 11:09:39 +0100 | [diff] [blame^] | 10 | json_object* integer_to_readable_pair_with_desc(int value, int len, int keys[], const char* values[], const char* descriptions[], const char* default_value); |
Lawrence Tang | 3d0e4f2 | 2022-07-05 17:17:41 +0100 | [diff] [blame] | 11 | json_object* bitfield_to_ir(UINT64 bitfield, int num_fields, const char* names[]); |
Lawrence Tang | 1b0b00e | 2022-07-05 10:33:10 +0100 | [diff] [blame] | 12 | json_object* revision_to_ir(UINT16 revision); |
| 13 | const char* severity_to_string(UINT8 severity); |
| 14 | void guid_to_string(char* out, EFI_GUID* guid); |
| 15 | int guid_equal(EFI_GUID* a, EFI_GUID* b); |
| 16 | |
| 17 | //The available severity types for CPER. |
| 18 | extern const char* CPER_SEVERITY_TYPES[4]; |
| 19 | |
| 20 | #endif |