From c51a4de85de720670f2fbc592a6f8040af72ad87 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Thu, 17 Nov 2005 13:07:00 -0500 Subject: [ACPI] ACPICA 20051117 Fixed a problem in the AML parser where the method thread count could be decremented below zero if any errors occurred during the method parse phase. This should eliminate AE_AML_METHOD_LIMIT exceptions seen on some machines. This also fixed a related regression with the mechanism that detects and corrects methods that cannot properly handle reentrancy (related to the deployment of the new OwnerId mechanism.) Eliminated the pre-parsing of control methods (to detect errors) during table load. Related to the problem above, this was causing unwind issues if any errors occurred during the parse, and it seemed to be overkill. A table load should not be aborted if there are problems with any single control method, thus rendering this feature rather pointless. Fixed a problem with the new table-driven resource manager where an internal buffer overflow could occur for small resource templates. Implemented a new external interface, acpi_get_vendor_resource() This interface will find and return a vendor-defined resource descriptor within a _CRS or _PRS method via an ACPI 3.0 UUID match. (from Bjorn Helgaas) Removed the length limit (200) on string objects as per the upcoming ACPI 3.0A specification. This affects the following areas of the interpreter: 1) any implicit conversion of a Buffer to a String, 2) a String object result of the ASL Concatentate operator, 3) the String object result of the ASL ToString operator. Signed-off-by: Bob Moore Signed-off-by: Len Brown --- drivers/acpi/executer/exoparg2.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'drivers/acpi/executer/exoparg2.c') diff --git a/drivers/acpi/executer/exoparg2.c b/drivers/acpi/executer/exoparg2.c index 8d70c6b..d847284 100644 --- a/drivers/acpi/executer/exoparg2.c +++ b/drivers/acpi/executer/exoparg2.c @@ -344,10 +344,6 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state) (length < operand[1]->integer.value) && (operand[0]->buffer.pointer[length])) { length++; - if (length > ACPI_MAX_STRING_CONVERSION) { - status = AE_AML_STRING_LIMIT; - goto cleanup; - } } /* Allocate a new string object */ @@ -358,8 +354,10 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state) goto cleanup; } - /* Copy the raw buffer data with no transform. NULL terminated already */ - + /* + * Copy the raw buffer data with no transform. + * (NULL terminated already) + */ ACPI_MEMCPY(return_desc->string.pointer, operand[0]->buffer.pointer, length); break; -- cgit v1.1 From 4a90c7e86202f46fa9af011bdbcdf36e355d1721 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 13 Jan 2006 16:22:00 -0500 Subject: [ACPI] ACPICA 20060113 Added 2006 copyright. At SuSE's suggestion, enabled all error messages without enabling function tracing, ie with CONFIG_ACPI_DEBUG=n Replaced all instances of the ACPI_DEBUG_PRINT macro invoked at the ACPI_DB_ERROR and ACPI_DB_WARN debug levels with the ACPI_REPORT_ERROR and ACPI_REPORT_WARNING macros, respectively. This preserves all error and warning messages in the non-debug version of the ACPICA code (this has been referred to as the "debug lite" option.) Over 200 cases were converted to create a total of over 380 error/warning messages across the ACPICA code. This increases the code and data size of the default non-debug version by about 13K. Added ACPI_NO_ERROR_MESSAGES flag to enable deleting all messages. The size of the debug version remains about the same. Signed-off-by: Bob Moore Signed-off-by: Len Brown --- drivers/acpi/executer/exoparg2.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'drivers/acpi/executer/exoparg2.c') diff --git a/drivers/acpi/executer/exoparg2.c b/drivers/acpi/executer/exoparg2.c index d847284..7c59dda 100644 --- a/drivers/acpi/executer/exoparg2.c +++ b/drivers/acpi/executer/exoparg2.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -111,9 +111,7 @@ acpi_status acpi_ex_opcode_2A_0T_0R(struct acpi_walk_state *walk_state) /* Are notifies allowed on this object? */ if (!acpi_ev_is_notify_object(node)) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Unexpected notify object type [%s]\n", - acpi_ut_get_type_name(node->type))); + ACPI_REPORT_ERROR(("Unexpected notify object type [%s]\n", acpi_ut_get_type_name(node->type))); status = AE_AML_OPERAND_TYPE; break; @@ -157,7 +155,8 @@ acpi_status acpi_ex_opcode_2A_0T_0R(struct acpi_walk_state *walk_state) default: - ACPI_REPORT_ERROR(("acpi_ex_opcode_2A_0T_0R: Unknown opcode %X\n", walk_state->opcode)); + ACPI_REPORT_ERROR(("Unknown AML opcode %X\n", + walk_state->opcode)); status = AE_AML_BAD_OPCODE; } @@ -221,7 +220,8 @@ acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state) default: - ACPI_REPORT_ERROR(("acpi_ex_opcode_2A_2T_1R: Unknown opcode %X\n", walk_state->opcode)); + ACPI_REPORT_ERROR(("Unknown AML opcode %X\n", + walk_state->opcode)); status = AE_AML_BAD_OPCODE; goto cleanup; } @@ -389,10 +389,7 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state) /* Object to be indexed is a Package */ if (index >= operand[0]->package.count) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Index value (%X%8.8X) beyond package end (%X)\n", - ACPI_FORMAT_UINT64(index), - operand[0]->package.count)); + ACPI_REPORT_ERROR(("Index value (%X%8.8X) beyond package end (%X)\n", ACPI_FORMAT_UINT64(index), operand[0]->package.count)); status = AE_AML_PACKAGE_LIMIT; goto cleanup; } @@ -405,10 +402,7 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state) /* Object to be indexed is a Buffer/String */ if (index >= operand[0]->buffer.length) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Index value (%X%8.8X) beyond end of buffer (%X)\n", - ACPI_FORMAT_UINT64(index), - operand[0]->buffer.length)); + ACPI_REPORT_ERROR(("Index value (%X%8.8X) beyond end of buffer (%X)\n", ACPI_FORMAT_UINT64(index), operand[0]->buffer.length)); status = AE_AML_BUFFER_LIMIT; goto cleanup; } @@ -440,7 +434,8 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state) default: - ACPI_REPORT_ERROR(("acpi_ex_opcode_2A_1T_1R: Unknown opcode %X\n", walk_state->opcode)); + ACPI_REPORT_ERROR(("Unknown AML opcode %X\n", + walk_state->opcode)); status = AE_AML_BAD_OPCODE; break; } @@ -544,7 +539,8 @@ acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state) default: - ACPI_REPORT_ERROR(("acpi_ex_opcode_2A_0T_1R: Unknown opcode %X\n", walk_state->opcode)); + ACPI_REPORT_ERROR(("Unknown AML opcode %X\n", + walk_state->opcode)); status = AE_AML_BAD_OPCODE; goto cleanup; } -- cgit v1.1 From b8e4d89357fc434618a59c1047cac72641191805 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 27 Jan 2006 16:43:00 -0500 Subject: [ACPI] ACPICA 20060127 Implemented support in the Resource Manager to allow unresolved namestring references within resource package objects for the _PRT method. This support is in addition to the previously implemented unresolved reference support within the AML parser. If the interpreter slack mode is enabled (true on Linux unless acpi=strict), these unresolved references will be passed through to the caller as a NULL package entry. http://bugzilla.kernel.org/show_bug.cgi?id=5741 Implemented and deployed new macros and functions for error and warning messages across the subsystem. These macros are simpler and generate less code than their predecessors. The new macros ACPI_ERROR, ACPI_EXCEPTION, ACPI_WARNING, and ACPI_INFO replace the ACPI_REPORT_* macros. Implemented the acpi_cpu_flags type to simplify host OS integration of the Acquire/Release Lock OSL interfaces. Suggested by Steven Rostedt and Andrew Morton. Fixed a problem where Alias ASL operators are sometimes not correctly resolved. causing AE_AML_INTERNAL http://bugzilla.kernel.org/show_bug.cgi?id=5189 http://bugzilla.kernel.org/show_bug.cgi?id=5674 Fixed several problems with the implementation of the ConcatenateResTemplate ASL operator. As per the ACPI specification, zero length buffers are now treated as a single EndTag. One-length buffers always cause a fatal exception. Non-zero length buffers that do not end with a full 2-byte EndTag cause a fatal exception. Fixed a possible structure overwrite in the AcpiGetObjectInfo external interface. (With assistance from Thomas Renninger) Signed-off-by: Bob Moore Signed-off-by: Len Brown --- drivers/acpi/executer/exoparg2.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'drivers/acpi/executer/exoparg2.c') diff --git a/drivers/acpi/executer/exoparg2.c b/drivers/acpi/executer/exoparg2.c index 7c59dda..e263a5d 100644 --- a/drivers/acpi/executer/exoparg2.c +++ b/drivers/acpi/executer/exoparg2.c @@ -111,7 +111,9 @@ acpi_status acpi_ex_opcode_2A_0T_0R(struct acpi_walk_state *walk_state) /* Are notifies allowed on this object? */ if (!acpi_ev_is_notify_object(node)) { - ACPI_REPORT_ERROR(("Unexpected notify object type [%s]\n", acpi_ut_get_type_name(node->type))); + ACPI_ERROR((AE_INFO, + "Unexpected notify object type [%s]", + acpi_ut_get_type_name(node->type))); status = AE_AML_OPERAND_TYPE; break; @@ -155,8 +157,8 @@ acpi_status acpi_ex_opcode_2A_0T_0R(struct acpi_walk_state *walk_state) default: - ACPI_REPORT_ERROR(("Unknown AML opcode %X\n", - walk_state->opcode)); + ACPI_ERROR((AE_INFO, "Unknown AML opcode %X", + walk_state->opcode)); status = AE_AML_BAD_OPCODE; } @@ -220,8 +222,8 @@ acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state) default: - ACPI_REPORT_ERROR(("Unknown AML opcode %X\n", - walk_state->opcode)); + ACPI_ERROR((AE_INFO, "Unknown AML opcode %X", + walk_state->opcode)); status = AE_AML_BAD_OPCODE; goto cleanup; } @@ -389,7 +391,10 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state) /* Object to be indexed is a Package */ if (index >= operand[0]->package.count) { - ACPI_REPORT_ERROR(("Index value (%X%8.8X) beyond package end (%X)\n", ACPI_FORMAT_UINT64(index), operand[0]->package.count)); + ACPI_ERROR((AE_INFO, + "Index value (%X%8.8X) beyond package end (%X)", + ACPI_FORMAT_UINT64(index), + operand[0]->package.count)); status = AE_AML_PACKAGE_LIMIT; goto cleanup; } @@ -402,7 +407,10 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state) /* Object to be indexed is a Buffer/String */ if (index >= operand[0]->buffer.length) { - ACPI_REPORT_ERROR(("Index value (%X%8.8X) beyond end of buffer (%X)\n", ACPI_FORMAT_UINT64(index), operand[0]->buffer.length)); + ACPI_ERROR((AE_INFO, + "Index value (%X%8.8X) beyond end of buffer (%X)", + ACPI_FORMAT_UINT64(index), + operand[0]->buffer.length)); status = AE_AML_BUFFER_LIMIT; goto cleanup; } @@ -434,8 +442,8 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state) default: - ACPI_REPORT_ERROR(("Unknown AML opcode %X\n", - walk_state->opcode)); + ACPI_ERROR((AE_INFO, "Unknown AML opcode %X", + walk_state->opcode)); status = AE_AML_BAD_OPCODE; break; } @@ -539,8 +547,8 @@ acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state) default: - ACPI_REPORT_ERROR(("Unknown AML opcode %X\n", - walk_state->opcode)); + ACPI_ERROR((AE_INFO, "Unknown AML opcode %X", + walk_state->opcode)); status = AE_AML_BAD_OPCODE; goto cleanup; } -- cgit v1.1