diff options
author | Bob Moore <robert.moore@intel.com> | 2012-10-31 02:27:48 +0000 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-11-15 00:31:28 +0100 |
commit | 00eb32550f59a15796e936418b46b5134bd23a55 (patch) | |
tree | 8edafb585ff83cefd89dd915529f0956390dd0cc /drivers/acpi/acpica/psloop.c | |
parent | ff60027174cf94bab6d4f45ab5c5da1de63b7d1b (diff) | |
download | op-kernel-dev-00eb32550f59a15796e936418b46b5134bd23a55.zip op-kernel-dev-00eb32550f59a15796e936418b46b5134bd23a55.tar.gz |
ACPICA: 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.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/psloop.c')
-rw-r--r-- | drivers/acpi/acpica/psloop.c | 51 |
1 files changed, 40 insertions, 11 deletions
diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c index 31e2e9f..e8b6dc0 100644 --- a/drivers/acpi/acpica/psloop.c +++ b/drivers/acpi/acpica/psloop.c @@ -135,16 +135,38 @@ static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state) /* 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", - walk_state->opcode, walk_state->parser_state.aml, - walk_state->aml_offset)); + if (walk_state->pass_number == 2) { + ACPI_ERROR((AE_INFO, + "Unknown opcode 0x%.2X at table offset 0x%.4X, ignoring", + walk_state->opcode, + walk_state->aml_offset + + sizeof(struct acpi_table_header))); - ACPI_DUMP_BUFFER(walk_state->parser_state.aml, 128); + ACPI_DUMP_BUFFER(walk_state->parser_state.aml, 128); - /* Assume one-byte bad opcode */ +#ifdef ACPI_ASL_COMPILER + + acpi_os_printf + ("/*\nError: Unknown opcode 0x%.2X at table offset 0x%.4X, context:\n", + walk_state->opcode, + walk_state->aml_offset + + sizeof(struct acpi_table_header)); + + /* TBD: Pass current offset to dump_buffer */ + + acpi_ut_dump_buffer2(((u8 *)walk_state->parser_state. + aml - 16), 48, DB_BYTE_DISPLAY); + acpi_os_printf(" */\n"); +#endif + } + + /* Increment past one or two-byte opcode */ walk_state->parser_state.aml++; + if (walk_state->opcode > 0xFF) { + walk_state->parser_state.aml++; + } + return_ACPI_STATUS(AE_CTRL_PARSE_CONTINUE); default: @@ -519,11 +541,18 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state, if ((op_info->class == AML_CLASS_EXECUTE) && (!arg)) { ACPI_WARNING((AE_INFO, - "Detected an unsupported executable opcode " - "at module-level: [0x%.4X] at table offset 0x%.4X", - op->common.aml_opcode, - (u32)((aml_op_start - walk_state->parser_state.aml_start) - + sizeof(struct acpi_table_header)))); + "Unsupported module-level executable opcode " + "0x%.2X at table offset 0x%.4X", + op->common. + aml_opcode, + (u32) + (ACPI_PTR_DIFF + (aml_op_start, + walk_state-> + parser_state. + aml_start) + + sizeof(struct + acpi_table_header)))); } } break; |