Path: blob/main/sys/contrib/dev/acpica/components/executer/exresop.c
48521 views
/******************************************************************************1*2* Module Name: exresop - AML Interpreter operand/object resolution3*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/amlcode.h>154#include <contrib/dev/acpica/include/acparser.h>155#include <contrib/dev/acpica/include/acinterp.h>156#include <contrib/dev/acpica/include/acnamesp.h>157158159#define _COMPONENT ACPI_EXECUTER160ACPI_MODULE_NAME ("exresop")161162/* Local prototypes */163164static ACPI_STATUS165AcpiExCheckObjectType (166ACPI_OBJECT_TYPE TypeNeeded,167ACPI_OBJECT_TYPE ThisType,168void *Object);169170171/*******************************************************************************172*173* FUNCTION: AcpiExCheckObjectType174*175* PARAMETERS: TypeNeeded Object type needed176* ThisType Actual object type177* Object Object pointer178*179* RETURN: Status180*181* DESCRIPTION: Check required type against actual type182*183******************************************************************************/184185static ACPI_STATUS186AcpiExCheckObjectType (187ACPI_OBJECT_TYPE TypeNeeded,188ACPI_OBJECT_TYPE ThisType,189void *Object)190{191ACPI_FUNCTION_ENTRY ();192193194if (TypeNeeded == ACPI_TYPE_ANY)195{196/* All types OK, so we don't perform any typechecks */197198return (AE_OK);199}200201if (TypeNeeded == ACPI_TYPE_LOCAL_REFERENCE)202{203/*204* Allow the AML "Constant" opcodes (Zero, One, etc.) to be reference205* objects and thus allow them to be targets. (As per the ACPI206* specification, a store to a constant is a noop.)207*/208if ((ThisType == ACPI_TYPE_INTEGER) &&209(((ACPI_OPERAND_OBJECT *) Object)->Common.Flags &210AOPOBJ_AML_CONSTANT))211{212return (AE_OK);213}214}215216if (TypeNeeded != ThisType)217{218ACPI_ERROR ((AE_INFO,219"Needed type [%s], found [%s] %p",220AcpiUtGetTypeName (TypeNeeded),221AcpiUtGetTypeName (ThisType), Object));222223return (AE_AML_OPERAND_TYPE);224}225226return (AE_OK);227}228229230/*******************************************************************************231*232* FUNCTION: AcpiExResolveOperands233*234* PARAMETERS: Opcode - Opcode being interpreted235* StackPtr - Pointer to the operand stack to be236* resolved237* WalkState - Current state238*239* RETURN: Status240*241* DESCRIPTION: Convert multiple input operands to the types required by the242* target operator.243*244* Each 5-bit group in ArgTypes represents one required245* operand and indicates the required Type. The corresponding operand246* will be converted to the required type if possible, otherwise we247* abort with an exception.248*249******************************************************************************/250251ACPI_STATUS252AcpiExResolveOperands (253UINT16 Opcode,254ACPI_OPERAND_OBJECT **StackPtr,255ACPI_WALK_STATE *WalkState)256{257ACPI_OPERAND_OBJECT *ObjDesc;258ACPI_STATUS Status = AE_OK;259UINT8 ObjectType;260UINT32 ArgTypes;261const ACPI_OPCODE_INFO *OpInfo;262UINT32 ThisArgType;263ACPI_OBJECT_TYPE TypeNeeded;264UINT16 TargetOp = 0;265266267ACPI_FUNCTION_TRACE_U32 (ExResolveOperands, Opcode);268269270OpInfo = AcpiPsGetOpcodeInfo (Opcode);271if (OpInfo->Class == AML_CLASS_UNKNOWN)272{273return_ACPI_STATUS (AE_AML_BAD_OPCODE);274}275276ArgTypes = OpInfo->RuntimeArgs;277if (ArgTypes == ARGI_INVALID_OPCODE)278{279ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",280Opcode));281282return_ACPI_STATUS (AE_AML_INTERNAL);283}284285ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,286"Opcode %X [%s] RequiredOperandTypes=%8.8X\n",287Opcode, OpInfo->Name, ArgTypes));288289/*290* Normal exit is with (ArgTypes == 0) at end of argument list.291* Function will return an exception from within the loop upon292* finding an entry which is not (or cannot be converted293* to) the required type; if stack underflows; or upon294* finding a NULL stack entry (which should not happen).295*/296while (GET_CURRENT_ARG_TYPE (ArgTypes))297{298if (!StackPtr || !*StackPtr)299{300ACPI_ERROR ((AE_INFO, "Null stack entry at %p",301StackPtr));302303return_ACPI_STATUS (AE_AML_INTERNAL);304}305306/* Extract useful items */307308ObjDesc = *StackPtr;309310/* Decode the descriptor type */311312switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))313{314case ACPI_DESC_TYPE_NAMED:315316/* Namespace Node */317318ObjectType = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;319320/*321* Resolve an alias object. The construction of these objects322* guarantees that there is only one level of alias indirection;323* thus, the attached object is always the aliased namespace node324*/325if (ObjectType == ACPI_TYPE_LOCAL_ALIAS)326{327ObjDesc = AcpiNsGetAttachedObject (328(ACPI_NAMESPACE_NODE *) ObjDesc);329*StackPtr = ObjDesc;330ObjectType = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;331}332break;333334case ACPI_DESC_TYPE_OPERAND:335336/* ACPI internal object */337338ObjectType = ObjDesc->Common.Type;339340/* Check for bad ACPI_OBJECT_TYPE */341342if (!AcpiUtValidObjectType (ObjectType))343{344ACPI_ERROR ((AE_INFO,345"Bad operand object type [0x%X]", ObjectType));346347return_ACPI_STATUS (AE_AML_OPERAND_TYPE);348}349350if (ObjectType == (UINT8) ACPI_TYPE_LOCAL_REFERENCE)351{352/* Validate the Reference */353354switch (ObjDesc->Reference.Class)355{356case ACPI_REFCLASS_DEBUG:357358TargetOp = AML_DEBUG_OP;359360ACPI_FALLTHROUGH;361362case ACPI_REFCLASS_ARG:363case ACPI_REFCLASS_LOCAL:364case ACPI_REFCLASS_INDEX:365case ACPI_REFCLASS_REFOF:366case ACPI_REFCLASS_TABLE: /* DdbHandle from LOAD_OP or LOAD_TABLE_OP */367case ACPI_REFCLASS_NAME: /* Reference to a named object */368369ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,370"Operand is a Reference, Class [%s] %2.2X\n",371AcpiUtGetReferenceName (ObjDesc),372ObjDesc->Reference.Class));373break;374375default:376377ACPI_ERROR ((AE_INFO,378"Unknown Reference Class 0x%2.2X in %p",379ObjDesc->Reference.Class, ObjDesc));380381return_ACPI_STATUS (AE_AML_OPERAND_TYPE);382}383}384break;385386default:387388/* Invalid descriptor */389390ACPI_ERROR ((AE_INFO, "Invalid descriptor %p [%s]",391ObjDesc, AcpiUtGetDescriptorName (ObjDesc)));392393return_ACPI_STATUS (AE_AML_OPERAND_TYPE);394}395396/* Get one argument type, point to the next */397398ThisArgType = GET_CURRENT_ARG_TYPE (ArgTypes);399INCREMENT_ARG_LIST (ArgTypes);400401/*402* Handle cases where the object does not need to be403* resolved to a value404*/405switch (ThisArgType)406{407case ARGI_REF_OR_STRING: /* Can be a String or Reference */408409if ((ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) ==410ACPI_DESC_TYPE_OPERAND) &&411(ObjDesc->Common.Type == ACPI_TYPE_STRING))412{413/*414* String found - the string references a named object and415* must be resolved to a node416*/417goto NextOperand;418}419420/*421* Else not a string - fall through to the normal Reference422* case below423*/424ACPI_FALLTHROUGH;425426case ARGI_REFERENCE: /* References: */427case ARGI_INTEGER_REF:428case ARGI_OBJECT_REF:429case ARGI_DEVICE_REF:430case ARGI_TARGETREF: /* Allows implicit conversion rules before store */431case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */432case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */433case ARGI_STORE_TARGET:434435/*436* Need an operand of type ACPI_TYPE_LOCAL_REFERENCE437* A Namespace Node is OK as-is438*/439if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED)440{441goto NextOperand;442}443444Status = AcpiExCheckObjectType (445ACPI_TYPE_LOCAL_REFERENCE, ObjectType, ObjDesc);446if (ACPI_FAILURE (Status))447{448return_ACPI_STATUS (Status);449}450goto NextOperand;451452case ARGI_DATAREFOBJ: /* Store operator only */453/*454* We don't want to resolve IndexOp reference objects during455* a store because this would be an implicit DeRefOf operation.456* Instead, we just want to store the reference object.457* -- All others must be resolved below.458*/459if ((Opcode == AML_STORE_OP) &&460((*StackPtr)->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&461((*StackPtr)->Reference.Class == ACPI_REFCLASS_INDEX))462{463goto NextOperand;464}465break;466467default:468469/* All cases covered above */470471break;472}473474/*475* Resolve this object to a value476*/477Status = AcpiExResolveToValue (StackPtr, WalkState);478if (ACPI_FAILURE (Status))479{480return_ACPI_STATUS (Status);481}482483/* Get the resolved object */484485ObjDesc = *StackPtr;486487/*488* Check the resulting object (value) type489*/490switch (ThisArgType)491{492/*493* For the simple cases, only one type of resolved object494* is allowed495*/496case ARGI_MUTEX:497498/* Need an operand of type ACPI_TYPE_MUTEX */499500TypeNeeded = ACPI_TYPE_MUTEX;501break;502503case ARGI_EVENT:504505/* Need an operand of type ACPI_TYPE_EVENT */506507TypeNeeded = ACPI_TYPE_EVENT;508break;509510case ARGI_PACKAGE: /* Package */511512/* Need an operand of type ACPI_TYPE_PACKAGE */513514TypeNeeded = ACPI_TYPE_PACKAGE;515break;516517case ARGI_ANYTYPE:518519/* Any operand type will do */520521TypeNeeded = ACPI_TYPE_ANY;522break;523524case ARGI_DDBHANDLE:525526/* Need an operand of type ACPI_TYPE_DDB_HANDLE */527528TypeNeeded = ACPI_TYPE_LOCAL_REFERENCE;529break;530531532/*533* The more complex cases allow multiple resolved object types534*/535case ARGI_INTEGER:536537/*538* Need an operand of type ACPI_TYPE_INTEGER, but we can539* implicitly convert from a STRING or BUFFER.540*541* Known as "Implicit Source Operand Conversion"542*/543Status = AcpiExConvertToInteger (ObjDesc, StackPtr,544ACPI_IMPLICIT_CONVERSION);545if (ACPI_FAILURE (Status))546{547if (Status == AE_TYPE)548{549ACPI_ERROR ((AE_INFO,550"Needed [Integer/String/Buffer], found [%s] %p",551AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));552553return_ACPI_STATUS (AE_AML_OPERAND_TYPE);554}555556return_ACPI_STATUS (Status);557}558559if (ObjDesc != *StackPtr)560{561AcpiUtRemoveReference (ObjDesc);562}563goto NextOperand;564565case ARGI_BUFFER:566/*567* Need an operand of type ACPI_TYPE_BUFFER,568* But we can implicitly convert from a STRING or INTEGER569* Aka - "Implicit Source Operand Conversion"570*/571Status = AcpiExConvertToBuffer (ObjDesc, StackPtr);572if (ACPI_FAILURE (Status))573{574if (Status == AE_TYPE)575{576ACPI_ERROR ((AE_INFO,577"Needed [Integer/String/Buffer], found [%s] %p",578AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));579580return_ACPI_STATUS (AE_AML_OPERAND_TYPE);581}582583return_ACPI_STATUS (Status);584}585586if (ObjDesc != *StackPtr)587{588AcpiUtRemoveReference (ObjDesc);589}590goto NextOperand;591592case ARGI_STRING:593/*594* Need an operand of type ACPI_TYPE_STRING,595* But we can implicitly convert from a BUFFER or INTEGER596* Aka - "Implicit Source Operand Conversion"597*/598Status = AcpiExConvertToString (599ObjDesc, StackPtr, ACPI_IMPLICIT_CONVERT_HEX);600if (ACPI_FAILURE (Status))601{602if (Status == AE_TYPE)603{604ACPI_ERROR ((AE_INFO,605"Needed [Integer/String/Buffer], found [%s] %p",606AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));607608return_ACPI_STATUS (AE_AML_OPERAND_TYPE);609}610611return_ACPI_STATUS (Status);612}613614if (ObjDesc != *StackPtr)615{616AcpiUtRemoveReference (ObjDesc);617}618goto NextOperand;619620case ARGI_COMPUTEDATA:621622/* Need an operand of type INTEGER, STRING or BUFFER */623624switch (ObjDesc->Common.Type)625{626case ACPI_TYPE_INTEGER:627case ACPI_TYPE_STRING:628case ACPI_TYPE_BUFFER:629630/* Valid operand */631break;632633default:634ACPI_ERROR ((AE_INFO,635"Needed [Integer/String/Buffer], found [%s] %p",636AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));637638return_ACPI_STATUS (AE_AML_OPERAND_TYPE);639}640goto NextOperand;641642case ARGI_BUFFER_OR_STRING:643644/* Need an operand of type STRING or BUFFER */645646switch (ObjDesc->Common.Type)647{648case ACPI_TYPE_STRING:649case ACPI_TYPE_BUFFER:650651/* Valid operand */652break;653654case ACPI_TYPE_INTEGER:655656/* Highest priority conversion is to type Buffer */657658Status = AcpiExConvertToBuffer (ObjDesc, StackPtr);659if (ACPI_FAILURE (Status))660{661return_ACPI_STATUS (Status);662}663664if (ObjDesc != *StackPtr)665{666AcpiUtRemoveReference (ObjDesc);667}668break;669670default:671ACPI_ERROR ((AE_INFO,672"Needed [Integer/String/Buffer], found [%s] %p",673AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));674675return_ACPI_STATUS (AE_AML_OPERAND_TYPE);676}677goto NextOperand;678679case ARGI_DATAOBJECT:680/*681* ARGI_DATAOBJECT is only used by the SizeOf operator.682* Need a buffer, string, package, or RefOf reference.683*684* The only reference allowed here is a direct reference to685* a namespace node.686*/687switch (ObjDesc->Common.Type)688{689case ACPI_TYPE_PACKAGE:690case ACPI_TYPE_STRING:691case ACPI_TYPE_BUFFER:692case ACPI_TYPE_LOCAL_REFERENCE:693694/* Valid operand */695break;696697default:698699ACPI_ERROR ((AE_INFO,700"Needed [Buffer/String/Package/Reference], found [%s] %p",701AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));702703return_ACPI_STATUS (AE_AML_OPERAND_TYPE);704}705goto NextOperand;706707case ARGI_COMPLEXOBJ:708709/* Need a buffer or package or (ACPI 2.0) String */710711switch (ObjDesc->Common.Type)712{713case ACPI_TYPE_PACKAGE:714case ACPI_TYPE_STRING:715case ACPI_TYPE_BUFFER:716717/* Valid operand */718break;719720default:721722ACPI_ERROR ((AE_INFO,723"Needed [Buffer/String/Package], found [%s] %p",724AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));725726return_ACPI_STATUS (AE_AML_OPERAND_TYPE);727}728goto NextOperand;729730case ARGI_REGION_OR_BUFFER: /* Used by Load() only */731732/*733* Need an operand of type REGION or a BUFFER734* (which could be a resolved region field)735*/736switch (ObjDesc->Common.Type)737{738case ACPI_TYPE_BUFFER:739case ACPI_TYPE_REGION:740741/* Valid operand */742break;743744default:745746ACPI_ERROR ((AE_INFO,747"Needed [Region/Buffer], found [%s] %p",748AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));749750return_ACPI_STATUS (AE_AML_OPERAND_TYPE);751}752goto NextOperand;753754case ARGI_DATAREFOBJ:755756/* Used by the Store() operator only */757758switch (ObjDesc->Common.Type)759{760case ACPI_TYPE_INTEGER:761case ACPI_TYPE_PACKAGE:762case ACPI_TYPE_STRING:763case ACPI_TYPE_BUFFER:764case ACPI_TYPE_BUFFER_FIELD:765case ACPI_TYPE_LOCAL_REFERENCE:766case ACPI_TYPE_LOCAL_REGION_FIELD:767case ACPI_TYPE_LOCAL_BANK_FIELD:768case ACPI_TYPE_LOCAL_INDEX_FIELD:769case ACPI_TYPE_DDB_HANDLE:770771/* Valid operand */772break;773774default:775776if (AcpiGbl_EnableInterpreterSlack)777{778/*779* Enable original behavior of Store(), allowing any780* and all objects as the source operand. The ACPI781* spec does not allow this, however.782*/783break;784}785786if (TargetOp == AML_DEBUG_OP)787{788/* Allow store of any object to the Debug object */789790break;791}792793ACPI_ERROR ((AE_INFO,794"Needed Integer/Buffer/String/Package/Ref/Ddb]"795", found [%s] %p",796AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));797798return_ACPI_STATUS (AE_AML_OPERAND_TYPE);799}800goto NextOperand;801802default:803804/* Unknown type */805806ACPI_ERROR ((AE_INFO,807"Internal - Unknown ARGI (required operand) type 0x%X",808ThisArgType));809810return_ACPI_STATUS (AE_BAD_PARAMETER);811}812813/*814* Make sure that the original object was resolved to the815* required object type (Simple cases only).816*/817Status = AcpiExCheckObjectType (818TypeNeeded, (*StackPtr)->Common.Type, *StackPtr);819if (ACPI_FAILURE (Status))820{821return_ACPI_STATUS (Status);822}823824NextOperand:825/*826* If more operands needed, decrement StackPtr to point827* to next operand on stack828*/829if (GET_CURRENT_ARG_TYPE (ArgTypes))830{831StackPtr--;832}833}834835ACPI_DUMP_OPERANDS (WalkState->Operands,836AcpiPsGetOpcodeName (Opcode), WalkState->NumOperands);837838return_ACPI_STATUS (Status);839}840841842