aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/parser/psparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/parser/psparse.c')
-rw-r--r--drivers/acpi/parser/psparse.c45
1 files changed, 31 insertions, 14 deletions
diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c
index 5d63f48e56b5..15e1702e48d6 100644
--- a/drivers/acpi/parser/psparse.c
+++ b/drivers/acpi/parser/psparse.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -205,6 +205,8 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
205 || (op->common.parent->common.aml_opcode == 205 || (op->common.parent->common.aml_opcode ==
206 AML_PACKAGE_OP) 206 AML_PACKAGE_OP)
207 || (op->common.parent->common.aml_opcode == 207 || (op->common.parent->common.aml_opcode ==
208 AML_BANK_FIELD_OP)
209 || (op->common.parent->common.aml_opcode ==
208 AML_VAR_PACKAGE_OP)) { 210 AML_VAR_PACKAGE_OP)) {
209 replacement_op = 211 replacement_op =
210 acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP); 212 acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP);
@@ -349,19 +351,13 @@ acpi_ps_next_parse_state(struct acpi_walk_state *walk_state,
349 351
350 parser_state->aml = walk_state->aml_last_while; 352 parser_state->aml = walk_state->aml_last_while;
351 walk_state->control_state->common.value = FALSE; 353 walk_state->control_state->common.value = FALSE;
352 status = acpi_ds_result_stack_pop(walk_state); 354 status = AE_CTRL_BREAK;
353 if (ACPI_SUCCESS(status)) {
354 status = AE_CTRL_BREAK;
355 }
356 break; 355 break;
357 356
358 case AE_CTRL_CONTINUE: 357 case AE_CTRL_CONTINUE:
359 358
360 parser_state->aml = walk_state->aml_last_while; 359 parser_state->aml = walk_state->aml_last_while;
361 status = acpi_ds_result_stack_pop(walk_state); 360 status = AE_CTRL_CONTINUE;
362 if (ACPI_SUCCESS(status)) {
363 status = AE_CTRL_CONTINUE;
364 }
365 break; 361 break;
366 362
367 case AE_CTRL_PENDING: 363 case AE_CTRL_PENDING:
@@ -383,10 +379,7 @@ acpi_ps_next_parse_state(struct acpi_walk_state *walk_state,
383 * Just close out this package 379 * Just close out this package
384 */ 380 */
385 parser_state->aml = acpi_ps_get_next_package_end(parser_state); 381 parser_state->aml = acpi_ps_get_next_package_end(parser_state);
386 status = acpi_ds_result_stack_pop(walk_state); 382 status = AE_CTRL_PENDING;
387 if (ACPI_SUCCESS(status)) {
388 status = AE_CTRL_PENDING;
389 }
390 break; 383 break;
391 384
392 case AE_CTRL_FALSE: 385 case AE_CTRL_FALSE:
@@ -541,7 +534,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
541 if ((status == AE_ALREADY_EXISTS) && 534 if ((status == AE_ALREADY_EXISTS) &&
542 (!walk_state->method_desc->method.mutex)) { 535 (!walk_state->method_desc->method.mutex)) {
543 ACPI_INFO((AE_INFO, 536 ACPI_INFO((AE_INFO,
544 "Marking method %4.4s as Serialized", 537 "Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error",
545 walk_state->method_node->name. 538 walk_state->method_node->name.
546 ascii)); 539 ascii));
547 540
@@ -601,6 +594,30 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
601 * The object is deleted 594 * The object is deleted
602 */ 595 */
603 if (!previous_walk_state->return_desc) { 596 if (!previous_walk_state->return_desc) {
597 /*
598 * In slack mode execution, if there is no return value
599 * we should implicitly return zero (0) as a default value.
600 */
601 if (acpi_gbl_enable_interpreter_slack &&
602 !previous_walk_state->
603 implicit_return_obj) {
604 previous_walk_state->
605 implicit_return_obj =
606 acpi_ut_create_internal_object
607 (ACPI_TYPE_INTEGER);
608 if (!previous_walk_state->
609 implicit_return_obj) {
610 return_ACPI_STATUS
611 (AE_NO_MEMORY);
612 }
613
614 previous_walk_state->
615 implicit_return_obj->
616 integer.value = 0;
617 }
618
619 /* Restart the calling control method */
620
604 status = 621 status =
605 acpi_ds_restart_control_method 622 acpi_ds_restart_control_method
606 (walk_state, 623 (walk_state,