1*e42fb487SThu Nguyen #ifndef CPER_SECTION_DMAR_VTD_H
2*e42fb487SThu Nguyen #define CPER_SECTION_DMAR_VTD_H
3*e42fb487SThu Nguyen 
4*e42fb487SThu Nguyen #ifdef __cplusplus
5*e42fb487SThu Nguyen extern "C" {
6*e42fb487SThu Nguyen #endif
7*e42fb487SThu Nguyen 
8*e42fb487SThu Nguyen #include <json.h>
9*e42fb487SThu Nguyen #include <libcper/Cper.h>
10*e42fb487SThu Nguyen 
11*e42fb487SThu Nguyen #define VTD_FAULT_RECORD_TYPES_KEYS                                            \
12*e42fb487SThu Nguyen 	(int[])                                                                \
13*e42fb487SThu Nguyen 	{                                                                      \
14*e42fb487SThu Nguyen 		0, 1                                                           \
15*e42fb487SThu Nguyen 	}
16*e42fb487SThu Nguyen #define VTD_FAULT_RECORD_TYPES_VALUES                                          \
17*e42fb487SThu Nguyen 	(const char *[])                                                       \
18*e42fb487SThu Nguyen 	{                                                                      \
19*e42fb487SThu Nguyen 		"Write Request", "Read/AtomicOp Request"                       \
20*e42fb487SThu Nguyen 	}
21*e42fb487SThu Nguyen 
22*e42fb487SThu Nguyen typedef struct {
23*e42fb487SThu Nguyen 	UINT64 Resv1 : 12;
24*e42fb487SThu Nguyen 	UINT64 FaultInformation : 52;
25*e42fb487SThu Nguyen 	UINT64 SourceIdentifier : 16;
26*e42fb487SThu Nguyen 	UINT64 Resv2 : 13;
27*e42fb487SThu Nguyen 	UINT64 PrivelegeModeRequested : 1;
28*e42fb487SThu Nguyen 	UINT64 ExecutePermissionRequested : 1;
29*e42fb487SThu Nguyen 	UINT64 PasidPresent : 1;
30*e42fb487SThu Nguyen 	UINT64 FaultReason : 8;
31*e42fb487SThu Nguyen 	UINT64 PasidValue : 20;
32*e42fb487SThu Nguyen 	UINT64 AddressType : 2;
33*e42fb487SThu Nguyen 	UINT64 Type : 1;
34*e42fb487SThu Nguyen 	UINT64 Resv3 : 1;
35*e42fb487SThu Nguyen } EFI_VTD_FAULT_RECORD;
36*e42fb487SThu Nguyen 
37*e42fb487SThu Nguyen json_object *cper_section_dmar_vtd_to_ir(void *section);
38*e42fb487SThu Nguyen void ir_section_dmar_vtd_to_cper(json_object *section, FILE *out);
39*e42fb487SThu Nguyen 
40*e42fb487SThu Nguyen #ifdef __cplusplus
41*e42fb487SThu Nguyen }
42*e42fb487SThu Nguyen #endif
43*e42fb487SThu Nguyen 
44*e42fb487SThu Nguyen #endif
45