mirror of
https://github.com/acpica/acpica/
synced 2025-02-22 00:14:18 +03:00
Enhance error reporting for invalid opcodes and bad ACPI_NAMEs.
For disassembler, dump the 48 bytes surrounding the invalid opcode. Fix incorrect table offset reported for invalid opcodes. Report original 32-bit value for bad ACPI_NAMEs.
This commit is contained in:
parent
80328e4bf7
commit
7f49766105
@ -727,10 +727,11 @@ AcpiNsExternalizeName (
|
||||
(*ConvertedName)[j++] = '.';
|
||||
}
|
||||
|
||||
(*ConvertedName)[j++] = InternalName[NamesIndex++];
|
||||
(*ConvertedName)[j++] = InternalName[NamesIndex++];
|
||||
(*ConvertedName)[j++] = InternalName[NamesIndex++];
|
||||
(*ConvertedName)[j++] = InternalName[NamesIndex++];
|
||||
ACPI_MOVE_NAME (*ConvertedName, InternalName);
|
||||
AcpiUtRepairName (*ConvertedName);
|
||||
|
||||
j += ACPI_NAME_SIZE;
|
||||
NamesIndex += ACPI_NAME_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -227,15 +227,34 @@ AcpiPsGetAmlOpcode (
|
||||
|
||||
/* The opcode is unrecognized. Just skip unknown opcodes */
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Found unknown opcode 0x%X at AML address %p offset 0x%X, ignoring",
|
||||
WalkState->Opcode, WalkState->ParserState.Aml, WalkState->AmlOffset));
|
||||
if (WalkState->PassNumber == 2)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unknown opcode 0x%.2X at table offset 0x%.4X, ignoring",
|
||||
WalkState->Opcode, WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER)));
|
||||
|
||||
ACPI_DUMP_BUFFER (WalkState->ParserState.Aml, 128);
|
||||
ACPI_DUMP_BUFFER (WalkState->ParserState.Aml, 128);
|
||||
|
||||
/* Assume one-byte bad opcode */
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
|
||||
AcpiOsPrintf ("/*\nError: Unknown opcode 0x%.2X at table offset 0x%.4X, context:\n",
|
||||
WalkState->Opcode, WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER));
|
||||
|
||||
/* TBD: Pass current offset to DumpBuffer */
|
||||
|
||||
AcpiUtDumpBuffer2 (((UINT8 *) WalkState->ParserState.Aml - 16), 48, DB_BYTE_DISPLAY);
|
||||
AcpiOsPrintf (" */\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Increment past one or two-byte opcode */
|
||||
|
||||
WalkState->ParserState.Aml++;
|
||||
if (WalkState->Opcode > 0xFF)
|
||||
{
|
||||
WalkState->ParserState.Aml++;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE);
|
||||
|
||||
default:
|
||||
@ -623,8 +642,8 @@ AcpiPsGetArguments (
|
||||
(!Arg))
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Detected an unsupported executable opcode "
|
||||
"at module-level: [0x%.4X] at table offset 0x%.4X",
|
||||
"Unsupported module-level executable opcode "
|
||||
"0x%.2X at table offset 0x%.4X",
|
||||
Op->Common.AmlOpcode,
|
||||
(UINT32) (ACPI_PTR_DIFF (AmlOpStart,
|
||||
WalkState->ParserState.AmlStart) +
|
||||
|
@ -897,11 +897,14 @@ AcpiUtRepairName (
|
||||
{
|
||||
UINT32 i;
|
||||
BOOLEAN FoundBadChar = FALSE;
|
||||
UINT32 OriginalName;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (UtRepairName);
|
||||
|
||||
|
||||
ACPI_MOVE_NAME (&OriginalName, Name);
|
||||
|
||||
/* Check each character in the name */
|
||||
|
||||
for (i = 0; i < ACPI_NAME_SIZE; i++)
|
||||
@ -927,12 +930,14 @@ AcpiUtRepairName (
|
||||
if (!AcpiGbl_EnableInterpreterSlack)
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Found bad character(s) in name, repaired: [%4.4s]\n", Name));
|
||||
"Invalid character(s) in name (0x%.8X), repaired: [%4.4s]",
|
||||
OriginalName, Name));
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Found bad character(s) in name, repaired: [%4.4s]\n", Name));
|
||||
"Invalid character(s) in name (0x%.8X), repaired: [%4.4s]",
|
||||
OriginalName, Name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -544,7 +544,7 @@ AcpiUtNamespaceError (
|
||||
/* There is a non-ascii character in the name */
|
||||
|
||||
ACPI_MOVE_32_TO_32 (&BadName, ACPI_CAST_PTR (UINT32, InternalName));
|
||||
AcpiOsPrintf ("[0x%4.4X] (NON-ASCII)", BadName);
|
||||
AcpiOsPrintf ("[0x%.8X] (NON-ASCII)", BadName);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user