Path: blob/main/sys/contrib/dev/acpica/components/dispatcher/dswload.c
48521 views
/******************************************************************************1*2* Module Name: dswload - Dispatcher first pass namespace load callbacks3*4*****************************************************************************/56/******************************************************************************7*8* 1. Copyright Notice9*10* Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.11* All rights reserved.12*13* 2. License14*15* 2.1. This is your license from Intel Corp. under its intellectual property16* rights. You may have additional license terms from the party that provided17* you this software, covering your right to use that party's intellectual18* property rights.19*20* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a21* copy of the source code appearing in this file ("Covered Code") an22* irrevocable, perpetual, worldwide license under Intel's copyrights in the23* base code distributed originally by Intel ("Original Intel Code") to copy,24* make derivatives, distribute, use and display any portion of the Covered25* Code in any form, with the right to sublicense such rights; and26*27* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent28* license (with the right to sublicense), under only those claims of Intel29* patents that are infringed by the Original Intel Code, to make, use, sell,30* offer to sell, and import the Covered Code and derivative works thereof31* solely to the minimum extent necessary to exercise the above copyright32* license, and in no event shall the patent license extend to any additions33* to or modifications of the Original Intel Code. No other license or right34* is granted directly or by implication, estoppel or otherwise;35*36* The above copyright and patent license is granted only if the following37* conditions are met:38*39* 3. Conditions40*41* 3.1. Redistribution of Source with Rights to Further Distribute Source.42* Redistribution of source code of any substantial portion of the Covered43* Code or modification with rights to further distribute source must include44* the above Copyright Notice, the above License, this list of Conditions,45* and the following Disclaimer and Export Compliance provision. In addition,46* Licensee must cause all Covered Code to which Licensee contributes to47* contain a file documenting the changes Licensee made to create that Covered48* Code and the date of any change. Licensee must include in that file the49* documentation of any changes made by any predecessor Licensee. Licensee50* must include a prominent statement that the modification is derived,51* directly or indirectly, from Original Intel Code.52*53* 3.2. Redistribution of Source with no Rights to Further Distribute Source.54* Redistribution of source code of any substantial portion of the Covered55* Code or modification without rights to further distribute source must56* include the following Disclaimer and Export Compliance provision in the57* documentation and/or other materials provided with distribution. In58* addition, Licensee may not authorize further sublicense of source of any59* portion of the Covered Code, and must include terms to the effect that the60* license from Licensee to its licensee is limited to the intellectual61* property embodied in the software Licensee provides to its licensee, and62* not to intellectual property embodied in modifications its licensee may63* make.64*65* 3.3. Redistribution of Executable. Redistribution in executable form of any66* substantial portion of the Covered Code or modification must reproduce the67* above Copyright Notice, and the following Disclaimer and Export Compliance68* provision in the documentation and/or other materials provided with the69* distribution.70*71* 3.4. Intel retains all right, title, and interest in and to the Original72* Intel Code.73*74* 3.5. Neither the name Intel nor any other trademark owned or controlled by75* Intel shall be used in advertising or otherwise to promote the sale, use or76* other dealings in products derived from or relating to the Covered Code77* without prior written authorization from Intel.78*79* 4. Disclaimer and Export Compliance80*81* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED82* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE83* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,84* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY85* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY86* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A87* PARTICULAR PURPOSE.88*89* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES90* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR91* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,92* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY93* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL94* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS95* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY96* LIMITED REMEDY.97*98* 4.3. Licensee shall not export, either directly or indirectly, any of this99* software or system incorporating such software without first obtaining any100* required license or other approval from the U. S. Department of Commerce or101* any other agency or department of the United States Government. In the102* event Licensee exports any such software from the United States or103* re-exports any such software from a foreign destination, Licensee shall104* ensure that the distribution and export/re-export of the software is in105* compliance with all laws, regulations, orders, or other restrictions of the106* U.S. Export Administration Regulations. Licensee agrees that neither it nor107* any of its subsidiaries will export/re-export any technical data, process,108* software, or service, directly or indirectly, to any country for which the109* United States government or any agency thereof requires an export license,110* other governmental approval, or letter of assurance, without first obtaining111* such license, approval or letter.112*113*****************************************************************************114*115* Alternatively, you may choose to be licensed under the terms of the116* following license:117*118* Redistribution and use in source and binary forms, with or without119* modification, are permitted provided that the following conditions120* are met:121* 1. Redistributions of source code must retain the above copyright122* notice, this list of conditions, and the following disclaimer,123* without modification.124* 2. Redistributions in binary form must reproduce at minimum a disclaimer125* substantially similar to the "NO WARRANTY" disclaimer below126* ("Disclaimer") and any redistribution must be conditioned upon127* including a substantially similar Disclaimer requirement for further128* binary redistribution.129* 3. Neither the names of the above-listed copyright holders nor the names130* of any contributors may be used to endorse or promote products derived131* from this software without specific prior written permission.132*133* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS134* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT135* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR136* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT137* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,138* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT139* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,140* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY141* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT142* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE143* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.144*145* Alternatively, you may choose to be licensed under the terms of the146* GNU General Public License ("GPL") version 2 as published by the Free147* Software Foundation.148*149*****************************************************************************/150151#include <contrib/dev/acpica/include/acpi.h>152#include <contrib/dev/acpica/include/accommon.h>153#include <contrib/dev/acpica/include/acparser.h>154#include <contrib/dev/acpica/include/amlcode.h>155#include <contrib/dev/acpica/include/acdispat.h>156#include <contrib/dev/acpica/include/acinterp.h>157#include <contrib/dev/acpica/include/acnamesp.h>158#ifdef ACPI_ASL_COMPILER159#include <contrib/dev/acpica/include/acdisasm.h>160#endif161162#define _COMPONENT ACPI_DISPATCHER163ACPI_MODULE_NAME ("dswload")164165166/*******************************************************************************167*168* FUNCTION: AcpiDsInitCallbacks169*170* PARAMETERS: WalkState - Current state of the parse tree walk171* PassNumber - 1, 2, or 3172*173* RETURN: Status174*175* DESCRIPTION: Init walk state callbacks176*177******************************************************************************/178179ACPI_STATUS180AcpiDsInitCallbacks (181ACPI_WALK_STATE *WalkState,182UINT32 PassNumber)183{184185switch (PassNumber)186{187case 0:188189/* Parse only - caller will setup callbacks */190191WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 |192ACPI_PARSE_DELETE_TREE |193ACPI_PARSE_DISASSEMBLE;194WalkState->DescendingCallback = NULL;195WalkState->AscendingCallback = NULL;196break;197198case 1:199200/* Load pass 1 */201202WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 |203ACPI_PARSE_DELETE_TREE;204WalkState->DescendingCallback = AcpiDsLoad1BeginOp;205WalkState->AscendingCallback = AcpiDsLoad1EndOp;206break;207208case 2:209210/* Load pass 2 */211212WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 |213ACPI_PARSE_DELETE_TREE;214WalkState->DescendingCallback = AcpiDsLoad2BeginOp;215WalkState->AscendingCallback = AcpiDsLoad2EndOp;216break;217218case 3:219220/* Execution pass */221222WalkState->ParseFlags |= ACPI_PARSE_EXECUTE |223ACPI_PARSE_DELETE_TREE;224WalkState->DescendingCallback = AcpiDsExecBeginOp;225WalkState->AscendingCallback = AcpiDsExecEndOp;226break;227228default:229230return (AE_BAD_PARAMETER);231}232233return (AE_OK);234}235236237/*******************************************************************************238*239* FUNCTION: AcpiDsLoad1BeginOp240*241* PARAMETERS: WalkState - Current state of the parse tree walk242* OutOp - Where to return op if a new one is created243*244* RETURN: Status245*246* DESCRIPTION: Descending callback used during the loading of ACPI tables.247*248******************************************************************************/249250ACPI_STATUS251AcpiDsLoad1BeginOp (252ACPI_WALK_STATE *WalkState,253ACPI_PARSE_OBJECT **OutOp)254{255ACPI_PARSE_OBJECT *Op;256ACPI_NAMESPACE_NODE *Node;257ACPI_STATUS Status;258ACPI_OBJECT_TYPE ObjectType;259char *Path;260UINT32 Flags;261262263ACPI_FUNCTION_TRACE_PTR (DsLoad1BeginOp, WalkState->Op);264265266Op = WalkState->Op;267ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));268269/* We are only interested in opcodes that have an associated name */270271if (Op)272{273if (!(WalkState->OpInfo->Flags & AML_NAMED))274{275*OutOp = Op;276return_ACPI_STATUS (AE_OK);277}278279/* Check if this object has already been installed in the namespace */280281if (Op->Common.Node)282{283*OutOp = Op;284return_ACPI_STATUS (AE_OK);285}286}287288Path = AcpiPsGetNextNamestring (&WalkState->ParserState);289290/* Map the raw opcode into an internal object type */291292ObjectType = WalkState->OpInfo->ObjectType;293294ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,295"State=%p Op=%p [%s]\n", WalkState, Op,296AcpiUtGetTypeName (ObjectType)));297298switch (WalkState->Opcode)299{300case AML_SCOPE_OP:301/*302* The target name of the Scope() operator must exist at this point so303* that we can actually open the scope to enter new names underneath it.304* Allow search-to-root for single namesegs.305*/306Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,307ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &(Node));308#ifdef ACPI_ASL_COMPILER309if (Status == AE_NOT_FOUND)310{311/*312* Table disassembly:313* Target of Scope() not found. Generate an External for it, and314* insert the name into the namespace.315*/316AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0, 0);317Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,318ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,319WalkState, &Node);320}321#endif322if (ACPI_FAILURE (Status))323{324ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, Path, Status);325return_ACPI_STATUS (Status);326}327328/*329* Check to make sure that the target is330* one of the opcodes that actually opens a scope331*/332switch (Node->Type)333{334case ACPI_TYPE_ANY:335case ACPI_TYPE_LOCAL_SCOPE: /* Scope */336case ACPI_TYPE_DEVICE:337case ACPI_TYPE_POWER:338case ACPI_TYPE_PROCESSOR:339case ACPI_TYPE_THERMAL:340341/* These are acceptable types */342break;343344case ACPI_TYPE_INTEGER:345case ACPI_TYPE_STRING:346case ACPI_TYPE_BUFFER:347/*348* These types we will allow, but we will change the type.349* This enables some existing code of the form:350*351* Name (DEB, 0)352* Scope (DEB) { ... }353*354* Note: silently change the type here. On the second pass,355* we will report a warning356*/357ACPI_DEBUG_PRINT ((ACPI_DB_INFO,358"Type override - [%4.4s] had invalid type (%s) "359"for Scope operator, changed to type ANY\n",360AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type)));361362Node->Type = ACPI_TYPE_ANY;363WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY;364break;365366case ACPI_TYPE_METHOD:367/*368* Allow scope change to root during execution of module-level369* code. Root is typed METHOD during this time.370*/371if ((Node == AcpiGbl_RootNode) &&372(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))373{374break;375}376377ACPI_FALLTHROUGH;378379default:380381/* All other types are an error */382383ACPI_ERROR ((AE_INFO,384"Invalid type (%s) for target of "385"Scope operator [%4.4s] (Cannot override)",386AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node)));387388return_ACPI_STATUS (AE_AML_OPERAND_TYPE);389}390break;391392default:393/*394* For all other named opcodes, we will enter the name into395* the namespace.396*397* Setup the search flags.398* Since we are entering a name into the namespace, we do not want to399* enable the search-to-root upsearch.400*401* There are only two conditions where it is acceptable that the name402* already exists:403* 1) the Scope() operator can reopen a scoping object that was404* previously defined (Scope, Method, Device, etc.)405* 2) Whenever we are parsing a deferred opcode (OpRegion, Buffer,406* BufferField, or Package), the name of the object is already407* in the namespace.408*/409if (WalkState->DeferredNode)410{411/* This name is already in the namespace, get the node */412413Node = WalkState->DeferredNode;414Status = AE_OK;415break;416}417418/*419* If we are executing a method, do not create any namespace objects420* during the load phase, only during execution.421*/422if (WalkState->MethodNode)423{424Node = NULL;425Status = AE_OK;426break;427}428429Flags = ACPI_NS_NO_UPSEARCH;430if ((WalkState->Opcode != AML_SCOPE_OP) &&431(!(WalkState->ParseFlags & ACPI_PARSE_DEFERRED_OP)))432{433if (WalkState->NamespaceOverride)434{435Flags |= ACPI_NS_OVERRIDE_IF_FOUND;436ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Override allowed\n",437AcpiUtGetTypeName (ObjectType)));438}439else440{441Flags |= ACPI_NS_ERROR_IF_FOUND;442ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Cannot already exist\n",443AcpiUtGetTypeName (ObjectType)));444}445}446else447{448ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,449"[%s] Both Find or Create allowed\n",450AcpiUtGetTypeName (ObjectType)));451}452453/*454* Enter the named type into the internal namespace. We enter the name455* as we go downward in the parse tree. Any necessary subobjects that456* involve arguments to the opcode must be created as we go back up the457* parse tree later.458*/459Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,460ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node);461if (ACPI_FAILURE (Status))462{463if (Status == AE_ALREADY_EXISTS)464{465/* The name already exists in this scope */466467if (Node->Flags & ANOBJ_IS_EXTERNAL)468{469/*470* Allow one create on an object or segment that was471* previously declared External472*/473Node->Flags &= ~ANOBJ_IS_EXTERNAL;474Node->Type = (UINT8) ObjectType;475476/* Just retyped a node, probably will need to open a scope */477478if (AcpiNsOpensScope (ObjectType))479{480Status = AcpiDsScopeStackPush (481Node, ObjectType, WalkState);482if (ACPI_FAILURE (Status))483{484return_ACPI_STATUS (Status);485}486}487488Status = AE_OK;489}490}491492if (ACPI_FAILURE (Status))493{494ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, Path, Status);495return_ACPI_STATUS (Status);496}497}498break;499}500501/* Common exit */502503if (!Op)504{505/* Create a new op */506507Op = AcpiPsAllocOp (WalkState->Opcode, WalkState->Aml);508if (!Op)509{510return_ACPI_STATUS (AE_NO_MEMORY);511}512}513514/* Initialize the op */515516#ifdef ACPI_CONSTANT_EVAL_ONLY517Op->Named.Path = Path;518#endif519520if (Node)521{522/*523* Put the Node in the "op" object that the parser uses, so we524* can get it again quickly when this scope is closed525*/526Op->Common.Node = Node;527Op->Named.Name = Node->Name.Integer;528}529530AcpiPsAppendArg (AcpiPsGetParentScope (&WalkState->ParserState), Op);531*OutOp = Op;532return_ACPI_STATUS (Status);533}534535536/*******************************************************************************537*538* FUNCTION: AcpiDsLoad1EndOp539*540* PARAMETERS: WalkState - Current state of the parse tree walk541*542* RETURN: Status543*544* DESCRIPTION: Ascending callback used during the loading of the namespace,545* both control methods and everything else.546*547******************************************************************************/548549ACPI_STATUS550AcpiDsLoad1EndOp (551ACPI_WALK_STATE *WalkState)552{553ACPI_PARSE_OBJECT *Op;554ACPI_OBJECT_TYPE ObjectType;555ACPI_STATUS Status = AE_OK;556#ifdef ACPI_ASL_COMPILER557UINT8 ParamCount;558#endif559560561ACPI_FUNCTION_TRACE (DsLoad1EndOp);562563564Op = WalkState->Op;565ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));566567/*568* Disassembler: handle create field operators here.569*570* CreateBufferField is a deferred op that is typically processed in load571* pass 2. However, disassembly of control method contents walk the parse572* tree with ACPI_PARSE_LOAD_PASS1 and AML_CREATE operators are processed573* in a later walk. This is a problem when there is a control method that574* has the same name as the AML_CREATE object. In this case, any use of the575* name segment will be detected as a method call rather than a reference576* to a buffer field.577*578* This earlier creation during disassembly solves this issue by inserting579* the named object in the ACPI namespace so that references to this name580* would be a name string rather than a method call.581*/582if ((WalkState->ParseFlags & ACPI_PARSE_DISASSEMBLE) &&583(WalkState->OpInfo->Flags & AML_CREATE))584{585Status = AcpiDsCreateBufferField (Op, WalkState);586return_ACPI_STATUS (Status);587}588589/* We are only interested in opcodes that have an associated name */590591if (!(WalkState->OpInfo->Flags & (AML_NAMED | AML_FIELD)))592{593return_ACPI_STATUS (AE_OK);594}595596/* Get the object type to determine if we should pop the scope */597598ObjectType = WalkState->OpInfo->ObjectType;599600if (WalkState->OpInfo->Flags & AML_FIELD)601{602/*603* If we are executing a method, do not create any namespace objects604* during the load phase, only during execution.605*/606if (!WalkState->MethodNode)607{608if (WalkState->Opcode == AML_FIELD_OP ||609WalkState->Opcode == AML_BANK_FIELD_OP ||610WalkState->Opcode == AML_INDEX_FIELD_OP)611{612Status = AcpiDsInitFieldObjects (Op, WalkState);613}614}615return_ACPI_STATUS (Status);616}617618/*619* If we are executing a method, do not create any namespace objects620* during the load phase, only during execution.621*/622if (!WalkState->MethodNode)623{624if (Op->Common.AmlOpcode == AML_REGION_OP)625{626Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,627(ACPI_ADR_SPACE_TYPE)628((Op->Common.Value.Arg)->Common.Value.Integer),629WalkState);630if (ACPI_FAILURE (Status))631{632return_ACPI_STATUS (Status);633}634}635else if (Op->Common.AmlOpcode == AML_DATA_REGION_OP)636{637Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,638ACPI_ADR_SPACE_DATA_TABLE, WalkState);639if (ACPI_FAILURE (Status))640{641return_ACPI_STATUS (Status);642}643}644}645646if (Op->Common.AmlOpcode == AML_NAME_OP)647{648/* For Name opcode, get the object type from the argument */649650if (Op->Common.Value.Arg)651{652ObjectType = (AcpiPsGetOpcodeInfo (653(Op->Common.Value.Arg)->Common.AmlOpcode))->ObjectType;654655/* Set node type if we have a namespace node */656657if (Op->Common.Node)658{659Op->Common.Node->Type = (UINT8) ObjectType;660}661}662}663664#ifdef ACPI_ASL_COMPILER665/*666* For external opcode, get the object type from the argument and667* get the parameter count from the argument's next.668*/669if (AcpiGbl_DisasmFlag &&670Op->Common.Node &&671Op->Common.AmlOpcode == AML_EXTERNAL_OP)672{673/*674* Note, if this external is not a method675* Op->Common.Value.Arg->Common.Next->Common.Value.Integer == 0676* Therefore, ParamCount will be 0.677*/678ParamCount = (UINT8) Op->Common.Value.Arg->Common.Next->Common.Value.Integer;679ObjectType = (UINT8) Op->Common.Value.Arg->Common.Value.Integer;680Op->Common.Node->Flags |= ANOBJ_IS_EXTERNAL;681Op->Common.Node->Type = (UINT8) ObjectType;682683AcpiDmCreateSubobjectForExternal ((UINT8)ObjectType,684&Op->Common.Node, ParamCount);685686/*687* Add the external to the external list because we may be688* emitting code based off of the items within the external list.689*/690AcpiDmAddOpToExternalList (Op, Op->Named.Path, (UINT8)ObjectType, ParamCount,691ACPI_EXT_ORIGIN_FROM_OPCODE | ACPI_EXT_RESOLVED_REFERENCE);692}693#endif694695/*696* If we are executing a method, do not create any namespace objects697* during the load phase, only during execution.698*/699if (!WalkState->MethodNode)700{701if (Op->Common.AmlOpcode == AML_METHOD_OP)702{703/*704* MethodOp PkgLength NameString MethodFlags TermList705*706* Note: We must create the method node/object pair as soon as we707* see the method declaration. This allows later pass1 parsing708* of invocations of the method (need to know the number of709* arguments.)710*/711ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,712"LOADING-Method: State=%p Op=%p NamedObj=%p\n",713WalkState, Op, Op->Named.Node));714715if (!AcpiNsGetAttachedObject (Op->Named.Node))716{717WalkState->Operands[0] = ACPI_CAST_PTR (void, Op->Named.Node);718WalkState->NumOperands = 1;719720Status = AcpiDsCreateOperands (721WalkState, Op->Common.Value.Arg);722if (ACPI_SUCCESS (Status))723{724Status = AcpiExCreateMethod (Op->Named.Data,725Op->Named.Length, WalkState);726}727728WalkState->Operands[0] = NULL;729WalkState->NumOperands = 0;730731if (ACPI_FAILURE (Status))732{733return_ACPI_STATUS (Status);734}735}736}737}738739/* Pop the scope stack (only if loading a table) */740741if (!WalkState->MethodNode &&742Op->Common.AmlOpcode != AML_EXTERNAL_OP &&743AcpiNsOpensScope (ObjectType))744{745ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s): Popping scope for Op %p\n",746AcpiUtGetTypeName (ObjectType), Op));747748Status = AcpiDsScopeStackPop (WalkState);749}750751return_ACPI_STATUS (Status);752}753754755