blob: 765794edc906c915cd6774799d98bf34ee171f59 [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
John Chungf8fc7052024-05-03 20:05:29 +08007#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 Tang3c43f742022-07-05 11:37:17 +010064
John Chungf8fc7052024-05-03 20:05:29 +080065json_object *cper_section_generic_to_ir(void *section);
66void ir_section_generic_to_cper(json_object *section, FILE *out);
Lawrence Tang1b0b00e2022-07-05 10:33:10 +010067
John Chungf8fc7052024-05-03 20:05:29 +080068#endif