Lawrence Tang | 1b0b00e | 2022-07-05 10:33:10 +0100 | [diff] [blame] | 1 | #ifndef CPER_SECTION_GENERIC_H |
| 2 | #define CPER_SECTION_GENERIC_H |
| 3 | |
Lawrence Tang | 5202bbb | 2022-08-12 14:54:36 +0100 | [diff] [blame] | 4 | #include <json.h> |
Lawrence Tang | 794312c | 2022-07-05 14:46:10 +0100 | [diff] [blame] | 5 | #include "../edk/Cper.h" |
| 6 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 7 | #define GENERIC_PROC_TYPES_KEYS \ |
| 8 | (int[]) \ |
| 9 | { \ |
| 10 | 0, 1, 2 \ |
| 11 | } |
| 12 | #define GENERIC_PROC_TYPES_VALUES \ |
| 13 | (const char *[]) \ |
| 14 | { \ |
| 15 | "IA32/X64", "IA64", "ARM" \ |
| 16 | } |
| 17 | #define GENERIC_ISA_TYPES_KEYS \ |
| 18 | (int[]) \ |
| 19 | { \ |
| 20 | 0, 1, 2, 3, 4 \ |
| 21 | } |
| 22 | #define GENERIC_ISA_TYPES_VALUES \ |
| 23 | (const char *[]) \ |
| 24 | { \ |
| 25 | "IA32", "IA64", "X64", "ARM A32/T32", "ARM A64" \ |
| 26 | } |
| 27 | #define GENERIC_ERROR_TYPES_KEYS \ |
| 28 | (int[]) \ |
| 29 | { \ |
| 30 | 0, 1, 2, 4, 8 \ |
| 31 | } |
| 32 | #define GENERIC_ERROR_TYPES_VALUES \ |
| 33 | (const char *[]) \ |
| 34 | { \ |
| 35 | "Unknown", "Cache Error", "TLB Error", "Bus Error", \ |
| 36 | "Micro-Architectural Error" \ |
| 37 | } |
| 38 | #define GENERIC_OPERATION_TYPES_KEYS \ |
| 39 | (int[]) \ |
| 40 | { \ |
| 41 | 0, 1, 2, 3 \ |
| 42 | } |
| 43 | #define GENERIC_OPERATION_TYPES_VALUES \ |
| 44 | (const char *[]) \ |
| 45 | { \ |
| 46 | "Unknown or Generic", "Data Read", "Data Write", \ |
| 47 | "Instruction Execution" \ |
| 48 | } |
| 49 | #define GENERIC_VALIDATION_BITFIELD_NAMES \ |
| 50 | (const char *[]) \ |
| 51 | { \ |
| 52 | "processorTypeValid", "processorISAValid", \ |
| 53 | "processorErrorTypeValid", "operationValid", \ |
| 54 | "flagsValid", "levelValid", "cpuVersionValid", \ |
| 55 | "cpuBrandInfoValid", "cpuIDValid", \ |
| 56 | "targetAddressValid", "requestorIDValid", \ |
| 57 | "responderIDValid", "instructionIPValid" \ |
| 58 | } |
| 59 | #define GENERIC_FLAGS_BITFIELD_NAMES \ |
| 60 | (const char *[]) \ |
| 61 | { \ |
| 62 | "restartable", "preciseIP", "overflow", "corrected" \ |
| 63 | } |
Lawrence Tang | 3c43f74 | 2022-07-05 11:37:17 +0100 | [diff] [blame] | 64 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 65 | json_object *cper_section_generic_to_ir(void *section); |
| 66 | void ir_section_generic_to_cper(json_object *section, FILE *out); |
Lawrence Tang | 1b0b00e | 2022-07-05 10:33:10 +0100 | [diff] [blame] | 67 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 68 | #endif |