blob: 4a49e56bfb3196fc04f5a94dae4401d22688fe62 [file] [log] [blame]
Lawrence Tangdb1b7ce2022-07-06 15:40:26 +01001#ifndef CPER_SECTION_DMAR_VTD_H
2#define CPER_SECTION_DMAR_VTD_H
3
4#include "json.h"
5#include "../edk/Cper.h"
6
Lawrence Tangce0f82b2022-07-07 16:14:28 +01007#define VTD_FAULT_RECORD_TYPES_KEYS (int []){0, 1}
8#define VTD_FAULT_RECORD_TYPES_VALUES (const char*[]){"Write Request", "Read/AtomicOp Request"}
9
10typedef struct {
11 UINT64 Resv1 : 12;
12 UINT64 FaultInformation : 52;
13 UINT64 SourceIdentifier : 16;
14 UINT64 Resv2 : 13;
15 UINT64 PrivelegeModeRequested : 1;
16 UINT64 ExecutePermissionRequested : 1;
17 UINT64 PasidPresent : 1;
18 UINT64 FaultReason : 8;
19 UINT64 PasidValue : 20;
20 UINT64 AddressType : 2;
21 UINT64 Type : 1;
22 UINT64 Resv3 : 1;
23} EFI_VTD_FAULT_RECORD;
24
Lawrence Tangdb1b7ce2022-07-06 15:40:26 +010025json_object* cper_section_dmar_vtd_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor);
Lawrence Tang205dd1d2022-07-14 16:23:38 +010026void ir_section_dmar_vtd_to_cper(json_object* section, FILE* out);
Lawrence Tangdb1b7ce2022-07-06 15:40:26 +010027
28#endif