14795d4aeSLawrence Tang #ifndef CPER_SECTION_DMAR_GENERIC_H
24795d4aeSLawrence Tang #define CPER_SECTION_DMAR_GENERIC_H
34795d4aeSLawrence Tang 
45202bbb4SLawrence Tang #include <json.h>
54795d4aeSLawrence Tang #include "../edk/Cper.h"
64795d4aeSLawrence Tang 
7*f8fc7052SJohn Chung #define DMAR_GENERIC_ERROR_FAULT_REASON_TYPES_KEYS                             \
8*f8fc7052SJohn Chung 	(int[])                                                                \
9*f8fc7052SJohn Chung 	{                                                                      \
10*f8fc7052SJohn Chung 		0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB          \
11*f8fc7052SJohn Chung 	}
12*f8fc7052SJohn Chung #define DMAR_GENERIC_ERROR_FAULT_REASON_TYPES_VALUES                           \
13*f8fc7052SJohn Chung 	(const char *[])                                                       \
14*f8fc7052SJohn Chung 	{                                                                      \
15*f8fc7052SJohn Chung 		"DMT Entry Missing", "DMT Entry Invalid", "DMT Access Error",  \
16*f8fc7052SJohn Chung 			"DMT Reserved Bit Invalid",                            \
17*f8fc7052SJohn Chung 			"DMA Address Out of Bounds", "Invalid Read/Write",     \
18*f8fc7052SJohn Chung 			"Invalid Device Request", "ATT Access Error",          \
19*f8fc7052SJohn Chung 			"ATT Reserved Bit Invalid", "Illegal Command",         \
20*f8fc7052SJohn Chung 			"Command Buffer Access Error"                          \
21*f8fc7052SJohn Chung 	}
22*f8fc7052SJohn Chung #define DMAR_GENERIC_ERROR_FAULT_REASON_TYPES_DESCRIPTIONS                                                   \
23*f8fc7052SJohn Chung 	(const char *[])                                                                                     \
24*f8fc7052SJohn Chung 	{                                                                                                    \
254795d4aeSLawrence Tang 		"Domain mapping table entry is not present.",                                                \
2601e3a44dSLawrence Tang 			"Invalid domain mapping table entry.",                                               \
2701e3a44dSLawrence Tang 			"DMAr unit's attempt to access the domain mapping table resulted in an error.",      \
284795d4aeSLawrence Tang 			"Reserved bit set to non-zero value in the domain mapping table.",                   \
294795d4aeSLawrence Tang 			"DMA request to access an address beyond the device address width.",                 \
304795d4aeSLawrence Tang 			"Invalid read or write access.",                                                     \
314795d4aeSLawrence Tang 			"Invalid device request.",                                                           \
324795d4aeSLawrence Tang 			"DMAr unit's attempt to access the address translation table resulted in an error.", \
334795d4aeSLawrence Tang 			"Reserved bit set to non-zero value in the address translation table.",              \
344795d4aeSLawrence Tang 			"Illegal command error.",                                                            \
35*f8fc7052SJohn Chung 			"DMAr unit's attempt to access the command buffer resulted in an error."             \
36*f8fc7052SJohn Chung 	}
37*f8fc7052SJohn Chung #define DMAR_GENERIC_ERROR_ACCESS_TYPES_KEYS                                   \
38*f8fc7052SJohn Chung 	(int[])                                                                \
39*f8fc7052SJohn Chung 	{                                                                      \
40*f8fc7052SJohn Chung 		0x0, 0x1                                                       \
41*f8fc7052SJohn Chung 	}
42*f8fc7052SJohn Chung #define DMAR_GENERIC_ERROR_ACCESS_TYPES_VALUES                                 \
43*f8fc7052SJohn Chung 	(const char *[])                                                       \
44*f8fc7052SJohn Chung 	{                                                                      \
45*f8fc7052SJohn Chung 		"DMA Write", "DMA Read"                                        \
46*f8fc7052SJohn Chung 	}
47*f8fc7052SJohn Chung #define DMAR_GENERIC_ERROR_ADDRESS_TYPES_KEYS                                  \
48*f8fc7052SJohn Chung 	(int[])                                                                \
49*f8fc7052SJohn Chung 	{                                                                      \
50*f8fc7052SJohn Chung 		0x0, 0x1                                                       \
51*f8fc7052SJohn Chung 	}
52*f8fc7052SJohn Chung #define DMAR_GENERIC_ERROR_ADDRESS_TYPES_VALUES                                \
53*f8fc7052SJohn Chung 	(const char *[])                                                       \
54*f8fc7052SJohn Chung 	{                                                                      \
55*f8fc7052SJohn Chung 		"Untranslated Request", "Translation Request"                  \
56*f8fc7052SJohn Chung 	}
57*f8fc7052SJohn Chung #define DMAR_GENERIC_ERROR_ARCH_TYPES_KEYS                                     \
58*f8fc7052SJohn Chung 	(int[])                                                                \
59*f8fc7052SJohn Chung 	{                                                                      \
60*f8fc7052SJohn Chung 		0x0, 0x1                                                       \
61*f8fc7052SJohn Chung 	}
62*f8fc7052SJohn Chung #define DMAR_GENERIC_ERROR_ARCH_TYPES_VALUES                                   \
63*f8fc7052SJohn Chung 	(const char *[])                                                       \
64*f8fc7052SJohn Chung 	{                                                                      \
65*f8fc7052SJohn Chung 		"VT-d", "IOMMU"                                                \
66*f8fc7052SJohn Chung 	}
674795d4aeSLawrence Tang 
68*f8fc7052SJohn Chung json_object *cper_section_dmar_generic_to_ir(void *section);
69205dd1d7SLawrence Tang void ir_section_dmar_generic_to_cper(json_object *section, FILE *out);
70205dd1d7SLawrence Tang 
714795d4aeSLawrence Tang #endif
72