]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/parser/psparse.c
Merge branches 'release', 'acpica', 'bugzilla-10224', 'bugzilla-9772', 'bugzilla...
[linux-2.6-omap-h63xx.git] / drivers / acpi / parser / psparse.c
index 7ee2f2e7752515154e6c7bf2339af7bacc6c71ae..15e1702e48d606ad4313d547dafbc4b99b518d75 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2006, R. Byron Moore
+ * Copyright (C) 2000 - 2008, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -204,6 +204,8 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
                                AML_BUFFER_OP)
                            || (op->common.parent->common.aml_opcode ==
                                AML_PACKAGE_OP)
+                           || (op->common.parent->common.aml_opcode ==
+                               AML_BANK_FIELD_OP)
                            || (op->common.parent->common.aml_opcode ==
                                AML_VAR_PACKAGE_OP)) {
                                replacement_op =
@@ -349,19 +351,13 @@ acpi_ps_next_parse_state(struct acpi_walk_state *walk_state,
 
                parser_state->aml = walk_state->aml_last_while;
                walk_state->control_state->common.value = FALSE;
-               status = acpi_ds_result_stack_pop(walk_state);
-               if (ACPI_SUCCESS(status)) {
-                       status = AE_CTRL_BREAK;
-               }
+               status = AE_CTRL_BREAK;
                break;
 
        case AE_CTRL_CONTINUE:
 
                parser_state->aml = walk_state->aml_last_while;
-               status = acpi_ds_result_stack_pop(walk_state);
-               if (ACPI_SUCCESS(status)) {
-                       status = AE_CTRL_CONTINUE;
-               }
+               status = AE_CTRL_CONTINUE;
                break;
 
        case AE_CTRL_PENDING:
@@ -383,10 +379,7 @@ acpi_ps_next_parse_state(struct acpi_walk_state *walk_state,
                 * Just close out this package
                 */
                parser_state->aml = acpi_ps_get_next_package_end(parser_state);
-               status = acpi_ds_result_stack_pop(walk_state);
-               if (ACPI_SUCCESS(status)) {
-                       status = AE_CTRL_PENDING;
-               }
+               status = AE_CTRL_PENDING;
                break;
 
        case AE_CTRL_FALSE:
@@ -469,6 +462,16 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
        }
 
        walk_state->thread = thread;
+
+       /*
+        * If executing a method, the starting sync_level is this method's
+        * sync_level
+        */
+       if (walk_state->method_desc) {
+               walk_state->thread->current_sync_level =
+                   walk_state->method_desc->method.sync_level;
+       }
+
        acpi_ds_push_walk_state(walk_state, thread);
 
        /*
@@ -505,6 +508,10 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                        status =
                            acpi_ds_call_control_method(thread, walk_state,
                                                        NULL);
+                       if (ACPI_FAILURE(status)) {
+                               status =
+                                   acpi_ds_method_error(status, walk_state);
+                       }
 
                        /*
                         * If the transfer to the new method method call worked, a new walk
@@ -525,7 +532,12 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                        /* Check for possible multi-thread reentrancy problem */
 
                        if ((status == AE_ALREADY_EXISTS) &&
-                           (!walk_state->method_desc->method.semaphore)) {
+                           (!walk_state->method_desc->method.mutex)) {
+                               ACPI_INFO((AE_INFO,
+                                          "Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error",
+                                          walk_state->method_node->name.
+                                          ascii));
+
                                /*
                                 * Method tried to create an object twice. The probable cause is
                                 * that the method cannot handle reentrancy.
@@ -537,7 +549,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                                 */
                                walk_state->method_desc->method.method_flags |=
                                    AML_METHOD_SERIALIZED;
-                               walk_state->method_desc->method.concurrency = 1;
+                               walk_state->method_desc->method.sync_level = 0;
                        }
                }
 
@@ -582,6 +594,30 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                                 * The object is deleted
                                 */
                                if (!previous_walk_state->return_desc) {
+                                       /*
+                                        * In slack mode execution, if there is no return value
+                                        * we should implicitly return zero (0) as a default value.
+                                        */
+                                       if (acpi_gbl_enable_interpreter_slack &&
+                                           !previous_walk_state->
+                                           implicit_return_obj) {
+                                               previous_walk_state->
+                                                   implicit_return_obj =
+                                                   acpi_ut_create_internal_object
+                                                   (ACPI_TYPE_INTEGER);
+                                               if (!previous_walk_state->
+                                                   implicit_return_obj) {
+                                                       return_ACPI_STATUS
+                                                           (AE_NO_MEMORY);
+                                               }
+
+                                               previous_walk_state->
+                                                   implicit_return_obj->
+                                                   integer.value = 0;
+                                       }
+
+                                       /* Restart the calling control method */
+
                                        status =
                                            acpi_ds_restart_control_method
                                            (walk_state,