blob: 7148cfd9b3d6c4bb41101f19eb4b827da22866ff [file] [log] [blame]
Lawrence Tang1b0b00e2022-07-05 10:33:10 +01001#ifndef CPER_SECTION_GENERIC_H
2#define CPER_SECTION_GENERIC_H
3
Karthik Rajagopalan255bd812024-09-06 14:36:34 -07004#ifdef __cplusplus
5extern "C" {
6#endif
7
Lawrence Tang5202bbb2022-08-12 14:54:36 +01008#include <json.h>
Lawrence Tang794312c2022-07-05 14:46:10 +01009#include "../edk/Cper.h"
10
John Chungf8fc7052024-05-03 20:05:29 +080011#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 Tang3c43f742022-07-05 11:37:17 +010068
John Chungf8fc7052024-05-03 20:05:29 +080069json_object *cper_section_generic_to_ir(void *section);
70void ir_section_generic_to_cper(json_object *section, FILE *out);
Lawrence Tang1b0b00e2022-07-05 10:33:10 +010071
Karthik Rajagopalan255bd812024-09-06 14:36:34 -070072#ifdef __cplusplus
73}
74#endif
75
John Chungf8fc7052024-05-03 20:05:29 +080076#endif