blob: 95ba66e84fa7c140b8f313ef577cf2dad94dd285 [file] [log] [blame]
Lawrence Tang1b0b00e2022-07-05 10:33:10 +01001#ifndef CPER_SECTION_GENERIC_H
2#define CPER_SECTION_GENERIC_H
3
Lawrence Tang5202bbb2022-08-12 14:54:36 +01004#include <json.h>
Lawrence Tang794312c2022-07-05 14:46:10 +01005#include "../edk/Cper.h"
6
Lawrence Tang3c43f742022-07-05 11:37:17 +01007#define GENERIC_PROC_TYPES_KEYS (int []){0, 1, 2}
8#define GENERIC_PROC_TYPES_VALUES (const char*[]){"IA32/X64", "IA64", "ARM"}
9#define GENERIC_ISA_TYPES_KEYS (int []){0, 1, 2, 3, 4}
10#define GENERIC_ISA_TYPES_VALUES (const char*[]){"IA32", "IA64", "X64", "ARM A32/T32", "ARM A64"}
11#define GENERIC_ERROR_TYPES_KEYS (int []){0, 1, 2, 4, 8}
12#define GENERIC_ERROR_TYPES_VALUES (const char*[]){"Unknown", "Cache Error", "TLB Error", "Bus Error", "Micro-Architectural Error"}
13#define GENERIC_OPERATION_TYPES_KEYS (int []){0, 1, 2, 3}
Lawrence Tangd34f2b12022-07-19 15:36:31 +010014#define GENERIC_OPERATION_TYPES_VALUES (const char*[]){"Unknown or Generic", "Data Read", "Data Write", "Instruction Execution"}
Lawrence Tang794312c2022-07-05 14:46:10 +010015#define GENERIC_VALIDATION_BITFIELD_NAMES (const char*[]) \
Lawrence Tang775467d2022-07-18 14:52:08 +010016 {"processorTypeValid", "processorISAValid", "processorErrorTypeValid", "operationValid", "flagsValid", \
17 "levelValid", "cpuVersionValid", "cpuBrandInfoValid", "cpuIDValid", "targetAddressValid", "requestorIDValid", \
Lawrence Tang794312c2022-07-05 14:46:10 +010018 "responderIDValid", "instructionIPValid"}
19#define GENERIC_FLAGS_BITFIELD_NAMES (const char*[]) \
20 {"restartable", "preciseIP", "overflow", "corrected"}
Lawrence Tang3c43f742022-07-05 11:37:17 +010021
Lawrence Tang1b0b00e2022-07-05 10:33:10 +010022json_object* cper_section_generic_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor);
Lawrence Tang0cb33792022-07-13 13:51:39 +010023void ir_section_generic_to_cper(json_object* section, FILE* out);
Lawrence Tang1b0b00e2022-07-05 10:33:10 +010024
25#endif