1 #ifndef CPER_SECTION_IPF_H
2 #define CPER_SECTION_IPF_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #include <json.h>
9 #include <libcper/Cper.h>
10 
11 #define IPF_MOD_ERROR_VALID_BITFIELD_NAMES                                     \
12 	(const char *[])                                                       \
13 	{                                                                      \
14 		"checkInfoValid", "requestorIdentifierValid",                  \
15 			"responderIdentifierValid", "targetIdentifierValid",   \
16 			"preciseIPValid"                                       \
17 	}
18 #define IPF_PSI_STATIC_INFO_VALID_BITFIELD_NAMES                               \
19 	(const char *[])                                                       \
20 	{                                                                      \
21 		"minstateValid", "brValid", "crValid", "arValid", "rrValid",   \
22 			"frValid"                                              \
23 	}
24 
25 ///
26 /// IPF Error Record Section
27 /// Defined as according to B.2.3 of the ItaniumTM Processor Family System Abstraction Layer (SAL) Specification.
28 ///
29 typedef struct {
30 	UINT64 ProcErrorMapValid : 1;
31 	UINT64 ProcStateParameterValid : 1;
32 	UINT64 ProcCrLidValid : 1;
33 	UINT64 PsiStaticStructValid : 1;
34 	UINT64 CacheCheckNum : 4;
35 	UINT64 TlbCheckNum : 4;
36 	UINT64 BusCheckNum : 4;
37 	UINT64 RegFileCheckNum : 4;
38 	UINT64 MsCheckNum : 4;
39 	UINT64 CpuIdInfoValid : 1;
40 	UINT64 Reserved : 39;
41 } EPI_IPF_ERROR_VALID_BITS;
42 
43 typedef struct {
44 	EPI_IPF_ERROR_VALID_BITS ValidBits;
45 	UINT64 ProcErrorMap;
46 	UINT64 ProcStateParameter;
47 	UINT64 ProcCrLid;
48 } EFI_IPF_ERROR_INFO_HEADER;
49 
50 typedef struct {
51 	UINT64 ValidBits;
52 	UINT64 ModCheckInfo;
53 	UINT64 ModTargetId;
54 	UINT64 ModRequestorId; //NOTE: The Intel Itanium specification contains a typo which makes the order
55 	UINT64 ModResponderId; // of these two fields undefined. This is a best guess and could be wrong.
56 	UINT64 ModPreciseIp;
57 } EFI_IPF_MOD_ERROR_INFO;
58 
59 typedef struct {
60 	UINT8 CpuIdInfo[40];
61 	UINT8 Reserved1[8];
62 } EFI_IPF_CPU_INFO;
63 
64 typedef struct {
65 	UINT64 ValidBits;
66 	UINT8 MinimalSaveStateInfo[1024];
67 	UINT64 Brs[8];
68 	UINT64 Crs[128];
69 	UINT64 Ars[128];
70 	UINT64 Rrs[8];
71 	UINT64 Frs[256];
72 } EFI_IPF_PSI_STATIC;
73 
74 json_object *cper_section_ipf_to_ir(void *section);
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif
81