xref: /openbmc/libcper/include/libcper/sections/cper-section-dmar-generic.h (revision c97c041e571841f0ce67292208e083f6d858cf5c)
1 #ifndef CPER_SECTION_DMAR_GENERIC_H
2 #define CPER_SECTION_DMAR_GENERIC_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #include <stdio.h>
9 #include <json.h>
10 #include <libcper/Cper.h>
11 
12 #define DMAR_GENERIC_ERROR_FAULT_REASON_TYPES_KEYS                             \
13 	(int[]){ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB }
14 #define DMAR_GENERIC_ERROR_FAULT_REASON_TYPES_VALUES                           \
15 	(const char *[]){                                                      \
16 		"DMT Entry Missing",	      "DMT Entry Invalid",             \
17 		"DMT Access Error",	      "DMT Reserved Bit Invalid",      \
18 		"DMA Address Out of Bounds",  "Invalid Read/Write",            \
19 		"Invalid Device Request",     "ATT Access Error",              \
20 		"ATT Reserved Bit Invalid",   "Illegal Command",               \
21 		"Command Buffer Access Error"                                  \
22 	}
23 #define DMAR_GENERIC_ERROR_FAULT_REASON_TYPES_DESCRIPTIONS                                           \
24 	(const char *[]){                                                                            \
25 		"Domain mapping table entry is not present.",                                        \
26 		"Invalid domain mapping table entry.",                                               \
27 		"DMAr unit's attempt to access the domain mapping table resulted in an error.",      \
28 		"Reserved bit set to non-zero value in the domain mapping table.",                   \
29 		"DMA request to access an address beyond the device address width.",                 \
30 		"Invalid read or write access.",                                                     \
31 		"Invalid device request.",                                                           \
32 		"DMAr unit's attempt to access the address translation table resulted in an error.", \
33 		"Reserved bit set to non-zero value in the address translation table.",              \
34 		"Illegal command error.",                                                            \
35 		"DMAr unit's attempt to access the command buffer resulted in an error."             \
36 	}
37 #define DMAR_GENERIC_ERROR_ACCESS_TYPES_KEYS (int[]){ 0x0, 0x1 }
38 #define DMAR_GENERIC_ERROR_ACCESS_TYPES_VALUES                                 \
39 	(const char *[]){ "DMA Write", "DMA Read" }
40 #define DMAR_GENERIC_ERROR_ADDRESS_TYPES_KEYS (int[]){ 0x0, 0x1 }
41 #define DMAR_GENERIC_ERROR_ADDRESS_TYPES_VALUES                                \
42 	(const char *[]){ "Untranslated Request", "Translation Request" }
43 #define DMAR_GENERIC_ERROR_ARCH_TYPES_KEYS   (int[]){ 0x0, 0x1 }
44 #define DMAR_GENERIC_ERROR_ARCH_TYPES_VALUES (const char *[]){ "VT-d", "IOMMU" }
45 
46 json_object *cper_section_dmar_generic_to_ir(void *section);
47 void ir_section_dmar_generic_to_cper(json_object *section, FILE *out);
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif
54