From 52fc0b026e99b5d5d585095148d997d5634bbc25 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Mon, 2 Oct 2006 00:00:00 -0400 Subject: [ACPI] ACPICA 20060210 Removed a couple of extraneous ACPI_ERROR messages that appeared during normal execution. These became apparent after the conversion from ACPI_DEBUG_PRINT. Fixed a problem where the CreateField operator could hang if the BitIndex or NumBits parameter referred to a named object. From Valery Podrezov. http://bugzilla.kernel.org/show_bug.cgi?id=5359 Fixed a problem where a DeRefOf operation on a buffer object incorrectly failed with an exception. This also fixes a couple of related RefOf and DeRefOf issues. From Valery Podrezov. http://bugzilla.kernel.org/show_bug.cgi?id=5360 http://bugzilla.kernel.org/show_bug.cgi?id=5387 http://bugzilla.kernel.org/show_bug.cgi?id=5392 Fixed a problem where the AE_BUFFER_LIMIT exception was returned instead of AE_STRING_LIMIT on an out-of-bounds Index() operation. From Valery Podrezov. http://bugzilla.kernel.org/show_bug.cgi?id=5480 Implemented a memory cleanup at the end of the execution of each iteration of an AML While() loop, preventing the accumulation of outstanding objects. From Valery Podrezov. http://bugzilla.kernel.org/show_bug.cgi?id=5427 Eliminated a chunk of duplicate code in the object resolution code. From Valery Podrezov. http://bugzilla.kernel.org/show_bug.cgi?id=5336 Fixed several warnings during the 64-bit code generation. Signed-off-by: Bob Moore Signed-off-by: Len Brown --- drivers/acpi/parser/psparse.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/acpi/parser/psparse.c') diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c index a9f3229..83d8916 100644 --- a/drivers/acpi/parser/psparse.c +++ b/drivers/acpi/parser/psparse.c @@ -106,6 +106,7 @@ u16 acpi_ps_peek_opcode(struct acpi_parse_state * parser_state) opcode = (u16) ACPI_GET8(aml); if (opcode == AML_EXTENDED_OP_PREFIX) { + /* Extended opcode, get the second opcode byte */ aml++; @@ -158,6 +159,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, if (op->common.parent) { prev = op->common.parent->common.value.arg; if (!prev) { + /* Nothing more to do */ goto cleanup; @@ -245,6 +247,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, /* We must unlink this op from the parent tree */ if (prev == op) { + /* This op is the first in the list */ if (replacement_op) { @@ -265,6 +268,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, else while (prev) { + /* Traverse all siblings in the parent's argument list */ next = prev->common.next; @@ -510,6 +514,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) } else if (status == AE_CTRL_TERMINATE) { status = AE_OK; } else if ((status != AE_OK) && (walk_state->method_desc)) { + /* Either the method parse or actual execution failed */ ACPI_ERROR_METHOD("Method parse/execution failed", @@ -551,6 +556,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) if (((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) == ACPI_PARSE_EXECUTE) || (ACPI_FAILURE(status))) { if (walk_state->method_desc) { + /* Decrement the thread count on the method parse tree */ if (walk_state->method_desc->method. @@ -633,12 +639,14 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) } } else { if (previous_walk_state->return_desc) { + /* Caller doesn't want it, must delete it */ acpi_ut_remove_reference(previous_walk_state-> return_desc); } if (previous_walk_state->implicit_return_obj) { + /* Caller doesn't want it, must delete it */ acpi_ut_remove_reference(previous_walk_state-> -- cgit v1.1 From b229cf92eee616c7cb5ad8cdb35a19b119f00bc8 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 21 Apr 2006 17:15:00 -0400 Subject: ACPI: ACPICA 20060421 Removed a device initialization optimization introduced in 20051216 where the _STA method was not run unless an _INI was also present for the same device. This optimization could cause problems because it could allow _INI methods to be run within a not-present device subtree (If a not-present device had no _INI, _STA would not be run, the not-present status would not be discovered, and the children of the device would be incorrectly traversed.) Implemented a new _STA optimization where namespace subtrees that do not contain _INI are identified and ignored during device initialization. Selectively running _STA can significantly improve boot time on large machines (with assistance from Len Brown.) Implemented support for the device initialization case where the returned _STA flags indicate a device not-present but functioning. In this case, _INI is not run, but the device children are examined for presence, as per the ACPI specification. Implemented an additional change to the IndexField support in order to conform to MS behavior. The value written to the Index Register is not simply a byte offset, it is a byte offset in units of the access width of the parent Index Field. (Fiodor Suietov) Defined and deployed a new OSL interface, acpi_os_validate_address(). This interface is called during the creation of all AML operation regions, and allows the host OS to exert control over what addresses it will allow the AML code to access. Operation Regions whose addresses are disallowed will cause a runtime exception when they are actually accessed (will not affect or abort table loading.) Defined and deployed a new OSL interface, acpi_os_validate_interface(). This interface allows the host OS to match the various "optional" interface/behavior strings for the _OSI predefined control method as appropriate (with assistance from Bjorn Helgaas.) Restructured and corrected various problems in the exception handling code paths within DsCallControlMethod and DsTerminateControlMethod in dsmethod (with assistance from Takayoshi Kochi.) Modified the Linux source converter to ignore quoted string literals while converting identifiers from mixed to lower case. This will correct problems with the disassembler and other areas where such strings must not be modified. The ACPI_FUNCTION_* macros no longer require quotes around the function name. This allows the Linux source converter to convert the names, now that the converter ignores quoted strings. Signed-off-by: Bob Moore Signed-off-by: Len Brown --- drivers/acpi/parser/psparse.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'drivers/acpi/parser/psparse.c') diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c index 83d8916..796f6b7 100644 --- a/drivers/acpi/parser/psparse.c +++ b/drivers/acpi/parser/psparse.c @@ -138,7 +138,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, const struct acpi_opcode_info *parent_info; union acpi_parse_object *replacement_op = NULL; - ACPI_FUNCTION_TRACE_PTR("ps_complete_this_op", op); + ACPI_FUNCTION_TRACE_PTR(ps_complete_this_op, op); /* Check for null Op, can happen if AML code is corrupt */ @@ -333,7 +333,7 @@ acpi_ps_next_parse_state(struct acpi_walk_state *walk_state, struct acpi_parse_state *parser_state = &walk_state->parser_state; acpi_status status = AE_CTRL_PENDING; - ACPI_FUNCTION_TRACE_PTR("ps_next_parse_state", op); + ACPI_FUNCTION_TRACE_PTR(ps_next_parse_state, op); switch (callback_status) { case AE_CTRL_TERMINATE: @@ -453,10 +453,10 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) struct acpi_thread_state *prev_walk_list = acpi_gbl_current_walk_list; struct acpi_walk_state *previous_walk_state; - ACPI_FUNCTION_TRACE("ps_parse_aml"); + ACPI_FUNCTION_TRACE(ps_parse_aml); ACPI_DEBUG_PRINT((ACPI_DB_PARSE, - "Entered with walk_state=%p Aml=%p size=%X\n", + "Entered with WalkState=%p Aml=%p size=%X\n", walk_state, walk_state->parser_state.aml, walk_state->parser_state.aml_size)); @@ -555,21 +555,9 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) */ if (((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) == ACPI_PARSE_EXECUTE) || (ACPI_FAILURE(status))) { - if (walk_state->method_desc) { - - /* Decrement the thread count on the method parse tree */ - - if (walk_state->method_desc->method. - thread_count) { - walk_state->method_desc->method. - thread_count--; - } else { - ACPI_ERROR((AE_INFO, - "Invalid zero thread count in method")); - } - } - - acpi_ds_terminate_control_method(walk_state); + acpi_ds_terminate_control_method(walk_state-> + method_desc, + walk_state); } /* Delete this walk state and all linked control states */ @@ -578,7 +566,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) previous_walk_state = walk_state; ACPI_DEBUG_PRINT((ACPI_DB_PARSE, - "return_value=%p, implicit_value=%p State=%p\n", + "ReturnValue=%p, ImplicitValue=%p State=%p\n", walk_state->return_desc, walk_state->implicit_return_obj, walk_state)); -- cgit v1.1 From 4119532c95547821dbe72d6916dfa1b2148475b3 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 26 May 2006 16:36:00 -0400 Subject: ACPI: ACPICA 20060526 Restructured, flattened, and simplified the internal interfaces for namespace object evaluation - resulting in smaller code, less CPU stack use, and fewer interfaces. (With assistance from Mikhail Kouzmich) Fixed a problem with the CopyObject operator where the first parameter was not typed correctly for the parser, interpreter, compiler, and disassembler. Caused various errors and unexpected behavior. Fixed a problem where a ShiftLeft or ShiftRight of more than 64 bits produced incorrect results with some C compilers. Since the behavior of C compilers when the shift value is larger than the datatype width is apparently not well defined, the interpreter now detects this condition and simply returns zero as expected in all such cases. (BZ 395) Fixed problem reports (Valery Podrezov) integrated: - Update String-to-Integer conversion to match ACPI 3.0A spec http://bugzilla.kernel.org/show_bug.cgi?id=5329 Allow interpreter to handle nested method declarations http://bugzilla.kernel.org/show_bug.cgi?id=5361 Fixed problem reports (Fiodor Suietov) integrated: - acpi_terminate() doesn't free debug memory allocation list objects (BZ 355) - After Core Subsystem shutdown, acpi_subsystem_status() returns AE_OK (BZ 356) - acpi_os_unmap_memory() for RSDP can be invoked inconsistently (BZ 357) - Resource Manager should return AE_TYPE for non-device objects (BZ 358) - Incomplete cleanup branch in AcpiNsEvaluateRelative (BZ 359) - Use acpi_os_free() instead of ACPI_FREE in acpi_rs_set_srs_method_data (BZ 360) - Incomplete cleanup branch in acpi_ps_parse_aml (BZ 361) - Incomplete cleanup branch in acpi_ds_delete_walk_state (BZ 362) - acpi_get_table_header returns AE_NO_ACPI_TABLES until DSDT is loaded (BZ 365) - Status of the Global Initialization Handler call not used (BZ 366) - Incorrect object parameter to Global Initialization Handler (BZ 367) Signed-off-by: Bob Moore Signed-off-by: Len Brown --- drivers/acpi/parser/psparse.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/acpi/parser/psparse.c') diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c index 796f6b7..7ee2f2e 100644 --- a/drivers/acpi/parser/psparse.c +++ b/drivers/acpi/parser/psparse.c @@ -464,6 +464,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) thread = acpi_ut_create_thread_state(); if (!thread) { + acpi_ds_delete_walk_state(walk_state); return_ACPI_STATUS(AE_NO_MEMORY); } -- cgit v1.1