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