Lawrence Tang | 1b0b00e | 2022-07-05 10:33:10 +0100 | [diff] [blame] | 1 | #ifndef CPER_PARSE_H |
| 2 | #define CPER_PARSE_H |
Lawrence Tang | 5202bbb | 2022-08-12 14:54:36 +0100 | [diff] [blame] | 3 | #include <json.h> |
Lawrence Tang | 1b0b00e | 2022-07-05 10:33:10 +0100 | [diff] [blame] | 4 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame^] | 5 | #define CPER_HEADER_VALID_BITFIELD_NAMES \ |
| 6 | (const char *[]) \ |
| 7 | { \ |
| 8 | "platformIDValid", "timestampValid", "partitionIDValid" \ |
| 9 | } |
| 10 | #define CPER_SECTION_DESCRIPTOR_VALID_BITFIELD_NAMES \ |
| 11 | (const char *[]) \ |
| 12 | { \ |
| 13 | "fruIDValid", "fruStringValid" \ |
| 14 | } |
| 15 | #define CPER_SECTION_DESCRIPTOR_FLAGS_BITFIELD_NAMES \ |
| 16 | (const char *[]) \ |
| 17 | { \ |
| 18 | "primary", "containmentWarning", "reset", \ |
| 19 | "errorThresholdExceeded", "resourceNotAccessible", \ |
| 20 | "latentError", "propagated", "overflow" \ |
| 21 | } |
| 22 | #define CPER_HEADER_FLAG_TYPES_KEYS \ |
| 23 | (int[]) \ |
| 24 | { \ |
| 25 | 1, 2, 4 \ |
| 26 | } |
| 27 | #define CPER_HEADER_FLAG_TYPES_VALUES \ |
| 28 | (const char *[]) \ |
| 29 | { \ |
| 30 | "HW_ERROR_FLAGS_RECOVERED", "HW_ERROR_FLAGS_PREVERR", \ |
| 31 | "HW_ERROR_FLAGS_SIMULATED" \ |
| 32 | } |
Lawrence Tang | 3c43f74 | 2022-07-05 11:37:17 +0100 | [diff] [blame] | 33 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame^] | 34 | json_object *cper_to_ir(FILE *cper_file); |
| 35 | json_object *cper_single_section_to_ir(FILE *cper_section_file); |
| 36 | void ir_to_cper(json_object *ir, FILE *out); |
| 37 | void ir_single_section_to_cper(json_object *ir, FILE *out); |
Lawrence Tang | 1b0b00e | 2022-07-05 10:33:10 +0100 | [diff] [blame] | 38 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame^] | 39 | #endif |