14795d4aeSLawrence Tang #ifndef CPER_SECTION_DMAR_GENERIC_H
24795d4aeSLawrence Tang #define CPER_SECTION_DMAR_GENERIC_H
34795d4aeSLawrence Tang 
4*5202bbb4SLawrence Tang #include <json.h>
54795d4aeSLawrence Tang #include "../edk/Cper.h"
64795d4aeSLawrence Tang 
74795d4aeSLawrence Tang #define DMAR_GENERIC_ERROR_FAULT_REASON_TYPES_KEYS (int []){0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB}
84795d4aeSLawrence Tang #define DMAR_GENERIC_ERROR_FAULT_REASON_TYPES_VALUES (const char*[]){"DMT Entry Missing", "DMT Entry Invalid", \
94795d4aeSLawrence Tang     "DMT Access Error", "DMT Reserved Bit Invalid", "DMA Address Out of Bounds", "Invalid Read/Write", \
104795d4aeSLawrence Tang     "Invalid Device Request", "ATT Access Error", "ATT Reserved Bit Invalid", "Illegal Command", "Command Buffer Access Error"}
114795d4aeSLawrence Tang #define DMAR_GENERIC_ERROR_FAULT_REASON_TYPES_DESCRIPTIONS (const char*[]){ \
124795d4aeSLawrence Tang     "Domain mapping table entry is not present.", \
1301e3a44dSLawrence Tang     "Invalid domain mapping table entry.", \
1401e3a44dSLawrence Tang     "DMAr unit's attempt to access the domain mapping table resulted in an error.", \
154795d4aeSLawrence Tang     "Reserved bit set to non-zero value in the domain mapping table.", \
164795d4aeSLawrence Tang     "DMA request to access an address beyond the device address width.", \
174795d4aeSLawrence Tang     "Invalid read or write access.", \
184795d4aeSLawrence Tang     "Invalid device request.", \
194795d4aeSLawrence Tang     "DMAr unit's attempt to access the address translation table resulted in an error.", \
204795d4aeSLawrence Tang     "Reserved bit set to non-zero value in the address translation table.", \
214795d4aeSLawrence Tang     "Illegal command error.", \
224795d4aeSLawrence Tang     "DMAr unit's attempt to access the command buffer resulted in an error."}
234795d4aeSLawrence Tang #define DMAR_GENERIC_ERROR_ACCESS_TYPES_KEYS (int []){0x0, 0x1}
244795d4aeSLawrence Tang #define DMAR_GENERIC_ERROR_ACCESS_TYPES_VALUES (const char*[]){"DMA Write", "DMA Read"}
254795d4aeSLawrence Tang #define DMAR_GENERIC_ERROR_ADDRESS_TYPES_KEYS (int []){0x0, 0x1}
264795d4aeSLawrence Tang #define DMAR_GENERIC_ERROR_ADDRESS_TYPES_VALUES (const char*[]){"Untranslated Request", "Translation Request"}
274795d4aeSLawrence Tang #define DMAR_GENERIC_ERROR_ARCH_TYPES_KEYS (int []){0x0, 0x1}
284795d4aeSLawrence Tang #define DMAR_GENERIC_ERROR_ARCH_TYPES_VALUES (const char*[]){"VT-d", "IOMMU"}
294795d4aeSLawrence Tang 
304795d4aeSLawrence Tang json_object* cper_section_dmar_generic_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor);
31205dd1d7SLawrence Tang void ir_section_dmar_generic_to_cper(json_object* section, FILE* out);
32205dd1d7SLawrence Tang 
334795d4aeSLawrence Tang 
344795d4aeSLawrence Tang #endif