aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/dispatcher/dswload.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/dispatcher/dswload.c')
-rw-r--r--drivers/acpi/dispatcher/dswload.c63
1 files changed, 44 insertions, 19 deletions
diff --git a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c
index d11620018421..9100c0bda470 100644
--- a/drivers/acpi/dispatcher/dswload.c
+++ b/drivers/acpi/dispatcher/dswload.c
@@ -50,7 +50,7 @@
50#include <acpi/acnamesp.h> 50#include <acpi/acnamesp.h>
51#include <acpi/acevents.h> 51#include <acpi/acevents.h>
52 52
53#ifdef _ACPI_ASL_COMPILER 53#ifdef ACPI_ASL_COMPILER
54#include <acpi/acdisasm.h> 54#include <acpi/acdisasm.h>
55#endif 55#endif
56 56
@@ -145,15 +145,6 @@ acpi_ds_load1_begin_op (
145 145
146 if (op) { 146 if (op) {
147 if (!(walk_state->op_info->flags & AML_NAMED)) { 147 if (!(walk_state->op_info->flags & AML_NAMED)) {
148#if 0
149 if ((walk_state->op_info->class == AML_CLASS_EXECUTE) ||
150 (walk_state->op_info->class == AML_CLASS_CONTROL)) {
151 acpi_os_printf ("\n\n***EXECUTABLE OPCODE %s***\n\n",
152 walk_state->op_info->name);
153 *out_op = op;
154 return (AE_CTRL_SKIP);
155 }
156#endif
157 *out_op = op; 148 *out_op = op;
158 return (AE_OK); 149 return (AE_OK);
159 } 150 }
@@ -185,7 +176,7 @@ acpi_ds_load1_begin_op (
185 */ 176 */
186 status = acpi_ns_lookup (walk_state->scope_info, path, object_type, 177 status = acpi_ns_lookup (walk_state->scope_info, path, object_type,
187 ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node)); 178 ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
188#ifdef _ACPI_ASL_COMPILER 179#ifdef ACPI_ASL_COMPILER
189 if (status == AE_NOT_FOUND) { 180 if (status == AE_NOT_FOUND) {
190 /* 181 /*
191 * Table disassembly: 182 * Table disassembly:
@@ -486,11 +477,31 @@ acpi_ds_load2_begin_op (
486 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state)); 477 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state));
487 478
488 if (op) { 479 if (op) {
480 if ((walk_state->control_state) &&
481 (walk_state->control_state->common.state ==
482 ACPI_CONTROL_CONDITIONAL_EXECUTING)) {
483 /* We are executing a while loop outside of a method */
484
485 status = acpi_ds_exec_begin_op (walk_state, out_op);
486 return_ACPI_STATUS (status);
487 }
488
489 /* We only care about Namespace opcodes here */ 489 /* We only care about Namespace opcodes here */
490 490
491 if ((!(walk_state->op_info->flags & AML_NSOPCODE) && 491 if ((!(walk_state->op_info->flags & AML_NSOPCODE) &&
492 (walk_state->opcode != AML_INT_NAMEPATH_OP)) || 492 (walk_state->opcode != AML_INT_NAMEPATH_OP)) ||
493 (!(walk_state->op_info->flags & AML_NAMED))) { 493 (!(walk_state->op_info->flags & AML_NAMED))) {
494 if ((walk_state->op_info->class == AML_CLASS_EXECUTE) ||
495 (walk_state->op_info->class == AML_CLASS_CONTROL)) {
496 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
497 "Begin/EXEC: %s (fl %8.8X)\n", walk_state->op_info->name,
498 walk_state->op_info->flags));
499
500 /* Executing a type1 or type2 opcode outside of a method */
501
502 status = acpi_ds_exec_begin_op (walk_state, out_op);
503 return_ACPI_STATUS (status);
504 }
494 return_ACPI_STATUS (AE_OK); 505 return_ACPI_STATUS (AE_OK);
495 } 506 }
496 507
@@ -558,7 +569,7 @@ acpi_ds_load2_begin_op (
558 ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, 569 ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
559 walk_state, &(node)); 570 walk_state, &(node));
560 if (ACPI_FAILURE (status)) { 571 if (ACPI_FAILURE (status)) {
561#ifdef _ACPI_ASL_COMPILER 572#ifdef ACPI_ASL_COMPILER
562 if (status == AE_NOT_FOUND) { 573 if (status == AE_NOT_FOUND) {
563 status = AE_OK; 574 status = AE_OK;
564 } 575 }
@@ -651,8 +662,10 @@ acpi_ds_load2_begin_op (
651 break; 662 break;
652 } 663 }
653 664
665 /* Add new entry into namespace */
666
654 status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type, 667 status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type,
655 ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH, 668 ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH,
656 walk_state, &(node)); 669 walk_state, &(node));
657 break; 670 break;
658 } 671 }
@@ -662,7 +675,6 @@ acpi_ds_load2_begin_op (
662 return_ACPI_STATUS (status); 675 return_ACPI_STATUS (status);
663 } 676 }
664 677
665
666 if (!op) { 678 if (!op) {
667 /* Create a new op */ 679 /* Create a new op */
668 680
@@ -676,9 +688,7 @@ acpi_ds_load2_begin_op (
676 if (node) { 688 if (node) {
677 op->named.name = node->name.integer; 689 op->named.name = node->name.integer;
678 } 690 }
679 if (out_op) { 691 *out_op = op;
680 *out_op = op;
681 }
682 } 692 }
683 693
684 /* 694 /*
@@ -725,9 +735,24 @@ acpi_ds_load2_end_op (
725 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Opcode [%s] Op %p State %p\n", 735 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Opcode [%s] Op %p State %p\n",
726 walk_state->op_info->name, op, walk_state)); 736 walk_state->op_info->name, op, walk_state));
727 737
728 /* Only interested in opcodes that have namespace objects */ 738 /* Check if opcode had an associated namespace object */
729 739
730 if (!(walk_state->op_info->flags & AML_NSOBJECT)) { 740 if (!(walk_state->op_info->flags & AML_NSOBJECT)) {
741#ifndef ACPI_NO_METHOD_EXECUTION
742 /* No namespace object. Executable opcode? */
743
744 if ((walk_state->op_info->class == AML_CLASS_EXECUTE) ||
745 (walk_state->op_info->class == AML_CLASS_CONTROL)) {
746 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
747 "End/EXEC: %s (fl %8.8X)\n", walk_state->op_info->name,
748 walk_state->op_info->flags));
749
750 /* Executing a type1 or type2 opcode outside of a method */
751
752 status = acpi_ds_exec_end_op (walk_state);
753 return_ACPI_STATUS (status);
754 }
755#endif
731 return_ACPI_STATUS (AE_OK); 756 return_ACPI_STATUS (AE_OK);
732 } 757 }
733 758
@@ -736,7 +761,6 @@ acpi_ds_load2_end_op (
736 "Ending scope Op=%p State=%p\n", op, walk_state)); 761 "Ending scope Op=%p State=%p\n", op, walk_state));
737 } 762 }
738 763
739
740 object_type = walk_state->op_info->object_type; 764 object_type = walk_state->op_info->object_type;
741 765
742 /* 766 /*
@@ -959,6 +983,7 @@ acpi_ds_load2_end_op (
959 ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, 983 ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
960 walk_state, &(new_node)); 984 walk_state, &(new_node));
961 if (ACPI_SUCCESS (status)) { 985 if (ACPI_SUCCESS (status)) {
986
962 /* 987 /*
963 * Make sure that what we found is indeed a method 988 * Make sure that what we found is indeed a method
964 * We didn't search for a method on purpose, to see if the name 989 * We didn't search for a method on purpose, to see if the name