1 /******************************************************************************
3 * Module Name: dswload - Dispatcher namespace load callbacks
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2004, R. Byron Moore
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
45 #include <acpi/acpi.h>
46 #include <acpi/acparser.h>
47 #include <acpi/amlcode.h>
48 #include <acpi/acdispat.h>
49 #include <acpi/acinterp.h>
50 #include <acpi/acnamesp.h>
51 #include <acpi/acevents.h>
54 #define _COMPONENT ACPI_DISPATCHER
55 ACPI_MODULE_NAME ("dswload")
58 /*******************************************************************************
60 * FUNCTION: acpi_ds_init_callbacks
62 * PARAMETERS: walk_state - Current state of the parse tree walk
63 * pass_number - 1, 2, or 3
67 * DESCRIPTION: Init walk state callbacks
69 ******************************************************************************/
72 acpi_ds_init_callbacks (
73 struct acpi_walk_state *walk_state,
77 switch (pass_number) {
79 walk_state->parse_flags = ACPI_PARSE_LOAD_PASS1 | ACPI_PARSE_DELETE_TREE;
80 walk_state->descending_callback = acpi_ds_load1_begin_op;
81 walk_state->ascending_callback = acpi_ds_load1_end_op;
85 walk_state->parse_flags = ACPI_PARSE_LOAD_PASS1 | ACPI_PARSE_DELETE_TREE;
86 walk_state->descending_callback = acpi_ds_load2_begin_op;
87 walk_state->ascending_callback = acpi_ds_load2_end_op;
91 #ifndef ACPI_NO_METHOD_EXECUTION
92 walk_state->parse_flags |= ACPI_PARSE_EXECUTE | ACPI_PARSE_DELETE_TREE;
93 walk_state->descending_callback = acpi_ds_exec_begin_op;
94 walk_state->ascending_callback = acpi_ds_exec_end_op;
99 return (AE_BAD_PARAMETER);
106 /*******************************************************************************
108 * FUNCTION: acpi_ds_load1_begin_op
110 * PARAMETERS: walk_state - Current state of the parse tree walk
111 * Op - Op that has been just been reached in the
112 * walk; Arguments have not been evaluated yet.
116 * DESCRIPTION: Descending callback used during the loading of ACPI tables.
118 ******************************************************************************/
121 acpi_ds_load1_begin_op (
122 struct acpi_walk_state *walk_state,
123 union acpi_parse_object **out_op)
125 union acpi_parse_object *op;
126 struct acpi_namespace_node *node;
128 acpi_object_type object_type;
133 ACPI_FUNCTION_NAME ("ds_load1_begin_op");
137 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state));
139 /* We are only interested in opcodes that have an associated name */
142 if (!(walk_state->op_info->flags & AML_NAMED)) {
144 if ((walk_state->op_info->class == AML_CLASS_EXECUTE) ||
145 (walk_state->op_info->class == AML_CLASS_CONTROL)) {
146 acpi_os_printf ("\n\n***EXECUTABLE OPCODE %s***\n\n", walk_state->op_info->name);
148 return (AE_CTRL_SKIP);
155 /* Check if this object has already been installed in the namespace */
157 if (op->common.node) {
163 path = acpi_ps_get_next_namestring (&walk_state->parser_state);
165 /* Map the raw opcode into an internal object type */
167 object_type = walk_state->op_info->object_type;
169 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
170 "State=%p Op=%p [%s]\n", walk_state, op, acpi_ut_get_type_name (object_type)));
172 switch (walk_state->opcode) {
176 * The target name of the Scope() operator must exist at this point so
177 * that we can actually open the scope to enter new names underneath it.
178 * Allow search-to-root for single namesegs.
180 status = acpi_ns_lookup (walk_state->scope_info, path, object_type,
181 ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
182 if (ACPI_FAILURE (status)) {
183 ACPI_REPORT_NSERROR (path, status);
188 * Check to make sure that the target is
189 * one of the opcodes that actually opens a scope
191 switch (node->type) {
192 case ACPI_TYPE_LOCAL_SCOPE: /* Scope */
193 case ACPI_TYPE_DEVICE:
194 case ACPI_TYPE_POWER:
195 case ACPI_TYPE_PROCESSOR:
196 case ACPI_TYPE_THERMAL:
198 /* These are acceptable types */
201 case ACPI_TYPE_INTEGER:
202 case ACPI_TYPE_STRING:
203 case ACPI_TYPE_BUFFER:
206 * These types we will allow, but we will change the type. This
207 * enables some existing code of the form:
210 * Scope (DEB) { ... }
212 * Note: silently change the type here. On the second pass, we will report a warning
215 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n",
216 path, acpi_ut_get_type_name (node->type)));
218 node->type = ACPI_TYPE_ANY;
219 walk_state->scope_info->common.value = ACPI_TYPE_ANY;
224 /* All other types are an error */
226 ACPI_REPORT_ERROR (("Invalid type (%s) for target of Scope operator [%4.4s] (Cannot override)\n",
227 acpi_ut_get_type_name (node->type), path));
229 return (AE_AML_OPERAND_TYPE);
237 * For all other named opcodes, we will enter the name into the namespace.
239 * Setup the search flags.
240 * Since we are entering a name into the namespace, we do not want to
241 * enable the search-to-root upsearch.
243 * There are only two conditions where it is acceptable that the name
245 * 1) the Scope() operator can reopen a scoping object that was
246 * previously defined (Scope, Method, Device, etc.)
247 * 2) Whenever we are parsing a deferred opcode (op_region, Buffer,
248 * buffer_field, or Package), the name of the object is already
251 if (walk_state->deferred_node) {
252 /* This name is already in the namespace, get the node */
254 node = walk_state->deferred_node;
259 flags = ACPI_NS_NO_UPSEARCH;
260 if ((walk_state->opcode != AML_SCOPE_OP) &&
261 (!(walk_state->parse_flags & ACPI_PARSE_DEFERRED_OP))) {
262 flags |= ACPI_NS_ERROR_IF_FOUND;
263 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Cannot already exist\n",
264 acpi_ut_get_type_name (object_type)));
267 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Both Find or Create allowed\n",
268 acpi_ut_get_type_name (object_type)));
272 * Enter the named type into the internal namespace. We enter the name
273 * as we go downward in the parse tree. Any necessary subobjects that involve
274 * arguments to the opcode must be created as we go back up the parse tree later.
276 status = acpi_ns_lookup (walk_state->scope_info, path, object_type,
277 ACPI_IMODE_LOAD_PASS1, flags, walk_state, &(node));
278 if (ACPI_FAILURE (status)) {
279 ACPI_REPORT_NSERROR (path, status);
289 /* Create a new op */
291 op = acpi_ps_alloc_op (walk_state->opcode);
293 return (AE_NO_MEMORY);
299 op->named.name = node->name.integer;
301 #if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY))
302 op->named.path = (u8 *) path;
307 * Put the Node in the "op" object that the parser uses, so we
308 * can get it again quickly when this scope is closed
310 op->common.node = node;
311 acpi_ps_append_arg (acpi_ps_get_parent_scope (&walk_state->parser_state), op);
318 /*******************************************************************************
320 * FUNCTION: acpi_ds_load1_end_op
322 * PARAMETERS: walk_state - Current state of the parse tree walk
323 * Op - Op that has been just been completed in the
324 * walk; Arguments have now been evaluated.
328 * DESCRIPTION: Ascending callback used during the loading of the namespace,
329 * both control methods and everything else.
331 ******************************************************************************/
334 acpi_ds_load1_end_op (
335 struct acpi_walk_state *walk_state)
337 union acpi_parse_object *op;
338 acpi_object_type object_type;
339 acpi_status status = AE_OK;
342 ACPI_FUNCTION_NAME ("ds_load1_end_op");
346 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state));
348 /* We are only interested in opcodes that have an associated name */
350 if (!(walk_state->op_info->flags & (AML_NAMED | AML_FIELD))) {
354 /* Get the object type to determine if we should pop the scope */
356 object_type = walk_state->op_info->object_type;
358 #ifndef ACPI_NO_METHOD_EXECUTION
359 if (walk_state->op_info->flags & AML_FIELD) {
360 if (walk_state->opcode == AML_FIELD_OP ||
361 walk_state->opcode == AML_BANK_FIELD_OP ||
362 walk_state->opcode == AML_INDEX_FIELD_OP) {
363 status = acpi_ds_init_field_objects (op, walk_state);
369 if (op->common.aml_opcode == AML_REGION_OP) {
370 status = acpi_ex_create_region (op->named.data, op->named.length,
371 (acpi_adr_space_type) ((op->common.value.arg)->common.value.integer), walk_state);
372 if (ACPI_FAILURE (status)) {
378 if (op->common.aml_opcode == AML_NAME_OP) {
379 /* For Name opcode, get the object type from the argument */
381 if (op->common.value.arg) {
382 object_type = (acpi_ps_get_opcode_info ((op->common.value.arg)->common.aml_opcode))->object_type;
383 op->common.node->type = (u8) object_type;
387 if (op->common.aml_opcode == AML_METHOD_OP) {
389 * method_op pkg_length name_string method_flags term_list
391 * Note: We must create the method node/object pair as soon as we
392 * see the method declaration. This allows later pass1 parsing
393 * of invocations of the method (need to know the number of
396 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
397 "LOADING-Method: State=%p Op=%p named_obj=%p\n",
398 walk_state, op, op->named.node));
400 if (!acpi_ns_get_attached_object (op->named.node)) {
401 walk_state->operands[0] = (void *) op->named.node;
402 walk_state->num_operands = 1;
404 status = acpi_ds_create_operands (walk_state, op->common.value.arg);
405 if (ACPI_SUCCESS (status)) {
406 status = acpi_ex_create_method (op->named.data,
407 op->named.length, walk_state);
409 walk_state->operands[0] = NULL;
410 walk_state->num_operands = 0;
412 if (ACPI_FAILURE (status)) {
418 /* Pop the scope stack */
420 if (acpi_ns_opens_scope (object_type)) {
421 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s): Popping scope for Op %p\n",
422 acpi_ut_get_type_name (object_type), op));
424 status = acpi_ds_scope_stack_pop (walk_state);
431 /*******************************************************************************
433 * FUNCTION: acpi_ds_load2_begin_op
435 * PARAMETERS: walk_state - Current state of the parse tree walk
436 * Op - Op that has been just been reached in the
437 * walk; Arguments have not been evaluated yet.
441 * DESCRIPTION: Descending callback used during the loading of ACPI tables.
443 ******************************************************************************/
446 acpi_ds_load2_begin_op (
447 struct acpi_walk_state *walk_state,
448 union acpi_parse_object **out_op)
450 union acpi_parse_object *op;
451 struct acpi_namespace_node *node;
453 acpi_object_type object_type;
457 ACPI_FUNCTION_TRACE ("ds_load2_begin_op");
461 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state));
464 /* We only care about Namespace opcodes here */
466 if ((!(walk_state->op_info->flags & AML_NSOPCODE) && (walk_state->opcode != AML_INT_NAMEPATH_OP)) ||
467 (!(walk_state->op_info->flags & AML_NAMED))) {
468 return_ACPI_STATUS (AE_OK);
472 * Get the name we are going to enter or lookup in the namespace
474 if (walk_state->opcode == AML_INT_NAMEPATH_OP) {
475 /* For Namepath op, get the path string */
477 buffer_ptr = op->common.value.string;
479 /* No name, just exit */
481 return_ACPI_STATUS (AE_OK);
485 /* Get name from the op */
487 buffer_ptr = (char *) &op->named.name;
491 /* Get the namestring from the raw AML */
493 buffer_ptr = acpi_ps_get_next_namestring (&walk_state->parser_state);
496 /* Map the opcode into an internal object type */
498 object_type = walk_state->op_info->object_type;
500 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
501 "State=%p Op=%p Type=%X\n", walk_state, op, object_type));
504 switch (walk_state->opcode) {
506 case AML_BANK_FIELD_OP:
507 case AML_INDEX_FIELD_OP:
513 case AML_INT_NAMEPATH_OP:
516 * The name_path is an object reference to an existing object. Don't enter the
517 * name into the namespace, but look it up for use later
519 status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type,
520 ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
526 * The Path is an object reference to an existing object. Don't enter the
527 * name into the namespace, but look it up for use later
529 status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type,
530 ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
531 if (ACPI_FAILURE (status)) {
532 ACPI_REPORT_NSERROR (buffer_ptr, status);
533 return_ACPI_STATUS (status);
536 * We must check to make sure that the target is
537 * one of the opcodes that actually opens a scope
539 switch (node->type) {
540 case ACPI_TYPE_LOCAL_SCOPE: /* Scope */
541 case ACPI_TYPE_DEVICE:
542 case ACPI_TYPE_POWER:
543 case ACPI_TYPE_PROCESSOR:
544 case ACPI_TYPE_THERMAL:
546 /* These are acceptable types */
549 case ACPI_TYPE_INTEGER:
550 case ACPI_TYPE_STRING:
551 case ACPI_TYPE_BUFFER:
554 * These types we will allow, but we will change the type. This
555 * enables some existing code of the form:
558 * Scope (DEB) { ... }
561 ACPI_REPORT_WARNING (("Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n",
562 buffer_ptr, acpi_ut_get_type_name (node->type)));
564 node->type = ACPI_TYPE_ANY;
565 walk_state->scope_info->common.value = ACPI_TYPE_ANY;
570 /* All other types are an error */
572 ACPI_REPORT_ERROR (("Invalid type (%s) for target of Scope operator [%4.4s]\n",
573 acpi_ut_get_type_name (node->type), buffer_ptr));
575 return (AE_AML_OPERAND_TYPE);
581 /* All other opcodes */
583 if (op && op->common.node) {
584 /* This op/node was previously entered into the namespace */
586 node = op->common.node;
588 if (acpi_ns_opens_scope (object_type)) {
589 status = acpi_ds_scope_stack_push (node, object_type, walk_state);
590 if (ACPI_FAILURE (status)) {
591 return_ACPI_STATUS (status);
595 return_ACPI_STATUS (AE_OK);
599 * Enter the named type into the internal namespace. We enter the name
600 * as we go downward in the parse tree. Any necessary subobjects that involve
601 * arguments to the opcode must be created as we go back up the parse tree later.
603 * Note: Name may already exist if we are executing a deferred opcode.
605 if (walk_state->deferred_node) {
606 /* This name is already in the namespace, get the node */
608 node = walk_state->deferred_node;
613 status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type,
614 ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH, walk_state, &(node));
618 if (ACPI_FAILURE (status)) {
619 ACPI_REPORT_NSERROR (buffer_ptr, status);
620 return_ACPI_STATUS (status);
625 /* Create a new op */
627 op = acpi_ps_alloc_op (walk_state->opcode);
629 return_ACPI_STATUS (AE_NO_MEMORY);
632 /* Initialize the new op */
635 op->named.name = node->name.integer;
643 * Put the Node in the "op" object that the parser uses, so we
644 * can get it again quickly when this scope is closed
646 op->common.node = node;
648 return_ACPI_STATUS (status);
652 /*******************************************************************************
654 * FUNCTION: acpi_ds_load2_end_op
656 * PARAMETERS: walk_state - Current state of the parse tree walk
657 * Op - Op that has been just been completed in the
658 * walk; Arguments have now been evaluated.
662 * DESCRIPTION: Ascending callback used during the loading of the namespace,
663 * both control methods and everything else.
665 ******************************************************************************/
668 acpi_ds_load2_end_op (
669 struct acpi_walk_state *walk_state)
671 union acpi_parse_object *op;
672 acpi_status status = AE_OK;
673 acpi_object_type object_type;
674 struct acpi_namespace_node *node;
675 union acpi_parse_object *arg;
676 struct acpi_namespace_node *new_node;
677 #ifndef ACPI_NO_METHOD_EXECUTION
682 ACPI_FUNCTION_TRACE ("ds_load2_end_op");
685 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Opcode [%s] Op %p State %p\n",
686 walk_state->op_info->name, op, walk_state));
688 /* Only interested in opcodes that have namespace objects */
690 if (!(walk_state->op_info->flags & AML_NSOBJECT)) {
691 return_ACPI_STATUS (AE_OK);
694 if (op->common.aml_opcode == AML_SCOPE_OP) {
695 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
696 "Ending scope Op=%p State=%p\n", op, walk_state));
700 object_type = walk_state->op_info->object_type;
703 * Get the Node/name from the earlier lookup
704 * (It was saved in the *op structure)
706 node = op->common.node;
709 * Put the Node on the object stack (Contains the ACPI Name of
712 walk_state->operands[0] = (void *) node;
713 walk_state->num_operands = 1;
715 /* Pop the scope stack */
717 if (acpi_ns_opens_scope (object_type) && (op->common.aml_opcode != AML_INT_METHODCALL_OP)) {
718 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n",
719 acpi_ut_get_type_name (object_type), op));
721 status = acpi_ds_scope_stack_pop (walk_state);
722 if (ACPI_FAILURE (status)) {
728 * Named operations are as follows:
733 * AML_CREATEBYTEFIELD
734 * AML_CREATEDWORDFIELD
736 * AML_CREATEQWORDFIELD
737 * AML_CREATEWORDFIELD
755 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
756 "Create-Load [%s] State=%p Op=%p named_obj=%p\n",
757 acpi_ps_get_opcode_name (op->common.aml_opcode), walk_state, op, node));
759 /* Decode the opcode */
761 arg = op->common.value.arg;
763 switch (walk_state->op_info->type) {
764 #ifndef ACPI_NO_METHOD_EXECUTION
766 case AML_TYPE_CREATE_FIELD:
769 * Create the field object, but the field buffer and index must
770 * be evaluated later during the execution phase
772 status = acpi_ds_create_buffer_field (op, walk_state);
776 case AML_TYPE_NAMED_FIELD:
778 switch (op->common.aml_opcode) {
779 case AML_INDEX_FIELD_OP:
781 status = acpi_ds_create_index_field (op, (acpi_handle) arg->common.node,
785 case AML_BANK_FIELD_OP:
787 status = acpi_ds_create_bank_field (op, arg->common.node, walk_state);
792 status = acpi_ds_create_field (op, arg->common.node, walk_state);
796 /* All NAMED_FIELD opcodes must be handled above */
802 case AML_TYPE_NAMED_SIMPLE:
804 status = acpi_ds_create_operands (walk_state, arg);
805 if (ACPI_FAILURE (status)) {
809 switch (op->common.aml_opcode) {
810 case AML_PROCESSOR_OP:
812 status = acpi_ex_create_processor (walk_state);
815 case AML_POWER_RES_OP:
817 status = acpi_ex_create_power_resource (walk_state);
822 status = acpi_ex_create_mutex (walk_state);
827 status = acpi_ex_create_event (walk_state);
830 case AML_DATA_REGION_OP:
832 status = acpi_ex_create_table_region (walk_state);
837 status = acpi_ex_create_alias (walk_state);
847 /* Delete operands */
849 for (i = 1; i < walk_state->num_operands; i++) {
850 acpi_ut_remove_reference (walk_state->operands[i]);
851 walk_state->operands[i] = NULL;
855 #endif /* ACPI_NO_METHOD_EXECUTION */
857 case AML_TYPE_NAMED_COMPLEX:
859 switch (op->common.aml_opcode) {
860 #ifndef ACPI_NO_METHOD_EXECUTION
863 * The op_region is not fully parsed at this time. Only valid argument is the space_id.
864 * (We must save the address of the AML of the address and length operands)
867 * If we have a valid region, initialize it
868 * Namespace is NOT locked at this point.
870 status = acpi_ev_initialize_region (acpi_ns_get_attached_object (node), FALSE);
871 if (ACPI_FAILURE (status)) {
873 * If AE_NOT_EXIST is returned, it is not fatal
874 * because many regions get created before a handler
875 * is installed for said region.
877 if (AE_NOT_EXIST == status) {
886 status = acpi_ds_create_node (walk_state, node, op);
888 #endif /* ACPI_NO_METHOD_EXECUTION */
892 /* All NAMED_COMPLEX opcodes must be handled above */
893 /* Note: Method objects were already created in Pass 1 */
899 case AML_CLASS_INTERNAL:
901 /* case AML_INT_NAMEPATH_OP: */
905 case AML_CLASS_METHOD_CALL:
907 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
908 "RESOLVING-method_call: State=%p Op=%p named_obj=%p\n",
909 walk_state, op, node));
912 * Lookup the method name and save the Node
914 status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string,
915 ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS2,
916 ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
917 walk_state, &(new_node));
918 if (ACPI_SUCCESS (status)) {
920 * Make sure that what we found is indeed a method
921 * We didn't search for a method on purpose, to see if the name would resolve
923 if (new_node->type != ACPI_TYPE_METHOD) {
924 status = AE_AML_OPERAND_TYPE;
927 /* We could put the returned object (Node) on the object stack for later, but
928 * for now, we will put it in the "op" object that the parser uses, so we
929 * can get it again at the end of this scope
931 op->common.node = new_node;
934 ACPI_REPORT_NSERROR (arg->common.value.string, status);
945 /* Remove the Node pushed at the very beginning */
947 walk_state->operands[0] = NULL;
948 walk_state->num_operands = 0;
949 return_ACPI_STATUS (status);