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                             \
8 	(int[])                                                                \
9 	{                                                                      \
10 		0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB          \
11 	}
12 #define DMAR_GENERIC_ERROR_FAULT_REASON_TYPES_VALUES                           \
13 	(const char *[])                                                       \
14 	{                                                                      \
15 		"DMT Entry Missing", "DMT Entry Invalid", "DMT Access Error",  \
16 			"DMT Reserved Bit Invalid",                            \
17 			"DMA Address Out of Bounds", "Invalid Read/Write",     \
18 			"Invalid Device Request", "ATT Access Error",          \
19 			"ATT Reserved Bit Invalid", "Illegal Command",         \
20 			"Command Buffer Access Error"                          \
21 	}
22 #define DMAR_GENERIC_ERROR_FAULT_REASON_TYPES_DESCRIPTIONS                                                   \
23 	(const char *[])                                                                                     \
24 	{                                                                                                    \
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                                   \
38 	(int[])                                                                \
39 	{                                                                      \
40 		0x0, 0x1                                                       \
41 	}
42 #define DMAR_GENERIC_ERROR_ACCESS_TYPES_VALUES                                 \
43 	(const char *[])                                                       \
44 	{                                                                      \
45 		"DMA Write", "DMA Read"                                        \
46 	}
47 #define DMAR_GENERIC_ERROR_ADDRESS_TYPES_KEYS                                  \
48 	(int[])                                                                \
49 	{                                                                      \
50 		0x0, 0x1                                                       \
51 	}
52 #define DMAR_GENERIC_ERROR_ADDRESS_TYPES_VALUES                                \
53 	(const char *[])                                                       \
54 	{                                                                      \
55 		"Untranslated Request", "Translation Request"                  \
56 	}
57 #define DMAR_GENERIC_ERROR_ARCH_TYPES_KEYS                                     \
58 	(int[])                                                                \
59 	{                                                                      \
60 		0x0, 0x1                                                       \
61 	}
62 #define DMAR_GENERIC_ERROR_ARCH_TYPES_VALUES                                   \
63 	(const char *[])                                                       \
64 	{                                                                      \
65 		"VT-d", "IOMMU"                                                \
66 	}
67 
68 json_object *cper_section_dmar_generic_to_ir(void *section);
69 void ir_section_dmar_generic_to_cper(json_object *section, FILE *out);
70 
71 #endif
72