19STATIC UINT32 *mEinjInjectionHdrSize;
20STATIC UINT32 *mEinjInjectionEntryCnt;
24 L
"READ_REGISTER_VALUE",
26 L
"WRITE_REGISTER_VALUE",
49 Flags = *(UINT8 *)Ptr;
53 Print (L
"\nERROR: Injection Flags must be zero...");
62 { L
"Injection Header Size", 4, 36, L
"%d",
NULL, (VOID **)&mEinjInjectionHdrSize,
66 { L
"Injection Entry Count", 4, 44, L
"%d",
NULL, (VOID **)&mEinjInjectionEntryCnt,
90 UINT8 InjectionAction;
91 UINT8 MaxInjectionAction;
93 InjectionAction = *(UINT8 *)Ptr;
102 MaxInjectionAction = EFI_ACPI_6_5_EINJ_GET_EXECUTE_OPERATION_TIMINGS;
104 MaxInjectionAction = EFI_ACPI_6_5_EINJ_EINJV2_GET_ERROR_TYPE;
108 (InjectionAction > MaxInjectionAction))
111 Print (L
"\nERROR: Invalid Injection Action(0x%x)...", InjectionAction);
138 if (Inst > EFI_ACPI_6_5_EINJ_NOOP) {
140 Print (L
"\nERROR: Invalid Instruction(0x%x)...", Inst);
167 if ((RegisterRegion->AddressSpaceId != EFI_ACPI_6_5_SYSTEM_MEMORY) &&
168 (RegisterRegion->AddressSpaceId != EFI_ACPI_6_5_SYSTEM_IO))
171 Print (L
"\nERROR: Register Region Must be SYSTEM_MEMORY or SYSTEM_IO...");
186 IN CONST CHAR16 *Format OPTIONAL,
191 UINT8 InjectionAction;
192 CONST CHAR16 *ActionName;
194 InjectionAction = *Ptr;
196 switch (InjectionAction) {
198 ActionName = L
"BEGIN_INJECTION_OPERATION";
200 case EFI_ACPI_6_5_EINJ_GET_TRIGGER_ERROR_ACTION_TABLE:
201 ActionName = L
"GET_TRIGGER_ERROR_ACTION_TABLE";
203 case EFI_ACPI_6_5_EINJ_SET_ERROR_TYPE:
204 ActionName = L
"SET_ERROR_TYPE";
206 case EFI_ACPI_6_5_EINJ_GET_ERROR_TYPE:
207 ActionName = L
"GET_ERROR_TYPE";
209 case EFI_ACPI_6_5_EINJ_END_OPERATION:
210 ActionName = L
"END_OPERATION";
212 case EFI_ACPI_6_5_EINJ_EXECUTE_OPERATION:
213 ActionName = L
"EXECUTE_OPERATION";
215 case EFI_ACPI_6_5_EINJ_CHECK_BUSY_STATUS:
216 ActionName = L
"CHECK_BUSY_STATUS";
218 case EFI_ACPI_6_5_EINJ_GET_COMMAND_STATUS:
219 ActionName = L
"GET_COMMAND_STATUS";
221 case EFI_ACPI_6_5_EINJ_SET_ERROR_TYPE_WITH_ADDRESS:
222 ActionName = L
"SET_ERROR_TYPE_WITH_ADDRESS";
224 case EFI_ACPI_6_5_EINJ_GET_EXECUTE_OPERATION_TIMINGS:
225 ActionName = L
"GET_EXECUTE_OPERATION_TIMINGS";
227 case EFI_ACPI_6_5_EINJ_EINJV2_SET_ERROR_TYPE:
228 ActionName = L
"EINJV2_SET_ERROR_TYPE";
230 case EFI_ACPI_6_5_EINJ_EINJV2_GET_ERROR_TYPE:
231 ActionName = L
"EINJV2_GET_ERROR_TYPE";
233 case EFI_ACPI_6_5_EINJ_TRIGGER_ERROR:
234 ActionName = L
"TRIGGER_ERROR";
238 ActionName = L
"UNKNOWN";
241 Print (L
"%s(0x%x)", ActionName, InjectionAction);
255 IN CONST CHAR16 *Format OPTIONAL,
261 CONST CHAR16 *InstName;
266 InstName = InstNameTable[Inst];
269 InstName = L
"UNKNOWN";
272 Print (L
"%s(0x%x)", InstName, Inst);
308 IN UINT32 AcpiTableLength,
309 IN UINT8 AcpiTableRevision
313 UINT8 *InjInstEntryPtr;
314 UINT32 InjInstEntrySize;
330 if ((mEinjInjectionHdrSize ==
NULL) || (*mEinjInjectionHdrSize != Offset)) {
332 Print (L
"ERROR: Invalid Injection Header...\n");
336 if ((mEinjInjectionEntryCnt ==
NULL) || (*mEinjInjectionEntryCnt == 0)) {
338 Print (L
"ERROR: Injection Instruction Entry should be presented...\n");
344 if ((*mEinjInjectionEntryCnt * InjInstEntrySize) != (AcpiTableLength - Offset)) {
347 L
"ERROR: Incorrect count for Injection Instruction Entry.\n" \
348 L
" Injection Entry Count= %d.\n" \
349 L
" Present Count= %d.\n",
350 *mEinjInjectionEntryCnt,
351 (AcpiTableLength - Offset) / InjInstEntrySize
355 while (Offset < AcpiTableLength) {
356 InjInstEntryPtr = Ptr + Offset;
362 "Injection Instruction Entry",
364 AcpiTableLength - Offset,
368 Offset += InjInstEntrySize;
#define EFI_ACPI_6_5_EINJ_BEGIN_INJECTION_OPERATION
#define EFI_ACPI_6_5_ERROR_INJECTION_TABLE_REVISION
VOID EFIAPI DumpGas(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
VOID EFIAPI IncrementErrorCount(VOID)
UINT32 EFIAPI ParseAcpi(IN BOOLEAN Trace, IN UINT32 Indent, IN CONST CHAR8 *AsciiName OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length, IN CONST ACPI_PARSER *Parser, IN UINT32 ParserItems)
#define PARSER_PARAMS(Parser)
#define PARSE_ACPI_HEADER(Info)
STATIC VOID EFIAPI ValidateInjectionAction(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC VOID EFIAPI DumpInjectionInstAction(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
VOID EFIAPI ParseAcpiEinj(IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
STATIC CONST ACPI_PARSER EinjParser[]
STATIC VOID EFIAPI ValidateRegisterRegion(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC CONST ACPI_PARSER EinjInjectionInstEntryParser[]
STATIC VOID EFIAPI ValidateInstruction(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC VOID EFIAPI DumpInstruction(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
STATIC VOID EFIAPI ValidateInjectionFlags(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
#define ARRAY_SIZE(Array)
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)