1 #ifndef CPER_SECTION_DMAR_GENERIC_H
2 #define CPER_SECTION_DMAR_GENERIC_H
3 
4 #include "json.h"
5 #include "../edk/Cper.h"
6 
7 #define DMAR_GENERIC_ERROR_FAULT_REASON_TYPES_KEYS (int []){0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB}
8 #define DMAR_GENERIC_ERROR_FAULT_REASON_TYPES_VALUES (const char*[]){"DMT Entry Missing", "DMT Entry Invalid", \
9     "DMT Access Error", "DMT Reserved Bit Invalid", "DMA Address Out of Bounds", "Invalid Read/Write", \
10     "Invalid Device Request", "ATT Access Error", "ATT Reserved Bit Invalid", "Illegal Command", "Command Buffer Access Error"}
11 #define DMAR_GENERIC_ERROR_FAULT_REASON_TYPES_DESCRIPTIONS (const char*[]){ \
12     "Domain mapping table entry is not present.", \
13     "DMAr unit's attempt to access the domain mapping table resulted in an error." \
14     "Reserved bit set to non-zero value in the domain mapping table.", \
15     "DMA request to access an address beyond the device address width.", \
16     "Invalid read or write access.", \
17     "Invalid device request.", \
18     "DMAr unit's attempt to access the address translation table resulted in an error.", \
19     "Reserved bit set to non-zero value in the address translation table.", \
20     "Illegal command error.", \
21     "DMAr unit's attempt to access the command buffer resulted in an error."}
22 #define DMAR_GENERIC_ERROR_ACCESS_TYPES_KEYS (int []){0x0, 0x1}
23 #define DMAR_GENERIC_ERROR_ACCESS_TYPES_VALUES (const char*[]){"DMA Write", "DMA Read"}
24 #define DMAR_GENERIC_ERROR_ADDRESS_TYPES_KEYS (int []){0x0, 0x1}
25 #define DMAR_GENERIC_ERROR_ADDRESS_TYPES_VALUES (const char*[]){"Untranslated Request", "Translation Request"}
26 #define DMAR_GENERIC_ERROR_ARCH_TYPES_KEYS (int []){0x0, 0x1}
27 #define DMAR_GENERIC_ERROR_ARCH_TYPES_VALUES (const char*[]){"VT-d", "IOMMU"}
28 
29 json_object* cper_section_dmar_generic_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor);
30 void ir_section_dmar_generic_to_cper(json_object* section, FILE* out);
31 
32 
33 #endif