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