Back to home page

Quest Cross Reference

 
 

    


Warning, cross-references for /kernel/drivers/acpica/exresop.c need to be fixed.

0001 
0002 /******************************************************************************
0003  *
0004  * Module Name: exresop - AML Interpreter operand/object resolution
0005  *
0006  *****************************************************************************/
0007 
0008 /******************************************************************************
0009  *
0010  * 1. Copyright Notice
0011  *
0012  * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
0013  * All rights reserved.
0014  *
0015  * 2. License
0016  *
0017  * 2.1. This is your license from Intel Corp. under its intellectual property
0018  * rights.  You may have additional license terms from the party that provided
0019  * you this software, covering your right to use that party's intellectual
0020  * property rights.
0021  *
0022  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
0023  * copy of the source code appearing in this file ("Covered Code") an
0024  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
0025  * base code distributed originally by Intel ("Original Intel Code") to copy,
0026  * make derivatives, distribute, use and display any portion of the Covered
0027  * Code in any form, with the right to sublicense such rights; and
0028  *
0029  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
0030  * license (with the right to sublicense), under only those claims of Intel
0031  * patents that are infringed by the Original Intel Code, to make, use, sell,
0032  * offer to sell, and import the Covered Code and derivative works thereof
0033  * solely to the minimum extent necessary to exercise the above copyright
0034  * license, and in no event shall the patent license extend to any additions
0035  * to or modifications of the Original Intel Code.  No other license or right
0036  * is granted directly or by implication, estoppel or otherwise;
0037  *
0038  * The above copyright and patent license is granted only if the following
0039  * conditions are met:
0040  *
0041  * 3. Conditions
0042  *
0043  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
0044  * Redistribution of source code of any substantial portion of the Covered
0045  * Code or modification with rights to further distribute source must include
0046  * the above Copyright Notice, the above License, this list of Conditions,
0047  * and the following Disclaimer and Export Compliance provision.  In addition,
0048  * Licensee must cause all Covered Code to which Licensee contributes to
0049  * contain a file documenting the changes Licensee made to create that Covered
0050  * Code and the date of any change.  Licensee must include in that file the
0051  * documentation of any changes made by any predecessor Licensee.  Licensee
0052  * must include a prominent statement that the modification is derived,
0053  * directly or indirectly, from Original Intel Code.
0054  *
0055  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
0056  * Redistribution of source code of any substantial portion of the Covered
0057  * Code or modification without rights to further distribute source must
0058  * include the following Disclaimer and Export Compliance provision in the
0059  * documentation and/or other materials provided with distribution.  In
0060  * addition, Licensee may not authorize further sublicense of source of any
0061  * portion of the Covered Code, and must include terms to the effect that the
0062  * license from Licensee to its licensee is limited to the intellectual
0063  * property embodied in the software Licensee provides to its licensee, and
0064  * not to intellectual property embodied in modifications its licensee may
0065  * make.
0066  *
0067  * 3.3. Redistribution of Executable. Redistribution in executable form of any
0068  * substantial portion of the Covered Code or modification must reproduce the
0069  * above Copyright Notice, and the following Disclaimer and Export Compliance
0070  * provision in the documentation and/or other materials provided with the
0071  * distribution.
0072  *
0073  * 3.4. Intel retains all right, title, and interest in and to the Original
0074  * Intel Code.
0075  *
0076  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
0077  * Intel shall be used in advertising or otherwise to promote the sale, use or
0078  * other dealings in products derived from or relating to the Covered Code
0079  * without prior written authorization from Intel.
0080  *
0081  * 4. Disclaimer and Export Compliance
0082  *
0083  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
0084  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
0085  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
0086  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
0087  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
0088  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
0089  * PARTICULAR PURPOSE.
0090  *
0091  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
0092  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
0093  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
0094  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
0095  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
0096  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
0097  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
0098  * LIMITED REMEDY.
0099  *
0100  * 4.3. Licensee shall not export, either directly or indirectly, any of this
0101  * software or system incorporating such software without first obtaining any
0102  * required license or other approval from the U. S. Department of Commerce or
0103  * any other agency or department of the United States Government.  In the
0104  * event Licensee exports any such software from the United States or
0105  * re-exports any such software from a foreign destination, Licensee shall
0106  * ensure that the distribution and export/re-export of the software is in
0107  * compliance with all laws, regulations, orders, or other restrictions of the
0108  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
0109  * any of its subsidiaries will export/re-export any technical data, process,
0110  * software, or service, directly or indirectly, to any country for which the
0111  * United States government or any agency thereof requires an export license,
0112  * other governmental approval, or letter of assurance, without first obtaining
0113  * such license, approval or letter.
0114  *
0115  *****************************************************************************/
0116 
0117 #define __EXRESOP_C__
0118 
0119 #include "acpi.h"
0120 #include "accommon.h"
0121 #include "amlcode.h"
0122 #include "acparser.h"
0123 #include "acinterp.h"
0124 #include "acnamesp.h"
0125 
0126 
0127 #define _COMPONENT          ACPI_EXECUTER
0128         ACPI_MODULE_NAME    ("exresop")
0129 
0130 /* Local prototypes */
0131 
0132 static ACPI_STATUS
0133 AcpiExCheckObjectType (
0134     ACPI_OBJECT_TYPE        TypeNeeded,
0135     ACPI_OBJECT_TYPE        ThisType,
0136     void                    *Object);
0137 
0138 
0139 /*******************************************************************************
0140  *
0141  * FUNCTION:    AcpiExCheckObjectType
0142  *
0143  * PARAMETERS:  TypeNeeded          Object type needed
0144  *              ThisType            Actual object type
0145  *              Object              Object pointer
0146  *
0147  * RETURN:      Status
0148  *
0149  * DESCRIPTION: Check required type against actual type
0150  *
0151  ******************************************************************************/
0152 
0153 static ACPI_STATUS
0154 AcpiExCheckObjectType (
0155     ACPI_OBJECT_TYPE        TypeNeeded,
0156     ACPI_OBJECT_TYPE        ThisType,
0157     void                    *Object)
0158 {
0159     ACPI_FUNCTION_ENTRY ();
0160 
0161 
0162     if (TypeNeeded == ACPI_TYPE_ANY)
0163     {
0164         /* All types OK, so we don't perform any typechecks */
0165 
0166         return (AE_OK);
0167     }
0168 
0169     if (TypeNeeded == ACPI_TYPE_LOCAL_REFERENCE)
0170     {
0171         /*
0172          * Allow the AML "Constant" opcodes (Zero, One, etc.) to be reference
0173          * objects and thus allow them to be targets.  (As per the ACPI
0174          * specification, a store to a constant is a noop.)
0175          */
0176         if ((ThisType == ACPI_TYPE_INTEGER) &&
0177             (((ACPI_OPERAND_OBJECT *) Object)->Common.Flags & AOPOBJ_AML_CONSTANT))
0178         {
0179             return (AE_OK);
0180         }
0181     }
0182 
0183     if (TypeNeeded != ThisType)
0184     {
0185         ACPI_ERROR ((AE_INFO,
0186             "Needed type [%s], found [%s] %p",
0187             AcpiUtGetTypeName (TypeNeeded),
0188             AcpiUtGetTypeName (ThisType), Object));
0189 
0190         return (AE_AML_OPERAND_TYPE);
0191     }
0192 
0193     return (AE_OK);
0194 }
0195 
0196 
0197 /*******************************************************************************
0198  *
0199  * FUNCTION:    AcpiExResolveOperands
0200  *
0201  * PARAMETERS:  Opcode              - Opcode being interpreted
0202  *              StackPtr            - Pointer to the operand stack to be
0203  *                                    resolved
0204  *              WalkState           - Current state
0205  *
0206  * RETURN:      Status
0207  *
0208  * DESCRIPTION: Convert multiple input operands to the types required by the
0209  *              target operator.
0210  *
0211  *      Each 5-bit group in ArgTypes represents one required
0212  *      operand and indicates the required Type. The corresponding operand
0213  *      will be converted to the required type if possible, otherwise we
0214  *      abort with an exception.
0215  *
0216  ******************************************************************************/
0217 
0218 ACPI_STATUS
0219 AcpiExResolveOperands (
0220     UINT16                  Opcode,
0221     ACPI_OPERAND_OBJECT     **StackPtr,
0222     ACPI_WALK_STATE         *WalkState)
0223 {
0224     ACPI_OPERAND_OBJECT     *ObjDesc;
0225     ACPI_STATUS             Status = AE_OK;
0226     UINT8                   ObjectType;
0227     UINT32                  ArgTypes;
0228     const ACPI_OPCODE_INFO  *OpInfo;
0229     UINT32                  ThisArgType;
0230     ACPI_OBJECT_TYPE        TypeNeeded;
0231     UINT16                  TargetOp = 0;
0232 
0233 
0234     ACPI_FUNCTION_TRACE_U32 (ExResolveOperands, Opcode);
0235 
0236 
0237     OpInfo = AcpiPsGetOpcodeInfo (Opcode);
0238     if (OpInfo->Class == AML_CLASS_UNKNOWN)
0239     {
0240         return_ACPI_STATUS (AE_AML_BAD_OPCODE);
0241     }
0242 
0243     ArgTypes = OpInfo->RuntimeArgs;
0244     if (ArgTypes == ARGI_INVALID_OPCODE)
0245     {
0246         ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X",
0247             Opcode));
0248 
0249         return_ACPI_STATUS (AE_AML_INTERNAL);
0250     }
0251 
0252     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
0253         "Opcode %X [%s] RequiredOperandTypes=%8.8X\n",
0254         Opcode, OpInfo->Name, ArgTypes));
0255 
0256     /*
0257      * Normal exit is with (ArgTypes == 0) at end of argument list.
0258      * Function will return an exception from within the loop upon
0259      * finding an entry which is not (or cannot be converted
0260      * to) the required type; if stack underflows; or upon
0261      * finding a NULL stack entry (which should not happen).
0262      */
0263     while (GET_CURRENT_ARG_TYPE (ArgTypes))
0264     {
0265         if (!StackPtr || !*StackPtr)
0266         {
0267             ACPI_ERROR ((AE_INFO, "Null stack entry at %p",
0268                 StackPtr));
0269 
0270             return_ACPI_STATUS (AE_AML_INTERNAL);
0271         }
0272 
0273         /* Extract useful items */
0274 
0275         ObjDesc = *StackPtr;
0276 
0277         /* Decode the descriptor type */
0278 
0279         switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
0280         {
0281         case ACPI_DESC_TYPE_NAMED:
0282 
0283             /* Namespace Node */
0284 
0285             ObjectType = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;
0286 
0287             /*
0288              * Resolve an alias object. The construction of these objects
0289              * guarantees that there is only one level of alias indirection;
0290              * thus, the attached object is always the aliased namespace node
0291              */
0292             if (ObjectType == ACPI_TYPE_LOCAL_ALIAS)
0293             {
0294                 ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc);
0295                 *StackPtr = ObjDesc;
0296                 ObjectType = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;
0297             }
0298             break;
0299 
0300 
0301         case ACPI_DESC_TYPE_OPERAND:
0302 
0303             /* ACPI internal object */
0304 
0305             ObjectType = ObjDesc->Common.Type;
0306 
0307             /* Check for bad ACPI_OBJECT_TYPE */
0308 
0309             if (!AcpiUtValidObjectType (ObjectType))
0310             {
0311                 ACPI_ERROR ((AE_INFO,
0312                     "Bad operand object type [%X]", ObjectType));
0313 
0314                 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
0315             }
0316 
0317             if (ObjectType == (UINT8) ACPI_TYPE_LOCAL_REFERENCE)
0318             {
0319                 /* Validate the Reference */
0320 
0321                 switch (ObjDesc->Reference.Class)
0322                 {
0323                 case ACPI_REFCLASS_DEBUG:
0324 
0325                     TargetOp = AML_DEBUG_OP;
0326 
0327                     /*lint -fallthrough */
0328 
0329                 case ACPI_REFCLASS_ARG:
0330                 case ACPI_REFCLASS_LOCAL:
0331                 case ACPI_REFCLASS_INDEX:
0332                 case ACPI_REFCLASS_REFOF:
0333                 case ACPI_REFCLASS_TABLE:    /* DdbHandle from LOAD_OP or LOAD_TABLE_OP */
0334                 case ACPI_REFCLASS_NAME:     /* Reference to a named object */
0335 
0336                     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
0337                         "Operand is a Reference, Class [%s] %2.2X\n",
0338                         AcpiUtGetReferenceName (ObjDesc),
0339                         ObjDesc->Reference.Class));
0340                     break;
0341 
0342                 default:
0343 
0344                     ACPI_ERROR ((AE_INFO,
0345                         "Unknown Reference Class %2.2X in %p",
0346                         ObjDesc->Reference.Class, ObjDesc));
0347 
0348                     return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
0349                 }
0350             }
0351             break;
0352 
0353 
0354         default:
0355 
0356             /* Invalid descriptor */
0357 
0358             ACPI_ERROR ((AE_INFO, "Invalid descriptor %p [%s]",
0359                 ObjDesc, AcpiUtGetDescriptorName (ObjDesc)));
0360 
0361             return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
0362         }
0363 
0364         /* Get one argument type, point to the next */
0365 
0366         ThisArgType = GET_CURRENT_ARG_TYPE (ArgTypes);
0367         INCREMENT_ARG_LIST (ArgTypes);
0368 
0369         /*
0370          * Handle cases where the object does not need to be
0371          * resolved to a value
0372          */
0373         switch (ThisArgType)
0374         {
0375         case ARGI_REF_OR_STRING:        /* Can be a String or Reference */
0376 
0377             if ((ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND) &&
0378                 (ObjDesc->Common.Type == ACPI_TYPE_STRING))
0379             {
0380                 /*
0381                  * String found - the string references a named object and
0382                  * must be resolved to a node
0383                  */
0384                 goto NextOperand;
0385             }
0386 
0387             /*
0388              * Else not a string - fall through to the normal Reference
0389              * case below
0390              */
0391             /*lint -fallthrough */
0392 
0393         case ARGI_REFERENCE:            /* References: */
0394         case ARGI_INTEGER_REF:
0395         case ARGI_OBJECT_REF:
0396         case ARGI_DEVICE_REF:
0397         case ARGI_TARGETREF:     /* Allows implicit conversion rules before store */
0398         case ARGI_FIXED_TARGET:  /* No implicit conversion before store to target */
0399         case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion  */
0400 
0401             /*
0402              * Need an operand of type ACPI_TYPE_LOCAL_REFERENCE
0403              * A Namespace Node is OK as-is
0404              */
0405             if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED)
0406             {
0407                 goto NextOperand;
0408             }
0409 
0410             Status = AcpiExCheckObjectType (ACPI_TYPE_LOCAL_REFERENCE,
0411                             ObjectType, ObjDesc);
0412             if (ACPI_FAILURE (Status))
0413             {
0414                 return_ACPI_STATUS (Status);
0415             }
0416             goto NextOperand;
0417 
0418 
0419         case ARGI_DATAREFOBJ:  /* Store operator only */
0420 
0421             /*
0422              * We don't want to resolve IndexOp reference objects during
0423              * a store because this would be an implicit DeRefOf operation.
0424              * Instead, we just want to store the reference object.
0425              * -- All others must be resolved below.
0426              */
0427             if ((Opcode == AML_STORE_OP) &&
0428                 ((*StackPtr)->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
0429                 ((*StackPtr)->Reference.Class == ACPI_REFCLASS_INDEX))
0430             {
0431                 goto NextOperand;
0432             }
0433             break;
0434 
0435         default:
0436             /* All cases covered above */
0437             break;
0438         }
0439 
0440         /*
0441          * Resolve this object to a value
0442          */
0443         Status = AcpiExResolveToValue (StackPtr, WalkState);
0444         if (ACPI_FAILURE (Status))
0445         {
0446             return_ACPI_STATUS (Status);
0447         }
0448 
0449         /* Get the resolved object */
0450 
0451         ObjDesc = *StackPtr;
0452 
0453         /*
0454          * Check the resulting object (value) type
0455          */
0456         switch (ThisArgType)
0457         {
0458         /*
0459          * For the simple cases, only one type of resolved object
0460          * is allowed
0461          */
0462         case ARGI_MUTEX:
0463 
0464             /* Need an operand of type ACPI_TYPE_MUTEX */
0465 
0466             TypeNeeded = ACPI_TYPE_MUTEX;
0467             break;
0468 
0469         case ARGI_EVENT:
0470 
0471             /* Need an operand of type ACPI_TYPE_EVENT */
0472 
0473             TypeNeeded = ACPI_TYPE_EVENT;
0474             break;
0475 
0476         case ARGI_PACKAGE:   /* Package */
0477 
0478             /* Need an operand of type ACPI_TYPE_PACKAGE */
0479 
0480             TypeNeeded = ACPI_TYPE_PACKAGE;
0481             break;
0482 
0483         case ARGI_ANYTYPE:
0484 
0485             /* Any operand type will do */
0486 
0487             TypeNeeded = ACPI_TYPE_ANY;
0488             break;
0489 
0490         case ARGI_DDBHANDLE:
0491 
0492             /* Need an operand of type ACPI_TYPE_DDB_HANDLE */
0493 
0494             TypeNeeded = ACPI_TYPE_LOCAL_REFERENCE;
0495             break;
0496 
0497 
0498         /*
0499          * The more complex cases allow multiple resolved object types
0500          */
0501         case ARGI_INTEGER:
0502 
0503             /*
0504              * Need an operand of type ACPI_TYPE_INTEGER,
0505              * But we can implicitly convert from a STRING or BUFFER
0506              * Aka - "Implicit Source Operand Conversion"
0507              */
0508             Status = AcpiExConvertToInteger (ObjDesc, StackPtr, 16);
0509             if (ACPI_FAILURE (Status))
0510             {
0511                 if (Status == AE_TYPE)
0512                 {
0513                     ACPI_ERROR ((AE_INFO,
0514                         "Needed [Integer/String/Buffer], found [%s] %p",
0515                         AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
0516 
0517                     return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
0518                 }
0519 
0520                 return_ACPI_STATUS (Status);
0521             }
0522 
0523             if (ObjDesc != *StackPtr)
0524             {
0525                 AcpiUtRemoveReference (ObjDesc);
0526             }
0527             goto NextOperand;
0528 
0529 
0530         case ARGI_BUFFER:
0531 
0532             /*
0533              * Need an operand of type ACPI_TYPE_BUFFER,
0534              * But we can implicitly convert from a STRING or INTEGER
0535              * Aka - "Implicit Source Operand Conversion"
0536              */
0537             Status = AcpiExConvertToBuffer (ObjDesc, StackPtr);
0538             if (ACPI_FAILURE (Status))
0539             {
0540                 if (Status == AE_TYPE)
0541                 {
0542                     ACPI_ERROR ((AE_INFO,
0543                         "Needed [Integer/String/Buffer], found [%s] %p",
0544                         AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
0545 
0546                     return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
0547                 }
0548 
0549                 return_ACPI_STATUS (Status);
0550             }
0551 
0552             if (ObjDesc != *StackPtr)
0553             {
0554                 AcpiUtRemoveReference (ObjDesc);
0555             }
0556             goto NextOperand;
0557 
0558 
0559         case ARGI_STRING:
0560 
0561             /*
0562              * Need an operand of type ACPI_TYPE_STRING,
0563              * But we can implicitly convert from a BUFFER or INTEGER
0564              * Aka - "Implicit Source Operand Conversion"
0565              */
0566             Status = AcpiExConvertToString (ObjDesc, StackPtr,
0567                         ACPI_IMPLICIT_CONVERT_HEX);
0568             if (ACPI_FAILURE (Status))
0569             {
0570                 if (Status == AE_TYPE)
0571                 {
0572                     ACPI_ERROR ((AE_INFO,
0573                         "Needed [Integer/String/Buffer], found [%s] %p",
0574                         AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
0575 
0576                     return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
0577                 }
0578 
0579                 return_ACPI_STATUS (Status);
0580             }
0581 
0582             if (ObjDesc != *StackPtr)
0583             {
0584                 AcpiUtRemoveReference (ObjDesc);
0585             }
0586             goto NextOperand;
0587 
0588 
0589         case ARGI_COMPUTEDATA:
0590 
0591             /* Need an operand of type INTEGER, STRING or BUFFER */
0592 
0593             switch (ObjDesc->Common.Type)
0594             {
0595             case ACPI_TYPE_INTEGER:
0596             case ACPI_TYPE_STRING:
0597             case ACPI_TYPE_BUFFER:
0598 
0599                 /* Valid operand */
0600                break;
0601 
0602             default:
0603                 ACPI_ERROR ((AE_INFO,
0604                     "Needed [Integer/String/Buffer], found [%s] %p",
0605                     AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
0606 
0607                 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
0608             }
0609             goto NextOperand;
0610 
0611 
0612         case ARGI_BUFFER_OR_STRING:
0613 
0614             /* Need an operand of type STRING or BUFFER */
0615 
0616             switch (ObjDesc->Common.Type)
0617             {
0618             case ACPI_TYPE_STRING:
0619             case ACPI_TYPE_BUFFER:
0620 
0621                 /* Valid operand */
0622                break;
0623 
0624             case ACPI_TYPE_INTEGER:
0625 
0626                 /* Highest priority conversion is to type Buffer */
0627 
0628                 Status = AcpiExConvertToBuffer (ObjDesc, StackPtr);
0629                 if (ACPI_FAILURE (Status))
0630                 {
0631                     return_ACPI_STATUS (Status);
0632                 }
0633 
0634                 if (ObjDesc != *StackPtr)
0635                 {
0636                     AcpiUtRemoveReference (ObjDesc);
0637                 }
0638                 break;
0639 
0640             default:
0641                 ACPI_ERROR ((AE_INFO,
0642                     "Needed [Integer/String/Buffer], found [%s] %p",
0643                     AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
0644 
0645                 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
0646             }
0647             goto NextOperand;
0648 
0649 
0650         case ARGI_DATAOBJECT:
0651             /*
0652              * ARGI_DATAOBJECT is only used by the SizeOf operator.
0653              * Need a buffer, string, package, or RefOf reference.
0654              *
0655              * The only reference allowed here is a direct reference to
0656              * a namespace node.
0657              */
0658             switch (ObjDesc->Common.Type)
0659             {
0660             case ACPI_TYPE_PACKAGE:
0661             case ACPI_TYPE_STRING:
0662             case ACPI_TYPE_BUFFER:
0663             case ACPI_TYPE_LOCAL_REFERENCE:
0664 
0665                 /* Valid operand */
0666                 break;
0667 
0668             default:
0669                 ACPI_ERROR ((AE_INFO,
0670                     "Needed [Buffer/String/Package/Reference], found [%s] %p",
0671                     AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
0672 
0673                 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
0674             }
0675             goto NextOperand;
0676 
0677 
0678         case ARGI_COMPLEXOBJ:
0679 
0680             /* Need a buffer or package or (ACPI 2.0) String */
0681 
0682             switch (ObjDesc->Common.Type)
0683             {
0684             case ACPI_TYPE_PACKAGE:
0685             case ACPI_TYPE_STRING:
0686             case ACPI_TYPE_BUFFER:
0687 
0688                 /* Valid operand */
0689                 break;
0690 
0691             default:
0692                 ACPI_ERROR ((AE_INFO,
0693                     "Needed [Buffer/String/Package], found [%s] %p",
0694                     AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
0695 
0696                 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
0697             }
0698             goto NextOperand;
0699 
0700 
0701         case ARGI_REGION_OR_BUFFER: /* Used by Load() only */
0702 
0703             /* Need an operand of type REGION or a BUFFER (which could be a resolved region field) */
0704 
0705             switch (ObjDesc->Common.Type)
0706             {
0707             case ACPI_TYPE_BUFFER:
0708             case ACPI_TYPE_REGION:
0709 
0710                 /* Valid operand */
0711                 break;
0712 
0713             default:
0714                 ACPI_ERROR ((AE_INFO,
0715                     "Needed [Region/Buffer], found [%s] %p",
0716                     AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
0717 
0718                 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
0719             }
0720             goto NextOperand;
0721 
0722 
0723         case ARGI_DATAREFOBJ:
0724 
0725             /* Used by the Store() operator only */
0726 
0727             switch (ObjDesc->Common.Type)
0728             {
0729             case ACPI_TYPE_INTEGER:
0730             case ACPI_TYPE_PACKAGE:
0731             case ACPI_TYPE_STRING:
0732             case ACPI_TYPE_BUFFER:
0733             case ACPI_TYPE_BUFFER_FIELD:
0734             case ACPI_TYPE_LOCAL_REFERENCE:
0735             case ACPI_TYPE_LOCAL_REGION_FIELD:
0736             case ACPI_TYPE_LOCAL_BANK_FIELD:
0737             case ACPI_TYPE_LOCAL_INDEX_FIELD:
0738             case ACPI_TYPE_DDB_HANDLE:
0739 
0740                 /* Valid operand */
0741                 break;
0742 
0743             default:
0744 
0745                 if (AcpiGbl_EnableInterpreterSlack)
0746                 {
0747                     /*
0748                      * Enable original behavior of Store(), allowing any and all
0749                      * objects as the source operand.  The ACPI spec does not
0750                      * allow this, however.
0751                      */
0752                     break;
0753                 }
0754 
0755                 if (TargetOp == AML_DEBUG_OP)
0756                 {
0757                     /* Allow store of any object to the Debug object */
0758 
0759                     break;
0760                 }
0761 
0762                 ACPI_ERROR ((AE_INFO,
0763                     "Needed Integer/Buffer/String/Package/Ref/Ddb], found [%s] %p",
0764                     AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
0765 
0766                 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
0767             }
0768             goto NextOperand;
0769 
0770 
0771         default:
0772 
0773             /* Unknown type */
0774 
0775             ACPI_ERROR ((AE_INFO,
0776                 "Internal - Unknown ARGI (required operand) type %X",
0777                 ThisArgType));
0778 
0779             return_ACPI_STATUS (AE_BAD_PARAMETER);
0780         }
0781 
0782         /*
0783          * Make sure that the original object was resolved to the
0784          * required object type (Simple cases only).
0785          */
0786         Status = AcpiExCheckObjectType (TypeNeeded,
0787                         (*StackPtr)->Common.Type, *StackPtr);
0788         if (ACPI_FAILURE (Status))
0789         {
0790             return_ACPI_STATUS (Status);
0791         }
0792 
0793 NextOperand:
0794         /*
0795          * If more operands needed, decrement StackPtr to point
0796          * to next operand on stack
0797          */
0798         if (GET_CURRENT_ARG_TYPE (ArgTypes))
0799         {
0800             StackPtr--;
0801         }
0802     }
0803 
0804     ACPI_DUMP_OPERANDS (WalkState->Operands,
0805         AcpiPsGetOpcodeName (Opcode), WalkState->NumOperands);
0806 
0807     return_ACPI_STATUS (Status);
0808 }
0809 
0810