Lawrence Tang | db1b7ce | 2022-07-06 15:40:26 +0100 | [diff] [blame] | 1 | #ifndef CPER_SECTION_DMAR_VTD_H |
| 2 | #define CPER_SECTION_DMAR_VTD_H |
| 3 | |
Lawrence Tang | 5202bbb | 2022-08-12 14:54:36 +0100 | [diff] [blame] | 4 | #include <json.h> |
Lawrence Tang | db1b7ce | 2022-07-06 15:40:26 +0100 | [diff] [blame] | 5 | #include "../edk/Cper.h" |
| 6 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 7 | #define VTD_FAULT_RECORD_TYPES_KEYS \ |
| 8 | (int[]) \ |
| 9 | { \ |
| 10 | 0, 1 \ |
| 11 | } |
| 12 | #define VTD_FAULT_RECORD_TYPES_VALUES \ |
| 13 | (const char *[]) \ |
| 14 | { \ |
| 15 | "Write Request", "Read/AtomicOp Request" \ |
| 16 | } |
Lawrence Tang | ce0f82b | 2022-07-07 16:14:28 +0100 | [diff] [blame] | 17 | |
| 18 | typedef struct { |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 19 | UINT64 Resv1 : 12; |
| 20 | UINT64 FaultInformation : 52; |
| 21 | UINT64 SourceIdentifier : 16; |
| 22 | UINT64 Resv2 : 13; |
| 23 | UINT64 PrivelegeModeRequested : 1; |
| 24 | UINT64 ExecutePermissionRequested : 1; |
| 25 | UINT64 PasidPresent : 1; |
| 26 | UINT64 FaultReason : 8; |
| 27 | UINT64 PasidValue : 20; |
| 28 | UINT64 AddressType : 2; |
| 29 | UINT64 Type : 1; |
| 30 | UINT64 Resv3 : 1; |
Lawrence Tang | ce0f82b | 2022-07-07 16:14:28 +0100 | [diff] [blame] | 31 | } EFI_VTD_FAULT_RECORD; |
| 32 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 33 | json_object *cper_section_dmar_vtd_to_ir(void *section); |
| 34 | void ir_section_dmar_vtd_to_cper(json_object *section, FILE *out); |
Lawrence Tang | db1b7ce | 2022-07-06 15:40:26 +0100 | [diff] [blame] | 35 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 36 | #endif |