/*******************************************************************************1*2* Module Name: dsutils - Dispatcher utilities3*4******************************************************************************/56/*7* Copyright (C) 2000 - 2011, Intel Corp.8* All rights reserved.9*10* Redistribution and use in source and binary forms, with or without11* modification, are permitted provided that the following conditions12* are met:13* 1. Redistributions of source code must retain the above copyright14* notice, this list of conditions, and the following disclaimer,15* without modification.16* 2. Redistributions in binary form must reproduce at minimum a disclaimer17* substantially similar to the "NO WARRANTY" disclaimer below18* ("Disclaimer") and any redistribution must be conditioned upon19* including a substantially similar Disclaimer requirement for further20* binary redistribution.21* 3. Neither the names of the above-listed copyright holders nor the names22* of any contributors may be used to endorse or promote products derived23* from this software without specific prior written permission.24*25* Alternatively, this software may be distributed under the terms of the26* GNU General Public License ("GPL") version 2 as published by the Free27* Software Foundation.28*29* NO WARRANTY30* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS31* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT32* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR33* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT34* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL35* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS36* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)37* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,38* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING39* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE40* POSSIBILITY OF SUCH DAMAGES.41*/4243#include <acpi/acpi.h>44#include "accommon.h"45#include "acparser.h"46#include "amlcode.h"47#include "acdispat.h"48#include "acinterp.h"49#include "acnamesp.h"50#include "acdebug.h"5152#define _COMPONENT ACPI_DISPATCHER53ACPI_MODULE_NAME("dsutils")5455/*******************************************************************************56*57* FUNCTION: acpi_ds_clear_implicit_return58*59* PARAMETERS: walk_state - Current State60*61* RETURN: None.62*63* DESCRIPTION: Clear and remove a reference on an implicit return value. Used64* to delete "stale" return values (if enabled, the return value65* from every operator is saved at least momentarily, in case the66* parent method exits.)67*68******************************************************************************/69void acpi_ds_clear_implicit_return(struct acpi_walk_state *walk_state)70{71ACPI_FUNCTION_NAME(ds_clear_implicit_return);7273/*74* Slack must be enabled for this feature75*/76if (!acpi_gbl_enable_interpreter_slack) {77return;78}7980if (walk_state->implicit_return_obj) {81/*82* Delete any "stale" implicit return. However, in83* complex statements, the implicit return value can be84* bubbled up several levels.85*/86ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,87"Removing reference on stale implicit return obj %p\n",88walk_state->implicit_return_obj));8990acpi_ut_remove_reference(walk_state->implicit_return_obj);91walk_state->implicit_return_obj = NULL;92}93}9495#ifndef ACPI_NO_METHOD_EXECUTION96/*******************************************************************************97*98* FUNCTION: acpi_ds_do_implicit_return99*100* PARAMETERS: return_desc - The return value101* walk_state - Current State102* add_reference - True if a reference should be added to the103* return object104*105* RETURN: TRUE if implicit return enabled, FALSE otherwise106*107* DESCRIPTION: Implements the optional "implicit return". We save the result108* of every ASL operator and control method invocation in case the109* parent method exit. Before storing a new return value, we110* delete the previous return value.111*112******************************************************************************/113114u8115acpi_ds_do_implicit_return(union acpi_operand_object *return_desc,116struct acpi_walk_state *walk_state, u8 add_reference)117{118ACPI_FUNCTION_NAME(ds_do_implicit_return);119120/*121* Slack must be enabled for this feature, and we must122* have a valid return object123*/124if ((!acpi_gbl_enable_interpreter_slack) || (!return_desc)) {125return (FALSE);126}127128ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,129"Result %p will be implicitly returned; Prev=%p\n",130return_desc, walk_state->implicit_return_obj));131132/*133* Delete any "stale" implicit return value first. However, in134* complex statements, the implicit return value can be135* bubbled up several levels, so we don't clear the value if it136* is the same as the return_desc.137*/138if (walk_state->implicit_return_obj) {139if (walk_state->implicit_return_obj == return_desc) {140return (TRUE);141}142acpi_ds_clear_implicit_return(walk_state);143}144145/* Save the implicit return value, add a reference if requested */146147walk_state->implicit_return_obj = return_desc;148if (add_reference) {149acpi_ut_add_reference(return_desc);150}151152return (TRUE);153}154155/*******************************************************************************156*157* FUNCTION: acpi_ds_is_result_used158*159* PARAMETERS: Op - Current Op160* walk_state - Current State161*162* RETURN: TRUE if result is used, FALSE otherwise163*164* DESCRIPTION: Check if a result object will be used by the parent165*166******************************************************************************/167168u8169acpi_ds_is_result_used(union acpi_parse_object * op,170struct acpi_walk_state * walk_state)171{172const struct acpi_opcode_info *parent_info;173174ACPI_FUNCTION_TRACE_PTR(ds_is_result_used, op);175176/* Must have both an Op and a Result Object */177178if (!op) {179ACPI_ERROR((AE_INFO, "Null Op"));180return_UINT8(TRUE);181}182183/*184* We know that this operator is not a185* Return() operator (would not come here.) The following code is the186* optional support for a so-called "implicit return". Some AML code187* assumes that the last value of the method is "implicitly" returned188* to the caller. Just save the last result as the return value.189* NOTE: this is optional because the ASL language does not actually190* support this behavior.191*/192(void)acpi_ds_do_implicit_return(walk_state->result_obj, walk_state,193TRUE);194195/*196* Now determine if the parent will use the result197*198* If there is no parent, or the parent is a scope_op, we are executing199* at the method level. An executing method typically has no parent,200* since each method is parsed separately. A method invoked externally201* via execute_control_method has a scope_op as the parent.202*/203if ((!op->common.parent) ||204(op->common.parent->common.aml_opcode == AML_SCOPE_OP)) {205206/* No parent, the return value cannot possibly be used */207208ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,209"At Method level, result of [%s] not used\n",210acpi_ps_get_opcode_name(op->common.211aml_opcode)));212return_UINT8(FALSE);213}214215/* Get info on the parent. The root_op is AML_SCOPE */216217parent_info =218acpi_ps_get_opcode_info(op->common.parent->common.aml_opcode);219if (parent_info->class == AML_CLASS_UNKNOWN) {220ACPI_ERROR((AE_INFO, "Unknown parent opcode Op=%p", op));221return_UINT8(FALSE);222}223224/*225* Decide what to do with the result based on the parent. If226* the parent opcode will not use the result, delete the object.227* Otherwise leave it as is, it will be deleted when it is used228* as an operand later.229*/230switch (parent_info->class) {231case AML_CLASS_CONTROL:232233switch (op->common.parent->common.aml_opcode) {234case AML_RETURN_OP:235236/* Never delete the return value associated with a return opcode */237238goto result_used;239240case AML_IF_OP:241case AML_WHILE_OP:242243/*244* If we are executing the predicate AND this is the predicate op,245* we will use the return value246*/247if ((walk_state->control_state->common.state ==248ACPI_CONTROL_PREDICATE_EXECUTING)249&& (walk_state->control_state->control.250predicate_op == op)) {251goto result_used;252}253break;254255default:256/* Ignore other control opcodes */257break;258}259260/* The general control opcode returns no result */261262goto result_not_used;263264case AML_CLASS_CREATE:265266/*267* These opcodes allow term_arg(s) as operands and therefore268* the operands can be method calls. The result is used.269*/270goto result_used;271272case AML_CLASS_NAMED_OBJECT:273274if ((op->common.parent->common.aml_opcode == AML_REGION_OP) ||275(op->common.parent->common.aml_opcode == AML_DATA_REGION_OP)276|| (op->common.parent->common.aml_opcode == AML_PACKAGE_OP)277|| (op->common.parent->common.aml_opcode ==278AML_VAR_PACKAGE_OP)279|| (op->common.parent->common.aml_opcode == AML_BUFFER_OP)280|| (op->common.parent->common.aml_opcode ==281AML_INT_EVAL_SUBTREE_OP)282|| (op->common.parent->common.aml_opcode ==283AML_BANK_FIELD_OP)) {284/*285* These opcodes allow term_arg(s) as operands and therefore286* the operands can be method calls. The result is used.287*/288goto result_used;289}290291goto result_not_used;292293default:294295/*296* In all other cases. the parent will actually use the return297* object, so keep it.298*/299goto result_used;300}301302result_used:303ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,304"Result of [%s] used by Parent [%s] Op=%p\n",305acpi_ps_get_opcode_name(op->common.aml_opcode),306acpi_ps_get_opcode_name(op->common.parent->common.307aml_opcode), op));308309return_UINT8(TRUE);310311result_not_used:312ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,313"Result of [%s] not used by Parent [%s] Op=%p\n",314acpi_ps_get_opcode_name(op->common.aml_opcode),315acpi_ps_get_opcode_name(op->common.parent->common.316aml_opcode), op));317318return_UINT8(FALSE);319}320321/*******************************************************************************322*323* FUNCTION: acpi_ds_delete_result_if_not_used324*325* PARAMETERS: Op - Current parse Op326* result_obj - Result of the operation327* walk_state - Current state328*329* RETURN: Status330*331* DESCRIPTION: Used after interpretation of an opcode. If there is an internal332* result descriptor, check if the parent opcode will actually use333* this result. If not, delete the result now so that it will334* not become orphaned.335*336******************************************************************************/337338void339acpi_ds_delete_result_if_not_used(union acpi_parse_object *op,340union acpi_operand_object *result_obj,341struct acpi_walk_state *walk_state)342{343union acpi_operand_object *obj_desc;344acpi_status status;345346ACPI_FUNCTION_TRACE_PTR(ds_delete_result_if_not_used, result_obj);347348if (!op) {349ACPI_ERROR((AE_INFO, "Null Op"));350return_VOID;351}352353if (!result_obj) {354return_VOID;355}356357if (!acpi_ds_is_result_used(op, walk_state)) {358359/* Must pop the result stack (obj_desc should be equal to result_obj) */360361status = acpi_ds_result_pop(&obj_desc, walk_state);362if (ACPI_SUCCESS(status)) {363acpi_ut_remove_reference(result_obj);364}365}366367return_VOID;368}369370/*******************************************************************************371*372* FUNCTION: acpi_ds_resolve_operands373*374* PARAMETERS: walk_state - Current walk state with operands on stack375*376* RETURN: Status377*378* DESCRIPTION: Resolve all operands to their values. Used to prepare379* arguments to a control method invocation (a call from one380* method to another.)381*382******************************************************************************/383384acpi_status acpi_ds_resolve_operands(struct acpi_walk_state *walk_state)385{386u32 i;387acpi_status status = AE_OK;388389ACPI_FUNCTION_TRACE_PTR(ds_resolve_operands, walk_state);390391/*392* Attempt to resolve each of the valid operands393* Method arguments are passed by reference, not by value. This means394* that the actual objects are passed, not copies of the objects.395*/396for (i = 0; i < walk_state->num_operands; i++) {397status =398acpi_ex_resolve_to_value(&walk_state->operands[i],399walk_state);400if (ACPI_FAILURE(status)) {401break;402}403}404405return_ACPI_STATUS(status);406}407408/*******************************************************************************409*410* FUNCTION: acpi_ds_clear_operands411*412* PARAMETERS: walk_state - Current walk state with operands on stack413*414* RETURN: None415*416* DESCRIPTION: Clear all operands on the current walk state operand stack.417*418******************************************************************************/419420void acpi_ds_clear_operands(struct acpi_walk_state *walk_state)421{422u32 i;423424ACPI_FUNCTION_TRACE_PTR(ds_clear_operands, walk_state);425426/* Remove a reference on each operand on the stack */427428for (i = 0; i < walk_state->num_operands; i++) {429/*430* Remove a reference to all operands, including both431* "Arguments" and "Targets".432*/433acpi_ut_remove_reference(walk_state->operands[i]);434walk_state->operands[i] = NULL;435}436437walk_state->num_operands = 0;438return_VOID;439}440#endif441442/*******************************************************************************443*444* FUNCTION: acpi_ds_create_operand445*446* PARAMETERS: walk_state - Current walk state447* Arg - Parse object for the argument448* arg_index - Which argument (zero based)449*450* RETURN: Status451*452* DESCRIPTION: Translate a parse tree object that is an argument to an AML453* opcode to the equivalent interpreter object. This may include454* looking up a name or entering a new name into the internal455* namespace.456*457******************************************************************************/458459acpi_status460acpi_ds_create_operand(struct acpi_walk_state *walk_state,461union acpi_parse_object *arg, u32 arg_index)462{463acpi_status status = AE_OK;464char *name_string;465u32 name_length;466union acpi_operand_object *obj_desc;467union acpi_parse_object *parent_op;468u16 opcode;469acpi_interpreter_mode interpreter_mode;470const struct acpi_opcode_info *op_info;471472ACPI_FUNCTION_TRACE_PTR(ds_create_operand, arg);473474/* A valid name must be looked up in the namespace */475476if ((arg->common.aml_opcode == AML_INT_NAMEPATH_OP) &&477(arg->common.value.string) &&478!(arg->common.flags & ACPI_PARSEOP_IN_STACK)) {479ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "Getting a name: Arg=%p\n",480arg));481482/* Get the entire name string from the AML stream */483484status =485acpi_ex_get_name_string(ACPI_TYPE_ANY,486arg->common.value.buffer,487&name_string, &name_length);488489if (ACPI_FAILURE(status)) {490return_ACPI_STATUS(status);491}492493/* All prefixes have been handled, and the name is in name_string */494495/*496* Special handling for buffer_field declarations. This is a deferred497* opcode that unfortunately defines the field name as the last498* parameter instead of the first. We get here when we are performing499* the deferred execution, so the actual name of the field is already500* in the namespace. We don't want to attempt to look it up again501* because we may be executing in a different scope than where the502* actual opcode exists.503*/504if ((walk_state->deferred_node) &&505(walk_state->deferred_node->type == ACPI_TYPE_BUFFER_FIELD)506&& (arg_index ==507(u32) ((walk_state->opcode ==508AML_CREATE_FIELD_OP) ? 3 : 2))) {509obj_desc =510ACPI_CAST_PTR(union acpi_operand_object,511walk_state->deferred_node);512status = AE_OK;513} else { /* All other opcodes */514515/*516* Differentiate between a namespace "create" operation517* versus a "lookup" operation (IMODE_LOAD_PASS2 vs.518* IMODE_EXECUTE) in order to support the creation of519* namespace objects during the execution of control methods.520*/521parent_op = arg->common.parent;522op_info =523acpi_ps_get_opcode_info(parent_op->common.524aml_opcode);525if ((op_info->flags & AML_NSNODE)526&& (parent_op->common.aml_opcode !=527AML_INT_METHODCALL_OP)528&& (parent_op->common.aml_opcode != AML_REGION_OP)529&& (parent_op->common.aml_opcode !=530AML_INT_NAMEPATH_OP)) {531532/* Enter name into namespace if not found */533534interpreter_mode = ACPI_IMODE_LOAD_PASS2;535} else {536/* Return a failure if name not found */537538interpreter_mode = ACPI_IMODE_EXECUTE;539}540541status =542acpi_ns_lookup(walk_state->scope_info, name_string,543ACPI_TYPE_ANY, interpreter_mode,544ACPI_NS_SEARCH_PARENT |545ACPI_NS_DONT_OPEN_SCOPE, walk_state,546ACPI_CAST_INDIRECT_PTR(struct547acpi_namespace_node,548&obj_desc));549/*550* The only case where we pass through (ignore) a NOT_FOUND551* error is for the cond_ref_of opcode.552*/553if (status == AE_NOT_FOUND) {554if (parent_op->common.aml_opcode ==555AML_COND_REF_OF_OP) {556/*557* For the Conditional Reference op, it's OK if558* the name is not found; We just need a way to559* indicate this to the interpreter, set the560* object to the root561*/562obj_desc = ACPI_CAST_PTR(union563acpi_operand_object,564acpi_gbl_root_node);565status = AE_OK;566} else {567/*568* We just plain didn't find it -- which is a569* very serious error at this point570*/571status = AE_AML_NAME_NOT_FOUND;572}573}574575if (ACPI_FAILURE(status)) {576ACPI_ERROR_NAMESPACE(name_string, status);577}578}579580/* Free the namestring created above */581582ACPI_FREE(name_string);583584/* Check status from the lookup */585586if (ACPI_FAILURE(status)) {587return_ACPI_STATUS(status);588}589590/* Put the resulting object onto the current object stack */591592status = acpi_ds_obj_stack_push(obj_desc, walk_state);593if (ACPI_FAILURE(status)) {594return_ACPI_STATUS(status);595}596ACPI_DEBUGGER_EXEC(acpi_db_display_argument_object597(obj_desc, walk_state));598} else {599/* Check for null name case */600601if ((arg->common.aml_opcode == AML_INT_NAMEPATH_OP) &&602!(arg->common.flags & ACPI_PARSEOP_IN_STACK)) {603/*604* If the name is null, this means that this is an605* optional result parameter that was not specified606* in the original ASL. Create a Zero Constant for a607* placeholder. (Store to a constant is a Noop.)608*/609opcode = AML_ZERO_OP; /* Has no arguments! */610611ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,612"Null namepath: Arg=%p\n", arg));613} else {614opcode = arg->common.aml_opcode;615}616617/* Get the object type of the argument */618619op_info = acpi_ps_get_opcode_info(opcode);620if (op_info->object_type == ACPI_TYPE_INVALID) {621return_ACPI_STATUS(AE_NOT_IMPLEMENTED);622}623624if ((op_info->flags & AML_HAS_RETVAL)625|| (arg->common.flags & ACPI_PARSEOP_IN_STACK)) {626ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,627"Argument previously created, already stacked\n"));628629ACPI_DEBUGGER_EXEC(acpi_db_display_argument_object630(walk_state->631operands[walk_state->num_operands -6321], walk_state));633634/*635* Use value that was already previously returned636* by the evaluation of this argument637*/638status = acpi_ds_result_pop(&obj_desc, walk_state);639if (ACPI_FAILURE(status)) {640/*641* Only error is underflow, and this indicates642* a missing or null operand!643*/644ACPI_EXCEPTION((AE_INFO, status,645"Missing or null operand"));646return_ACPI_STATUS(status);647}648} else {649/* Create an ACPI_INTERNAL_OBJECT for the argument */650651obj_desc =652acpi_ut_create_internal_object(op_info->653object_type);654if (!obj_desc) {655return_ACPI_STATUS(AE_NO_MEMORY);656}657658/* Initialize the new object */659660status =661acpi_ds_init_object_from_op(walk_state, arg, opcode,662&obj_desc);663if (ACPI_FAILURE(status)) {664acpi_ut_delete_object_desc(obj_desc);665return_ACPI_STATUS(status);666}667}668669/* Put the operand object on the object stack */670671status = acpi_ds_obj_stack_push(obj_desc, walk_state);672if (ACPI_FAILURE(status)) {673return_ACPI_STATUS(status);674}675676ACPI_DEBUGGER_EXEC(acpi_db_display_argument_object677(obj_desc, walk_state));678}679680return_ACPI_STATUS(AE_OK);681}682683/*******************************************************************************684*685* FUNCTION: acpi_ds_create_operands686*687* PARAMETERS: walk_state - Current state688* first_arg - First argument of a parser argument tree689*690* RETURN: Status691*692* DESCRIPTION: Convert an operator's arguments from a parse tree format to693* namespace objects and place those argument object on the object694* stack in preparation for evaluation by the interpreter.695*696******************************************************************************/697698acpi_status699acpi_ds_create_operands(struct acpi_walk_state *walk_state,700union acpi_parse_object *first_arg)701{702acpi_status status = AE_OK;703union acpi_parse_object *arg;704union acpi_parse_object *arguments[ACPI_OBJ_NUM_OPERANDS];705u32 arg_count = 0;706u32 index = walk_state->num_operands;707u32 i;708709ACPI_FUNCTION_TRACE_PTR(ds_create_operands, first_arg);710711/* Get all arguments in the list */712713arg = first_arg;714while (arg) {715if (index >= ACPI_OBJ_NUM_OPERANDS) {716return_ACPI_STATUS(AE_BAD_DATA);717}718719arguments[index] = arg;720walk_state->operands[index] = NULL;721722/* Move on to next argument, if any */723724arg = arg->common.next;725arg_count++;726index++;727}728729index--;730731/* It is the appropriate order to get objects from the Result stack */732733for (i = 0; i < arg_count; i++) {734arg = arguments[index];735736/* Force the filling of the operand stack in inverse order */737738walk_state->operand_index = (u8) index;739740status = acpi_ds_create_operand(walk_state, arg, index);741if (ACPI_FAILURE(status)) {742goto cleanup;743}744745index--;746747ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,748"Arg #%u (%p) done, Arg1=%p\n", index, arg,749first_arg));750}751752return_ACPI_STATUS(status);753754cleanup:755/*756* We must undo everything done above; meaning that we must757* pop everything off of the operand stack and delete those758* objects759*/760acpi_ds_obj_stack_pop_and_delete(arg_count, walk_state);761762ACPI_EXCEPTION((AE_INFO, status, "While creating Arg %u", index));763return_ACPI_STATUS(status);764}765766/*****************************************************************************767*768* FUNCTION: acpi_ds_evaluate_name_path769*770* PARAMETERS: walk_state - Current state of the parse tree walk,771* the opcode of current operation should be772* AML_INT_NAMEPATH_OP773*774* RETURN: Status775*776* DESCRIPTION: Translate the -name_path- parse tree object to the equivalent777* interpreter object, convert it to value, if needed, duplicate778* it, if needed, and push it onto the current result stack.779*780****************************************************************************/781782acpi_status acpi_ds_evaluate_name_path(struct acpi_walk_state *walk_state)783{784acpi_status status = AE_OK;785union acpi_parse_object *op = walk_state->op;786union acpi_operand_object **operand = &walk_state->operands[0];787union acpi_operand_object *new_obj_desc;788u8 type;789790ACPI_FUNCTION_TRACE_PTR(ds_evaluate_name_path, walk_state);791792if (!op->common.parent) {793794/* This happens after certain exception processing */795796goto exit;797}798799if ((op->common.parent->common.aml_opcode == AML_PACKAGE_OP) ||800(op->common.parent->common.aml_opcode == AML_VAR_PACKAGE_OP) ||801(op->common.parent->common.aml_opcode == AML_REF_OF_OP)) {802803/* TBD: Should we specify this feature as a bit of op_info->Flags of these opcodes? */804805goto exit;806}807808status = acpi_ds_create_operand(walk_state, op, 0);809if (ACPI_FAILURE(status)) {810goto exit;811}812813if (op->common.flags & ACPI_PARSEOP_TARGET) {814new_obj_desc = *operand;815goto push_result;816}817818type = (*operand)->common.type;819820status = acpi_ex_resolve_to_value(operand, walk_state);821if (ACPI_FAILURE(status)) {822goto exit;823}824825if (type == ACPI_TYPE_INTEGER) {826827/* It was incremented by acpi_ex_resolve_to_value */828829acpi_ut_remove_reference(*operand);830831status =832acpi_ut_copy_iobject_to_iobject(*operand, &new_obj_desc,833walk_state);834if (ACPI_FAILURE(status)) {835goto exit;836}837} else {838/*839* The object either was anew created or is840* a Namespace node - don't decrement it.841*/842new_obj_desc = *operand;843}844845/* Cleanup for name-path operand */846847status = acpi_ds_obj_stack_pop(1, walk_state);848if (ACPI_FAILURE(status)) {849walk_state->result_obj = new_obj_desc;850goto exit;851}852853push_result:854855walk_state->result_obj = new_obj_desc;856857status = acpi_ds_result_push(walk_state->result_obj, walk_state);858if (ACPI_SUCCESS(status)) {859860/* Force to take it from stack */861862op->common.flags |= ACPI_PARSEOP_IN_STACK;863}864865exit:866867return_ACPI_STATUS(status);868}869870871