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