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