![]() |
|
|||
File indexing completed on 2025-05-11 08:24:02
0001 /****************************************************************************** 0002 * 0003 * Module Name: dsobject - Dispatcher object management routines 0004 * 0005 *****************************************************************************/ 0006 0007 /****************************************************************************** 0008 * 0009 * 1. Copyright Notice 0010 * 0011 * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp. 0012 * All rights reserved. 0013 * 0014 * 2. License 0015 * 0016 * 2.1. This is your license from Intel Corp. under its intellectual property 0017 * rights. You may have additional license terms from the party that provided 0018 * you this software, covering your right to use that party's intellectual 0019 * property rights. 0020 * 0021 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 0022 * copy of the source code appearing in this file ("Covered Code") an 0023 * irrevocable, perpetual, worldwide license under Intel's copyrights in the 0024 * base code distributed originally by Intel ("Original Intel Code") to copy, 0025 * make derivatives, distribute, use and display any portion of the Covered 0026 * Code in any form, with the right to sublicense such rights; and 0027 * 0028 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 0029 * license (with the right to sublicense), under only those claims of Intel 0030 * patents that are infringed by the Original Intel Code, to make, use, sell, 0031 * offer to sell, and import the Covered Code and derivative works thereof 0032 * solely to the minimum extent necessary to exercise the above copyright 0033 * license, and in no event shall the patent license extend to any additions 0034 * to or modifications of the Original Intel Code. No other license or right 0035 * is granted directly or by implication, estoppel or otherwise; 0036 * 0037 * The above copyright and patent license is granted only if the following 0038 * conditions are met: 0039 * 0040 * 3. Conditions 0041 * 0042 * 3.1. Redistribution of Source with Rights to Further Distribute Source. 0043 * Redistribution of source code of any substantial portion of the Covered 0044 * Code or modification with rights to further distribute source must include 0045 * the above Copyright Notice, the above License, this list of Conditions, 0046 * and the following Disclaimer and Export Compliance provision. In addition, 0047 * Licensee must cause all Covered Code to which Licensee contributes to 0048 * contain a file documenting the changes Licensee made to create that Covered 0049 * Code and the date of any change. Licensee must include in that file the 0050 * documentation of any changes made by any predecessor Licensee. Licensee 0051 * must include a prominent statement that the modification is derived, 0052 * directly or indirectly, from Original Intel Code. 0053 * 0054 * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 0055 * Redistribution of source code of any substantial portion of the Covered 0056 * Code or modification without rights to further distribute source must 0057 * include the following Disclaimer and Export Compliance provision in the 0058 * documentation and/or other materials provided with distribution. In 0059 * addition, Licensee may not authorize further sublicense of source of any 0060 * portion of the Covered Code, and must include terms to the effect that the 0061 * license from Licensee to its licensee is limited to the intellectual 0062 * property embodied in the software Licensee provides to its licensee, and 0063 * not to intellectual property embodied in modifications its licensee may 0064 * make. 0065 * 0066 * 3.3. Redistribution of Executable. Redistribution in executable form of any 0067 * substantial portion of the Covered Code or modification must reproduce the 0068 * above Copyright Notice, and the following Disclaimer and Export Compliance 0069 * provision in the documentation and/or other materials provided with the 0070 * distribution. 0071 * 0072 * 3.4. Intel retains all right, title, and interest in and to the Original 0073 * Intel Code. 0074 * 0075 * 3.5. Neither the name Intel nor any other trademark owned or controlled by 0076 * Intel shall be used in advertising or otherwise to promote the sale, use or 0077 * other dealings in products derived from or relating to the Covered Code 0078 * without prior written authorization from Intel. 0079 * 0080 * 4. Disclaimer and Export Compliance 0081 * 0082 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 0083 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 0084 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 0085 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 0086 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 0087 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 0088 * PARTICULAR PURPOSE. 0089 * 0090 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 0091 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 0092 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 0093 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 0094 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 0095 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 0096 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 0097 * LIMITED REMEDY. 0098 * 0099 * 4.3. Licensee shall not export, either directly or indirectly, any of this 0100 * software or system incorporating such software without first obtaining any 0101 * required license or other approval from the U. S. Department of Commerce or 0102 * any other agency or department of the United States Government. In the 0103 * event Licensee exports any such software from the United States or 0104 * re-exports any such software from a foreign destination, Licensee shall 0105 * ensure that the distribution and export/re-export of the software is in 0106 * compliance with all laws, regulations, orders, or other restrictions of the 0107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor 0108 * any of its subsidiaries will export/re-export any technical data, process, 0109 * software, or service, directly or indirectly, to any country for which the 0110 * United States government or any agency thereof requires an export license, 0111 * other governmental approval, or letter of assurance, without first obtaining 0112 * such license, approval or letter. 0113 * 0114 ***************************************************************************** 0115 * 0116 * Alternatively, you may choose to be licensed under the terms of the 0117 * following license: 0118 * 0119 * Redistribution and use in source and binary forms, with or without 0120 * modification, are permitted provided that the following conditions 0121 * are met: 0122 * 1. Redistributions of source code must retain the above copyright 0123 * notice, this list of conditions, and the following disclaimer, 0124 * without modification. 0125 * 2. Redistributions in binary form must reproduce at minimum a disclaimer 0126 * substantially similar to the "NO WARRANTY" disclaimer below 0127 * ("Disclaimer") and any redistribution must be conditioned upon 0128 * including a substantially similar Disclaimer requirement for further 0129 * binary redistribution. 0130 * 3. Neither the names of the above-listed copyright holders nor the names 0131 * of any contributors may be used to endorse or promote products derived 0132 * from this software without specific prior written permission. 0133 * 0134 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 0135 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 0136 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 0137 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 0138 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 0139 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 0140 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 0141 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 0142 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 0143 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 0144 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 0145 * 0146 * Alternatively, you may choose to be licensed under the terms of the 0147 * GNU General Public License ("GPL") version 2 as published by the Free 0148 * Software Foundation. 0149 * 0150 *****************************************************************************/ 0151 0152 #include "acpi.h" 0153 #include "accommon.h" 0154 #include "acparser.h" 0155 #include "amlcode.h" 0156 #include "acdispat.h" 0157 #include "acnamesp.h" 0158 #include "acinterp.h" 0159 0160 #define _COMPONENT ACPI_DISPATCHER 0161 ACPI_MODULE_NAME ("dsobject") 0162 0163 0164 /******************************************************************************* 0165 * 0166 * FUNCTION: AcpiDsBuildInternalObject 0167 * 0168 * PARAMETERS: WalkState - Current walk state 0169 * Op - Parser object to be translated 0170 * ObjDescPtr - Where the ACPI internal object is returned 0171 * 0172 * RETURN: Status 0173 * 0174 * DESCRIPTION: Translate a parser Op object to the equivalent namespace object 0175 * Simple objects are any objects other than a package object! 0176 * 0177 ******************************************************************************/ 0178 0179 ACPI_STATUS 0180 AcpiDsBuildInternalObject ( 0181 ACPI_WALK_STATE *WalkState, 0182 ACPI_PARSE_OBJECT *Op, 0183 ACPI_OPERAND_OBJECT **ObjDescPtr) 0184 { 0185 ACPI_OPERAND_OBJECT *ObjDesc; 0186 ACPI_STATUS Status; 0187 0188 0189 ACPI_FUNCTION_TRACE (DsBuildInternalObject); 0190 0191 0192 *ObjDescPtr = NULL; 0193 if (Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP) 0194 { 0195 /* 0196 * This is a named object reference. If this name was 0197 * previously looked up in the namespace, it was stored in 0198 * this op. Otherwise, go ahead and look it up now 0199 */ 0200 if (!Op->Common.Node) 0201 { 0202 /* Check if we are resolving a named reference within a package */ 0203 0204 if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) || 0205 (Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP)) 0206 { 0207 /* 0208 * We won't resolve package elements here, we will do this 0209 * after all ACPI tables are loaded into the namespace. This 0210 * behavior supports both forward references to named objects 0211 * and external references to objects in other tables. 0212 */ 0213 goto CreateNewObject; 0214 } 0215 else 0216 { 0217 Status = AcpiNsLookup (WalkState->ScopeInfo, 0218 Op->Common.Value.String, 0219 ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, 0220 ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, 0221 ACPI_CAST_INDIRECT_PTR ( 0222 ACPI_NAMESPACE_NODE, &(Op->Common.Node))); 0223 if (ACPI_FAILURE (Status)) 0224 { 0225 ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, 0226 Op->Common.Value.String, Status); 0227 return_ACPI_STATUS (Status); 0228 } 0229 } 0230 } 0231 } 0232 0233 CreateNewObject: 0234 0235 /* Create and init a new internal ACPI object */ 0236 0237 ObjDesc = AcpiUtCreateInternalObject ( 0238 (AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode))->ObjectType); 0239 if (!ObjDesc) 0240 { 0241 return_ACPI_STATUS (AE_NO_MEMORY); 0242 } 0243 0244 Status = AcpiDsInitObjectFromOp ( 0245 WalkState, Op, Op->Common.AmlOpcode, &ObjDesc); 0246 if (ACPI_FAILURE (Status)) 0247 { 0248 AcpiUtRemoveReference (ObjDesc); 0249 return_ACPI_STATUS (Status); 0250 } 0251 0252 /* 0253 * Handling for unresolved package reference elements. 0254 * These are elements that are namepaths. 0255 */ 0256 if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) || 0257 (Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP)) 0258 { 0259 ObjDesc->Reference.Resolved = TRUE; 0260 0261 if ((Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP) && 0262 !ObjDesc->Reference.Node) 0263 { 0264 /* 0265 * Name was unresolved above. 0266 * Get the prefix node for later lookup 0267 */ 0268 ObjDesc->Reference.Node = WalkState->ScopeInfo->Scope.Node; 0269 ObjDesc->Reference.Aml = Op->Common.Aml; 0270 ObjDesc->Reference.Resolved = FALSE; 0271 } 0272 } 0273 0274 *ObjDescPtr = ObjDesc; 0275 return_ACPI_STATUS (Status); 0276 } 0277 0278 0279 /******************************************************************************* 0280 * 0281 * FUNCTION: AcpiDsBuildInternalBufferObj 0282 * 0283 * PARAMETERS: WalkState - Current walk state 0284 * Op - Parser object to be translated 0285 * BufferLength - Length of the buffer 0286 * ObjDescPtr - Where the ACPI internal object is returned 0287 * 0288 * RETURN: Status 0289 * 0290 * DESCRIPTION: Translate a parser Op package object to the equivalent 0291 * namespace object 0292 * 0293 ******************************************************************************/ 0294 0295 ACPI_STATUS 0296 AcpiDsBuildInternalBufferObj ( 0297 ACPI_WALK_STATE *WalkState, 0298 ACPI_PARSE_OBJECT *Op, 0299 UINT32 BufferLength, 0300 ACPI_OPERAND_OBJECT **ObjDescPtr) 0301 { 0302 ACPI_PARSE_OBJECT *Arg; 0303 ACPI_OPERAND_OBJECT *ObjDesc; 0304 ACPI_PARSE_OBJECT *ByteList; 0305 UINT32 ByteListLength = 0; 0306 0307 0308 ACPI_FUNCTION_TRACE (DsBuildInternalBufferObj); 0309 0310 0311 /* 0312 * If we are evaluating a Named buffer object "Name (xxxx, Buffer)". 0313 * The buffer object already exists (from the NS node), otherwise it must 0314 * be created. 0315 */ 0316 ObjDesc = *ObjDescPtr; 0317 if (!ObjDesc) 0318 { 0319 /* Create a new buffer object */ 0320 0321 ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER); 0322 *ObjDescPtr = ObjDesc; 0323 if (!ObjDesc) 0324 { 0325 return_ACPI_STATUS (AE_NO_MEMORY); 0326 } 0327 } 0328 0329 /* 0330 * Second arg is the buffer data (optional) ByteList can be either 0331 * individual bytes or a string initializer. In either case, a 0332 * ByteList appears in the AML. 0333 */ 0334 Arg = Op->Common.Value.Arg; /* skip first arg */ 0335 0336 ByteList = Arg->Named.Next; 0337 if (ByteList) 0338 { 0339 if (ByteList->Common.AmlOpcode != AML_INT_BYTELIST_OP) 0340 { 0341 ACPI_ERROR ((AE_INFO, 0342 "Expecting bytelist, found AML opcode 0x%X in op %p", 0343 ByteList->Common.AmlOpcode, ByteList)); 0344 0345 AcpiUtRemoveReference (ObjDesc); 0346 return (AE_TYPE); 0347 } 0348 0349 ByteListLength = (UINT32) ByteList->Common.Value.Integer; 0350 } 0351 0352 /* 0353 * The buffer length (number of bytes) will be the larger of: 0354 * 1) The specified buffer length and 0355 * 2) The length of the initializer byte list 0356 */ 0357 ObjDesc->Buffer.Length = BufferLength; 0358 if (ByteListLength > BufferLength) 0359 { 0360 ObjDesc->Buffer.Length = ByteListLength; 0361 } 0362 0363 /* Allocate the buffer */ 0364 0365 if (ObjDesc->Buffer.Length == 0) 0366 { 0367 ObjDesc->Buffer.Pointer = NULL; 0368 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 0369 "Buffer defined with zero length in AML, creating\n")); 0370 } 0371 else 0372 { 0373 ObjDesc->Buffer.Pointer = 0374 ACPI_ALLOCATE_ZEROED (ObjDesc->Buffer.Length); 0375 if (!ObjDesc->Buffer.Pointer) 0376 { 0377 AcpiUtDeleteObjectDesc (ObjDesc); 0378 return_ACPI_STATUS (AE_NO_MEMORY); 0379 } 0380 0381 /* Initialize buffer from the ByteList (if present) */ 0382 0383 if (ByteList) 0384 { 0385 memcpy (ObjDesc->Buffer.Pointer, ByteList->Named.Data, 0386 ByteListLength); 0387 } 0388 } 0389 0390 ObjDesc->Buffer.Flags |= AOPOBJ_DATA_VALID; 0391 Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc); 0392 return_ACPI_STATUS (AE_OK); 0393 } 0394 0395 /******************************************************************************* 0396 * 0397 * FUNCTION: AcpiDsCreateNode 0398 * 0399 * PARAMETERS: WalkState - Current walk state 0400 * Node - NS Node to be initialized 0401 * Op - Parser object to be translated 0402 * 0403 * RETURN: Status 0404 * 0405 * DESCRIPTION: Create the object to be associated with a namespace node 0406 * 0407 ******************************************************************************/ 0408 0409 ACPI_STATUS 0410 AcpiDsCreateNode ( 0411 ACPI_WALK_STATE *WalkState, 0412 ACPI_NAMESPACE_NODE *Node, 0413 ACPI_PARSE_OBJECT *Op) 0414 { 0415 ACPI_STATUS Status; 0416 ACPI_OPERAND_OBJECT *ObjDesc; 0417 0418 0419 ACPI_FUNCTION_TRACE_PTR (DsCreateNode, Op); 0420 0421 0422 /* 0423 * Because of the execution pass through the non-control-method 0424 * parts of the table, we can arrive here twice. Only init 0425 * the named object node the first time through 0426 */ 0427 if (AcpiNsGetAttachedObject (Node)) 0428 { 0429 return_ACPI_STATUS (AE_OK); 0430 } 0431 0432 if (!Op->Common.Value.Arg) 0433 { 0434 /* No arguments, there is nothing to do */ 0435 0436 return_ACPI_STATUS (AE_OK); 0437 } 0438 0439 /* Build an internal object for the argument(s) */ 0440 0441 Status = AcpiDsBuildInternalObject ( 0442 WalkState, Op->Common.Value.Arg, &ObjDesc); 0443 if (ACPI_FAILURE (Status)) 0444 { 0445 return_ACPI_STATUS (Status); 0446 } 0447 0448 /* Re-type the object according to its argument */ 0449 0450 Node->Type = ObjDesc->Common.Type; 0451 0452 /* Attach obj to node */ 0453 0454 Status = AcpiNsAttachObject (Node, ObjDesc, Node->Type); 0455 0456 /* Remove local reference to the object */ 0457 0458 AcpiUtRemoveReference (ObjDesc); 0459 return_ACPI_STATUS (Status); 0460 } 0461 0462 0463 /******************************************************************************* 0464 * 0465 * FUNCTION: AcpiDsInitObjectFromOp 0466 * 0467 * PARAMETERS: WalkState - Current walk state 0468 * Op - Parser op used to init the internal object 0469 * Opcode - AML opcode associated with the object 0470 * RetObjDesc - Namespace object to be initialized 0471 * 0472 * RETURN: Status 0473 * 0474 * DESCRIPTION: Initialize a namespace object from a parser Op and its 0475 * associated arguments. The namespace object is a more compact 0476 * representation of the Op and its arguments. 0477 * 0478 ******************************************************************************/ 0479 0480 ACPI_STATUS 0481 AcpiDsInitObjectFromOp ( 0482 ACPI_WALK_STATE *WalkState, 0483 ACPI_PARSE_OBJECT *Op, 0484 UINT16 Opcode, 0485 ACPI_OPERAND_OBJECT **RetObjDesc) 0486 { 0487 const ACPI_OPCODE_INFO *OpInfo; 0488 ACPI_OPERAND_OBJECT *ObjDesc; 0489 ACPI_STATUS Status = AE_OK; 0490 0491 0492 ACPI_FUNCTION_TRACE (DsInitObjectFromOp); 0493 0494 0495 ObjDesc = *RetObjDesc; 0496 OpInfo = AcpiPsGetOpcodeInfo (Opcode); 0497 if (OpInfo->Class == AML_CLASS_UNKNOWN) 0498 { 0499 /* Unknown opcode */ 0500 0501 return_ACPI_STATUS (AE_TYPE); 0502 } 0503 0504 /* Perform per-object initialization */ 0505 0506 switch (ObjDesc->Common.Type) 0507 { 0508 case ACPI_TYPE_BUFFER: 0509 /* 0510 * Defer evaluation of Buffer TermArg operand 0511 */ 0512 ObjDesc->Buffer.Node = ACPI_CAST_PTR ( 0513 ACPI_NAMESPACE_NODE, WalkState->Operands[0]); 0514 ObjDesc->Buffer.AmlStart = Op->Named.Data; 0515 ObjDesc->Buffer.AmlLength = Op->Named.Length; 0516 break; 0517 0518 case ACPI_TYPE_PACKAGE: 0519 /* 0520 * Defer evaluation of Package TermArg operand and all 0521 * package elements. (01/2017): We defer the element 0522 * resolution to allow forward references from the package 0523 * in order to provide compatibility with other ACPI 0524 * implementations. 0525 */ 0526 ObjDesc->Package.Node = ACPI_CAST_PTR ( 0527 ACPI_NAMESPACE_NODE, WalkState->Operands[0]); 0528 0529 if (!Op->Named.Data) 0530 { 0531 return_ACPI_STATUS (AE_OK); 0532 } 0533 0534 ObjDesc->Package.AmlStart = Op->Named.Data; 0535 ObjDesc->Package.AmlLength = Op->Named.Length; 0536 break; 0537 0538 case ACPI_TYPE_INTEGER: 0539 0540 switch (OpInfo->Type) 0541 { 0542 case AML_TYPE_CONSTANT: 0543 /* 0544 * Resolve AML Constants here - AND ONLY HERE! 0545 * All constants are integers. 0546 * We mark the integer with a flag that indicates that it started 0547 * life as a constant -- so that stores to constants will perform 0548 * as expected (noop). ZeroOp is used as a placeholder for optional 0549 * target operands. 0550 */ 0551 ObjDesc->Common.Flags = AOPOBJ_AML_CONSTANT; 0552 0553 switch (Opcode) 0554 { 0555 case AML_ZERO_OP: 0556 0557 ObjDesc->Integer.Value = 0; 0558 break; 0559 0560 case AML_ONE_OP: 0561 0562 ObjDesc->Integer.Value = 1; 0563 break; 0564 0565 case AML_ONES_OP: 0566 0567 ObjDesc->Integer.Value = ACPI_UINT64_MAX; 0568 0569 /* Truncate value if we are executing from a 32-bit ACPI table */ 0570 0571 (void) AcpiExTruncateFor32bitTable (ObjDesc); 0572 break; 0573 0574 case AML_REVISION_OP: 0575 0576 ObjDesc->Integer.Value = ACPI_CA_VERSION; 0577 break; 0578 0579 default: 0580 0581 ACPI_ERROR ((AE_INFO, 0582 "Unknown constant opcode 0x%X", Opcode)); 0583 Status = AE_AML_OPERAND_TYPE; 0584 break; 0585 } 0586 break; 0587 0588 case AML_TYPE_LITERAL: 0589 0590 ObjDesc->Integer.Value = Op->Common.Value.Integer; 0591 0592 if (AcpiExTruncateFor32bitTable (ObjDesc)) 0593 { 0594 /* Warn if we found a 64-bit constant in a 32-bit table */ 0595 0596 ACPI_WARNING ((AE_INFO, 0597 "Truncated 64-bit constant found in 32-bit table: %8.8X%8.8X => %8.8X", 0598 ACPI_FORMAT_UINT64 (Op->Common.Value.Integer), 0599 (UINT32) ObjDesc->Integer.Value)); 0600 } 0601 break; 0602 0603 default: 0604 0605 ACPI_ERROR ((AE_INFO, "Unknown Integer type 0x%X", 0606 OpInfo->Type)); 0607 Status = AE_AML_OPERAND_TYPE; 0608 break; 0609 } 0610 break; 0611 0612 case ACPI_TYPE_STRING: 0613 0614 ObjDesc->String.Pointer = Op->Common.Value.String; 0615 ObjDesc->String.Length = (UINT32) strlen (Op->Common.Value.String); 0616 0617 /* 0618 * The string is contained in the ACPI table, don't ever try 0619 * to delete it 0620 */ 0621 ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER; 0622 break; 0623 0624 case ACPI_TYPE_METHOD: 0625 break; 0626 0627 case ACPI_TYPE_LOCAL_REFERENCE: 0628 0629 switch (OpInfo->Type) 0630 { 0631 case AML_TYPE_LOCAL_VARIABLE: 0632 0633 /* Local ID (0-7) is (AML opcode - base AML_FIRST_LOCAL_OP) */ 0634 0635 ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_FIRST_LOCAL_OP; 0636 ObjDesc->Reference.Class = ACPI_REFCLASS_LOCAL; 0637 0638 Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_LOCAL, 0639 ObjDesc->Reference.Value, WalkState, 0640 ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, 0641 &ObjDesc->Reference.Object)); 0642 break; 0643 0644 case AML_TYPE_METHOD_ARGUMENT: 0645 0646 /* Arg ID (0-6) is (AML opcode - base AML_FIRST_ARG_OP) */ 0647 0648 ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_FIRST_ARG_OP; 0649 ObjDesc->Reference.Class = ACPI_REFCLASS_ARG; 0650 0651 Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_ARG, 0652 ObjDesc->Reference.Value, WalkState, 0653 ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, 0654 &ObjDesc->Reference.Object)); 0655 break; 0656 0657 default: /* Object name or Debug object */ 0658 0659 switch (Op->Common.AmlOpcode) 0660 { 0661 case AML_INT_NAMEPATH_OP: 0662 0663 /* Node was saved in Op */ 0664 0665 ObjDesc->Reference.Node = Op->Common.Node; 0666 ObjDesc->Reference.Class = ACPI_REFCLASS_NAME; 0667 if (Op->Common.Node) 0668 { 0669 ObjDesc->Reference.Object = Op->Common.Node->Object; 0670 } 0671 break; 0672 0673 case AML_DEBUG_OP: 0674 0675 ObjDesc->Reference.Class = ACPI_REFCLASS_DEBUG; 0676 break; 0677 0678 default: 0679 0680 ACPI_ERROR ((AE_INFO, 0681 "Unimplemented reference type for AML opcode: 0x%4.4X", Opcode)); 0682 return_ACPI_STATUS (AE_AML_OPERAND_TYPE); 0683 } 0684 break; 0685 } 0686 break; 0687 0688 default: 0689 0690 ACPI_ERROR ((AE_INFO, "Unimplemented data type: 0x%X", 0691 ObjDesc->Common.Type)); 0692 0693 Status = AE_AML_OPERAND_TYPE; 0694 break; 0695 } 0696 0697 return_ACPI_STATUS (Status); 0698 }
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |