15f9b24faSJung-uk Kim /****************************************************************************** 25f9b24faSJung-uk Kim * 35f9b24faSJung-uk Kim * Module Name: dspkginit - Completion of deferred package initialization 45f9b24faSJung-uk Kim * 55f9b24faSJung-uk Kim *****************************************************************************/ 65f9b24faSJung-uk Kim 75f9b24faSJung-uk Kim /****************************************************************************** 85f9b24faSJung-uk Kim * 95f9b24faSJung-uk Kim * 1. Copyright Notice 105f9b24faSJung-uk Kim * 11*804fe266SJung-uk Kim * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp. 125f9b24faSJung-uk Kim * All rights reserved. 135f9b24faSJung-uk Kim * 145f9b24faSJung-uk Kim * 2. License 155f9b24faSJung-uk Kim * 165f9b24faSJung-uk Kim * 2.1. This is your license from Intel Corp. under its intellectual property 175f9b24faSJung-uk Kim * rights. You may have additional license terms from the party that provided 185f9b24faSJung-uk Kim * you this software, covering your right to use that party's intellectual 195f9b24faSJung-uk Kim * property rights. 205f9b24faSJung-uk Kim * 215f9b24faSJung-uk Kim * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 225f9b24faSJung-uk Kim * copy of the source code appearing in this file ("Covered Code") an 235f9b24faSJung-uk Kim * irrevocable, perpetual, worldwide license under Intel's copyrights in the 245f9b24faSJung-uk Kim * base code distributed originally by Intel ("Original Intel Code") to copy, 255f9b24faSJung-uk Kim * make derivatives, distribute, use and display any portion of the Covered 265f9b24faSJung-uk Kim * Code in any form, with the right to sublicense such rights; and 275f9b24faSJung-uk Kim * 285f9b24faSJung-uk Kim * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 295f9b24faSJung-uk Kim * license (with the right to sublicense), under only those claims of Intel 305f9b24faSJung-uk Kim * patents that are infringed by the Original Intel Code, to make, use, sell, 315f9b24faSJung-uk Kim * offer to sell, and import the Covered Code and derivative works thereof 325f9b24faSJung-uk Kim * solely to the minimum extent necessary to exercise the above copyright 335f9b24faSJung-uk Kim * license, and in no event shall the patent license extend to any additions 345f9b24faSJung-uk Kim * to or modifications of the Original Intel Code. No other license or right 355f9b24faSJung-uk Kim * is granted directly or by implication, estoppel or otherwise; 365f9b24faSJung-uk Kim * 375f9b24faSJung-uk Kim * The above copyright and patent license is granted only if the following 385f9b24faSJung-uk Kim * conditions are met: 395f9b24faSJung-uk Kim * 405f9b24faSJung-uk Kim * 3. Conditions 415f9b24faSJung-uk Kim * 425f9b24faSJung-uk Kim * 3.1. Redistribution of Source with Rights to Further Distribute Source. 435f9b24faSJung-uk Kim * Redistribution of source code of any substantial portion of the Covered 445f9b24faSJung-uk Kim * Code or modification with rights to further distribute source must include 455f9b24faSJung-uk Kim * the above Copyright Notice, the above License, this list of Conditions, 465f9b24faSJung-uk Kim * and the following Disclaimer and Export Compliance provision. In addition, 475f9b24faSJung-uk Kim * Licensee must cause all Covered Code to which Licensee contributes to 485f9b24faSJung-uk Kim * contain a file documenting the changes Licensee made to create that Covered 495f9b24faSJung-uk Kim * Code and the date of any change. Licensee must include in that file the 505f9b24faSJung-uk Kim * documentation of any changes made by any predecessor Licensee. Licensee 515f9b24faSJung-uk Kim * must include a prominent statement that the modification is derived, 525f9b24faSJung-uk Kim * directly or indirectly, from Original Intel Code. 535f9b24faSJung-uk Kim * 545f9b24faSJung-uk Kim * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 555f9b24faSJung-uk Kim * Redistribution of source code of any substantial portion of the Covered 565f9b24faSJung-uk Kim * Code or modification without rights to further distribute source must 575f9b24faSJung-uk Kim * include the following Disclaimer and Export Compliance provision in the 585f9b24faSJung-uk Kim * documentation and/or other materials provided with distribution. In 595f9b24faSJung-uk Kim * addition, Licensee may not authorize further sublicense of source of any 605f9b24faSJung-uk Kim * portion of the Covered Code, and must include terms to the effect that the 615f9b24faSJung-uk Kim * license from Licensee to its licensee is limited to the intellectual 625f9b24faSJung-uk Kim * property embodied in the software Licensee provides to its licensee, and 635f9b24faSJung-uk Kim * not to intellectual property embodied in modifications its licensee may 645f9b24faSJung-uk Kim * make. 655f9b24faSJung-uk Kim * 665f9b24faSJung-uk Kim * 3.3. Redistribution of Executable. Redistribution in executable form of any 675f9b24faSJung-uk Kim * substantial portion of the Covered Code or modification must reproduce the 685f9b24faSJung-uk Kim * above Copyright Notice, and the following Disclaimer and Export Compliance 695f9b24faSJung-uk Kim * provision in the documentation and/or other materials provided with the 705f9b24faSJung-uk Kim * distribution. 715f9b24faSJung-uk Kim * 725f9b24faSJung-uk Kim * 3.4. Intel retains all right, title, and interest in and to the Original 735f9b24faSJung-uk Kim * Intel Code. 745f9b24faSJung-uk Kim * 755f9b24faSJung-uk Kim * 3.5. Neither the name Intel nor any other trademark owned or controlled by 765f9b24faSJung-uk Kim * Intel shall be used in advertising or otherwise to promote the sale, use or 775f9b24faSJung-uk Kim * other dealings in products derived from or relating to the Covered Code 785f9b24faSJung-uk Kim * without prior written authorization from Intel. 795f9b24faSJung-uk Kim * 805f9b24faSJung-uk Kim * 4. Disclaimer and Export Compliance 815f9b24faSJung-uk Kim * 825f9b24faSJung-uk Kim * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 835f9b24faSJung-uk Kim * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 845f9b24faSJung-uk Kim * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 855f9b24faSJung-uk Kim * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 865f9b24faSJung-uk Kim * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 875f9b24faSJung-uk Kim * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 885f9b24faSJung-uk Kim * PARTICULAR PURPOSE. 895f9b24faSJung-uk Kim * 905f9b24faSJung-uk Kim * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 915f9b24faSJung-uk Kim * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 925f9b24faSJung-uk Kim * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 935f9b24faSJung-uk Kim * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 945f9b24faSJung-uk Kim * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 955f9b24faSJung-uk Kim * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 965f9b24faSJung-uk Kim * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 975f9b24faSJung-uk Kim * LIMITED REMEDY. 985f9b24faSJung-uk Kim * 995f9b24faSJung-uk Kim * 4.3. Licensee shall not export, either directly or indirectly, any of this 1005f9b24faSJung-uk Kim * software or system incorporating such software without first obtaining any 1015f9b24faSJung-uk Kim * required license or other approval from the U. S. Department of Commerce or 1025f9b24faSJung-uk Kim * any other agency or department of the United States Government. In the 1035f9b24faSJung-uk Kim * event Licensee exports any such software from the United States or 1045f9b24faSJung-uk Kim * re-exports any such software from a foreign destination, Licensee shall 1055f9b24faSJung-uk Kim * ensure that the distribution and export/re-export of the software is in 1065f9b24faSJung-uk Kim * compliance with all laws, regulations, orders, or other restrictions of the 1075f9b24faSJung-uk Kim * U.S. Export Administration Regulations. Licensee agrees that neither it nor 1085f9b24faSJung-uk Kim * any of its subsidiaries will export/re-export any technical data, process, 1095f9b24faSJung-uk Kim * software, or service, directly or indirectly, to any country for which the 1105f9b24faSJung-uk Kim * United States government or any agency thereof requires an export license, 1115f9b24faSJung-uk Kim * other governmental approval, or letter of assurance, without first obtaining 1125f9b24faSJung-uk Kim * such license, approval or letter. 1135f9b24faSJung-uk Kim * 1145f9b24faSJung-uk Kim ***************************************************************************** 1155f9b24faSJung-uk Kim * 1165f9b24faSJung-uk Kim * Alternatively, you may choose to be licensed under the terms of the 1175f9b24faSJung-uk Kim * following license: 1185f9b24faSJung-uk Kim * 1195f9b24faSJung-uk Kim * Redistribution and use in source and binary forms, with or without 1205f9b24faSJung-uk Kim * modification, are permitted provided that the following conditions 1215f9b24faSJung-uk Kim * are met: 1225f9b24faSJung-uk Kim * 1. Redistributions of source code must retain the above copyright 1235f9b24faSJung-uk Kim * notice, this list of conditions, and the following disclaimer, 1245f9b24faSJung-uk Kim * without modification. 1255f9b24faSJung-uk Kim * 2. Redistributions in binary form must reproduce at minimum a disclaimer 1265f9b24faSJung-uk Kim * substantially similar to the "NO WARRANTY" disclaimer below 1275f9b24faSJung-uk Kim * ("Disclaimer") and any redistribution must be conditioned upon 1285f9b24faSJung-uk Kim * including a substantially similar Disclaimer requirement for further 1295f9b24faSJung-uk Kim * binary redistribution. 1305f9b24faSJung-uk Kim * 3. Neither the names of the above-listed copyright holders nor the names 1315f9b24faSJung-uk Kim * of any contributors may be used to endorse or promote products derived 1325f9b24faSJung-uk Kim * from this software without specific prior written permission. 1335f9b24faSJung-uk Kim * 1345f9b24faSJung-uk Kim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1355f9b24faSJung-uk Kim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1365f9b24faSJung-uk Kim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1375f9b24faSJung-uk Kim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1385f9b24faSJung-uk Kim * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1395f9b24faSJung-uk Kim * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1405f9b24faSJung-uk Kim * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 1415f9b24faSJung-uk Kim * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 1425f9b24faSJung-uk Kim * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 1435f9b24faSJung-uk Kim * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 1445f9b24faSJung-uk Kim * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1455f9b24faSJung-uk Kim * 1465f9b24faSJung-uk Kim * Alternatively, you may choose to be licensed under the terms of the 1475f9b24faSJung-uk Kim * GNU General Public License ("GPL") version 2 as published by the Free 1485f9b24faSJung-uk Kim * Software Foundation. 1495f9b24faSJung-uk Kim * 1505f9b24faSJung-uk Kim *****************************************************************************/ 1515f9b24faSJung-uk Kim 1525f9b24faSJung-uk Kim #include <contrib/dev/acpica/include/acpi.h> 1535f9b24faSJung-uk Kim #include <contrib/dev/acpica/include/accommon.h> 1545f9b24faSJung-uk Kim #include <contrib/dev/acpica/include/acnamesp.h> 1555f9b24faSJung-uk Kim #include <contrib/dev/acpica/include/amlcode.h> 1565f9b24faSJung-uk Kim #include <contrib/dev/acpica/include/acdispat.h> 1575f9b24faSJung-uk Kim #include <contrib/dev/acpica/include/acinterp.h> 158ff879b07SJung-uk Kim #include <contrib/dev/acpica/include/acparser.h> 1595f9b24faSJung-uk Kim 1605f9b24faSJung-uk Kim 1615f9b24faSJung-uk Kim #define _COMPONENT ACPI_NAMESPACE 1625f9b24faSJung-uk Kim ACPI_MODULE_NAME ("dspkginit") 1635f9b24faSJung-uk Kim 1645f9b24faSJung-uk Kim 1655f9b24faSJung-uk Kim /* Local prototypes */ 1665f9b24faSJung-uk Kim 1675f9b24faSJung-uk Kim static void 1685f9b24faSJung-uk Kim AcpiDsResolvePackageElement ( 1695f9b24faSJung-uk Kim ACPI_OPERAND_OBJECT **Element); 1705f9b24faSJung-uk Kim 1715f9b24faSJung-uk Kim 1725f9b24faSJung-uk Kim /******************************************************************************* 1735f9b24faSJung-uk Kim * 1745f9b24faSJung-uk Kim * FUNCTION: AcpiDsBuildInternalPackageObj 1755f9b24faSJung-uk Kim * 1765f9b24faSJung-uk Kim * PARAMETERS: WalkState - Current walk state 1775f9b24faSJung-uk Kim * Op - Parser object to be translated 1785f9b24faSJung-uk Kim * ElementCount - Number of elements in the package - this is 1795f9b24faSJung-uk Kim * the NumElements argument to Package() 1805f9b24faSJung-uk Kim * ObjDescPtr - Where the ACPI internal object is returned 1815f9b24faSJung-uk Kim * 1825f9b24faSJung-uk Kim * RETURN: Status 1835f9b24faSJung-uk Kim * 1845f9b24faSJung-uk Kim * DESCRIPTION: Translate a parser Op package object to the equivalent 1855f9b24faSJung-uk Kim * namespace object 1865f9b24faSJung-uk Kim * 1875f9b24faSJung-uk Kim * NOTE: The number of elements in the package will be always be the NumElements 1885f9b24faSJung-uk Kim * count, regardless of the number of elements in the package list. If 1895f9b24faSJung-uk Kim * NumElements is smaller, only that many package list elements are used. 1905f9b24faSJung-uk Kim * if NumElements is larger, the Package object is padded out with 1915f9b24faSJung-uk Kim * objects of type Uninitialized (as per ACPI spec.) 1925f9b24faSJung-uk Kim * 1935f9b24faSJung-uk Kim * Even though the ASL compilers do not allow NumElements to be smaller 1945f9b24faSJung-uk Kim * than the Package list length (for the fixed length package opcode), some 1955f9b24faSJung-uk Kim * BIOS code modifies the AML on the fly to adjust the NumElements, and 1965f9b24faSJung-uk Kim * this code compensates for that. This also provides compatibility with 1975f9b24faSJung-uk Kim * other AML interpreters. 1985f9b24faSJung-uk Kim * 1995f9b24faSJung-uk Kim ******************************************************************************/ 2005f9b24faSJung-uk Kim 2015f9b24faSJung-uk Kim ACPI_STATUS 2025f9b24faSJung-uk Kim AcpiDsBuildInternalPackageObj ( 2035f9b24faSJung-uk Kim ACPI_WALK_STATE *WalkState, 2045f9b24faSJung-uk Kim ACPI_PARSE_OBJECT *Op, 2055f9b24faSJung-uk Kim UINT32 ElementCount, 2065f9b24faSJung-uk Kim ACPI_OPERAND_OBJECT **ObjDescPtr) 2075f9b24faSJung-uk Kim { 2085f9b24faSJung-uk Kim ACPI_PARSE_OBJECT *Arg; 2095f9b24faSJung-uk Kim ACPI_PARSE_OBJECT *Parent; 2105f9b24faSJung-uk Kim ACPI_OPERAND_OBJECT *ObjDesc = NULL; 2115f9b24faSJung-uk Kim ACPI_STATUS Status = AE_OK; 212ff879b07SJung-uk Kim BOOLEAN ModuleLevelCode = FALSE; 2135f9b24faSJung-uk Kim UINT16 ReferenceCount; 2145f9b24faSJung-uk Kim UINT32 Index; 2155f9b24faSJung-uk Kim UINT32 i; 2165f9b24faSJung-uk Kim 2175f9b24faSJung-uk Kim 2185f9b24faSJung-uk Kim ACPI_FUNCTION_TRACE (DsBuildInternalPackageObj); 2195f9b24faSJung-uk Kim 2205f9b24faSJung-uk Kim 221ff879b07SJung-uk Kim /* Check if we are executing module level code */ 222ff879b07SJung-uk Kim 223ff879b07SJung-uk Kim if (WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL) 224ff879b07SJung-uk Kim { 225ff879b07SJung-uk Kim ModuleLevelCode = TRUE; 226ff879b07SJung-uk Kim } 227ff879b07SJung-uk Kim 2285f9b24faSJung-uk Kim /* Find the parent of a possibly nested package */ 2295f9b24faSJung-uk Kim 2305f9b24faSJung-uk Kim Parent = Op->Common.Parent; 2315f9b24faSJung-uk Kim while ((Parent->Common.AmlOpcode == AML_PACKAGE_OP) || 2325f9b24faSJung-uk Kim (Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP)) 2335f9b24faSJung-uk Kim { 2345f9b24faSJung-uk Kim Parent = Parent->Common.Parent; 2355f9b24faSJung-uk Kim } 2365f9b24faSJung-uk Kim 2375f9b24faSJung-uk Kim /* 2385f9b24faSJung-uk Kim * If we are evaluating a Named package object of the form: 2395f9b24faSJung-uk Kim * Name (xxxx, Package) 2405f9b24faSJung-uk Kim * the package object already exists, otherwise it must be created. 2415f9b24faSJung-uk Kim */ 2425f9b24faSJung-uk Kim ObjDesc = *ObjDescPtr; 2435f9b24faSJung-uk Kim if (!ObjDesc) 2445f9b24faSJung-uk Kim { 2455f9b24faSJung-uk Kim ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_PACKAGE); 2465f9b24faSJung-uk Kim *ObjDescPtr = ObjDesc; 2475f9b24faSJung-uk Kim if (!ObjDesc) 2485f9b24faSJung-uk Kim { 2495f9b24faSJung-uk Kim return_ACPI_STATUS (AE_NO_MEMORY); 2505f9b24faSJung-uk Kim } 2515f9b24faSJung-uk Kim 2525f9b24faSJung-uk Kim ObjDesc->Package.Node = Parent->Common.Node; 2535f9b24faSJung-uk Kim } 2545f9b24faSJung-uk Kim 2555f9b24faSJung-uk Kim if (ObjDesc->Package.Flags & AOPOBJ_DATA_VALID) /* Just in case */ 2565f9b24faSJung-uk Kim { 2575f9b24faSJung-uk Kim return_ACPI_STATUS (AE_OK); 2585f9b24faSJung-uk Kim } 2595f9b24faSJung-uk Kim 2605f9b24faSJung-uk Kim /* 2615f9b24faSJung-uk Kim * Allocate the element array (array of pointers to the individual 262ff879b07SJung-uk Kim * objects) if necessary. the count is based on the NumElements 263ff879b07SJung-uk Kim * parameter. Add an extra pointer slot so that the list is always 264ff879b07SJung-uk Kim * null terminated. 2655f9b24faSJung-uk Kim */ 266ff879b07SJung-uk Kim if (!ObjDesc->Package.Elements) 267ff879b07SJung-uk Kim { 2685f9b24faSJung-uk Kim ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED ( 2695f9b24faSJung-uk Kim ((ACPI_SIZE) ElementCount + 1) * sizeof (void *)); 2705f9b24faSJung-uk Kim 2715f9b24faSJung-uk Kim if (!ObjDesc->Package.Elements) 2725f9b24faSJung-uk Kim { 2735f9b24faSJung-uk Kim AcpiUtDeleteObjectDesc (ObjDesc); 2745f9b24faSJung-uk Kim return_ACPI_STATUS (AE_NO_MEMORY); 2755f9b24faSJung-uk Kim } 2765f9b24faSJung-uk Kim 2775f9b24faSJung-uk Kim ObjDesc->Package.Count = ElementCount; 278ff879b07SJung-uk Kim } 279ff879b07SJung-uk Kim 280ff879b07SJung-uk Kim /* First arg is element count. Second arg begins the initializer list */ 281ff879b07SJung-uk Kim 2825f9b24faSJung-uk Kim Arg = Op->Common.Value.Arg; 2835f9b24faSJung-uk Kim Arg = Arg->Common.Next; 2845f9b24faSJung-uk Kim 285ff879b07SJung-uk Kim /* 286ff879b07SJung-uk Kim * If we are executing module-level code, we will defer the 287ff879b07SJung-uk Kim * full resolution of the package elements in order to support 288ff879b07SJung-uk Kim * forward references from the elements. This provides 289ff879b07SJung-uk Kim * compatibility with other ACPI implementations. 290ff879b07SJung-uk Kim */ 291ff879b07SJung-uk Kim if (ModuleLevelCode) 2925f9b24faSJung-uk Kim { 293ff879b07SJung-uk Kim ObjDesc->Package.AmlStart = WalkState->Aml; 294ff879b07SJung-uk Kim ObjDesc->Package.AmlLength = 0; 295ff879b07SJung-uk Kim 296ff879b07SJung-uk Kim ACPI_DEBUG_PRINT_RAW ((ACPI_DB_PARSE, 297ff879b07SJung-uk Kim "%s: Deferring resolution of Package elements\n", 298ff879b07SJung-uk Kim ACPI_GET_FUNCTION_NAME)); 2995f9b24faSJung-uk Kim } 3005f9b24faSJung-uk Kim 3015f9b24faSJung-uk Kim /* 3025f9b24faSJung-uk Kim * Initialize the elements of the package, up to the NumElements count. 3035f9b24faSJung-uk Kim * Package is automatically padded with uninitialized (NULL) elements 3045f9b24faSJung-uk Kim * if NumElements is greater than the package list length. Likewise, 3055f9b24faSJung-uk Kim * Package is truncated if NumElements is less than the list length. 3065f9b24faSJung-uk Kim */ 3075f9b24faSJung-uk Kim for (i = 0; Arg && (i < ElementCount); i++) 3085f9b24faSJung-uk Kim { 3095f9b24faSJung-uk Kim if (Arg->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP) 3105f9b24faSJung-uk Kim { 31190b566fdSJung-uk Kim if (!Arg->Common.Node) 31290b566fdSJung-uk Kim { 31390b566fdSJung-uk Kim /* 31490b566fdSJung-uk Kim * This is the case where an expression has returned a value. 31590b566fdSJung-uk Kim * The use of expressions (TermArgs) within individual 31690b566fdSJung-uk Kim * package elements is not supported by the AML interpreter, 31790b566fdSJung-uk Kim * even though the ASL grammar supports it. Example: 31890b566fdSJung-uk Kim * 31990b566fdSJung-uk Kim * Name (INT1, 0x1234) 32090b566fdSJung-uk Kim * 32190b566fdSJung-uk Kim * Name (PKG3, Package () { 32290b566fdSJung-uk Kim * Add (INT1, 0xAAAA0000) 32390b566fdSJung-uk Kim * }) 32490b566fdSJung-uk Kim * 32590b566fdSJung-uk Kim * 1) No known AML interpreter supports this type of construct 32690b566fdSJung-uk Kim * 2) This fixes a fault if the construct is encountered 32790b566fdSJung-uk Kim */ 32890b566fdSJung-uk Kim ACPI_EXCEPTION ((AE_INFO, AE_SUPPORT, 32990b566fdSJung-uk Kim "Expressions within package elements are not supported")); 33090b566fdSJung-uk Kim 33190b566fdSJung-uk Kim /* Cleanup the return object, it is not needed */ 33290b566fdSJung-uk Kim 33390b566fdSJung-uk Kim AcpiUtRemoveReference (WalkState->Results->Results.ObjDesc[0]); 33490b566fdSJung-uk Kim return_ACPI_STATUS (AE_SUPPORT); 33590b566fdSJung-uk Kim } 33690b566fdSJung-uk Kim 3375f9b24faSJung-uk Kim if (Arg->Common.Node->Type == ACPI_TYPE_METHOD) 3385f9b24faSJung-uk Kim { 3395f9b24faSJung-uk Kim /* 3405f9b24faSJung-uk Kim * A method reference "looks" to the parser to be a method 3415f9b24faSJung-uk Kim * invocation, so we special case it here 3425f9b24faSJung-uk Kim */ 3435f9b24faSJung-uk Kim Arg->Common.AmlOpcode = AML_INT_NAMEPATH_OP; 3445f9b24faSJung-uk Kim Status = AcpiDsBuildInternalObject ( 3455f9b24faSJung-uk Kim WalkState, Arg, &ObjDesc->Package.Elements[i]); 3465f9b24faSJung-uk Kim } 3475f9b24faSJung-uk Kim else 3485f9b24faSJung-uk Kim { 3495f9b24faSJung-uk Kim /* This package element is already built, just get it */ 3505f9b24faSJung-uk Kim 3515f9b24faSJung-uk Kim ObjDesc->Package.Elements[i] = 3525f9b24faSJung-uk Kim ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node); 3535f9b24faSJung-uk Kim } 3545f9b24faSJung-uk Kim } 3555f9b24faSJung-uk Kim else 3565f9b24faSJung-uk Kim { 3575f9b24faSJung-uk Kim Status = AcpiDsBuildInternalObject ( 3585f9b24faSJung-uk Kim WalkState, Arg, &ObjDesc->Package.Elements[i]); 3595f9b24faSJung-uk Kim if (Status == AE_NOT_FOUND) 3605f9b24faSJung-uk Kim { 3615f9b24faSJung-uk Kim ACPI_ERROR ((AE_INFO, "%-48s", "****DS namepath not found")); 3625f9b24faSJung-uk Kim } 3635f9b24faSJung-uk Kim 364ff879b07SJung-uk Kim if (!ModuleLevelCode) 365ff879b07SJung-uk Kim { 3665f9b24faSJung-uk Kim /* 3675f9b24faSJung-uk Kim * Initialize this package element. This function handles the 3685f9b24faSJung-uk Kim * resolution of named references within the package. 369ff879b07SJung-uk Kim * Forward references from module-level code are deferred 370ff879b07SJung-uk Kim * until all ACPI tables are loaded. 3715f9b24faSJung-uk Kim */ 3725f9b24faSJung-uk Kim AcpiDsInitPackageElement (0, ObjDesc->Package.Elements[i], 3735f9b24faSJung-uk Kim NULL, &ObjDesc->Package.Elements[i]); 3745f9b24faSJung-uk Kim } 375ff879b07SJung-uk Kim } 3765f9b24faSJung-uk Kim 3775f9b24faSJung-uk Kim if (*ObjDescPtr) 3785f9b24faSJung-uk Kim { 3795f9b24faSJung-uk Kim /* Existing package, get existing reference count */ 3805f9b24faSJung-uk Kim 3815f9b24faSJung-uk Kim ReferenceCount = (*ObjDescPtr)->Common.ReferenceCount; 3825f9b24faSJung-uk Kim if (ReferenceCount > 1) 3835f9b24faSJung-uk Kim { 3845f9b24faSJung-uk Kim /* Make new element ref count match original ref count */ 3855f9b24faSJung-uk Kim /* TBD: Probably need an AcpiUtAddReferences function */ 3865f9b24faSJung-uk Kim 3875f9b24faSJung-uk Kim for (Index = 0; Index < ((UINT32) ReferenceCount - 1); Index++) 3885f9b24faSJung-uk Kim { 3895f9b24faSJung-uk Kim AcpiUtAddReference ((ObjDesc->Package.Elements[i])); 3905f9b24faSJung-uk Kim } 3915f9b24faSJung-uk Kim } 3925f9b24faSJung-uk Kim } 3935f9b24faSJung-uk Kim 3945f9b24faSJung-uk Kim Arg = Arg->Common.Next; 3955f9b24faSJung-uk Kim } 3965f9b24faSJung-uk Kim 3975f9b24faSJung-uk Kim /* Check for match between NumElements and actual length of PackageList */ 3985f9b24faSJung-uk Kim 3995f9b24faSJung-uk Kim if (Arg) 4005f9b24faSJung-uk Kim { 4015f9b24faSJung-uk Kim /* 4025f9b24faSJung-uk Kim * NumElements was exhausted, but there are remaining elements in 4035f9b24faSJung-uk Kim * the PackageList. Truncate the package to NumElements. 4045f9b24faSJung-uk Kim * 4055f9b24faSJung-uk Kim * Note: technically, this is an error, from ACPI spec: "It is an 4065f9b24faSJung-uk Kim * error for NumElements to be less than the number of elements in 4075f9b24faSJung-uk Kim * the PackageList". However, we just print a message and no 4085f9b24faSJung-uk Kim * exception is returned. This provides compatibility with other 4095f9b24faSJung-uk Kim * ACPI implementations. Some firmware implementations will alter 4105f9b24faSJung-uk Kim * the NumElements on the fly, possibly creating this type of 4115f9b24faSJung-uk Kim * ill-formed package object. 4125f9b24faSJung-uk Kim */ 4135f9b24faSJung-uk Kim while (Arg) 4145f9b24faSJung-uk Kim { 4155f9b24faSJung-uk Kim /* 4165f9b24faSJung-uk Kim * We must delete any package elements that were created earlier 4175f9b24faSJung-uk Kim * and are not going to be used because of the package truncation. 4185f9b24faSJung-uk Kim */ 4195f9b24faSJung-uk Kim if (Arg->Common.Node) 4205f9b24faSJung-uk Kim { 4215f9b24faSJung-uk Kim AcpiUtRemoveReference ( 4225f9b24faSJung-uk Kim ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node)); 4235f9b24faSJung-uk Kim Arg->Common.Node = NULL; 4245f9b24faSJung-uk Kim } 4255f9b24faSJung-uk Kim 4265f9b24faSJung-uk Kim /* Find out how many elements there really are */ 4275f9b24faSJung-uk Kim 4285f9b24faSJung-uk Kim i++; 4295f9b24faSJung-uk Kim Arg = Arg->Common.Next; 4305f9b24faSJung-uk Kim } 4315f9b24faSJung-uk Kim 4325f9b24faSJung-uk Kim ACPI_INFO (( 4335f9b24faSJung-uk Kim "Actual Package length (%u) is larger than " 4345f9b24faSJung-uk Kim "NumElements field (%u), truncated", 4355f9b24faSJung-uk Kim i, ElementCount)); 4365f9b24faSJung-uk Kim } 4375f9b24faSJung-uk Kim else if (i < ElementCount) 4385f9b24faSJung-uk Kim { 4395f9b24faSJung-uk Kim /* 4405f9b24faSJung-uk Kim * Arg list (elements) was exhausted, but we did not reach 4415f9b24faSJung-uk Kim * NumElements count. 4425f9b24faSJung-uk Kim * 4435f9b24faSJung-uk Kim * Note: this is not an error, the package is padded out 444ff879b07SJung-uk Kim * with NULLs as per the ACPI specification. 4455f9b24faSJung-uk Kim */ 446ff879b07SJung-uk Kim ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, 447ff879b07SJung-uk Kim "%s: Package List length (%u) smaller than NumElements " 4485f9b24faSJung-uk Kim "count (%u), padded with null elements\n", 449ff879b07SJung-uk Kim ACPI_GET_FUNCTION_NAME, i, ElementCount)); 4505f9b24faSJung-uk Kim } 4515f9b24faSJung-uk Kim 452ff879b07SJung-uk Kim /* Module-level packages will be resolved later */ 453ff879b07SJung-uk Kim 454ff879b07SJung-uk Kim if (!ModuleLevelCode) 455ff879b07SJung-uk Kim { 4565f9b24faSJung-uk Kim ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID; 457ff879b07SJung-uk Kim } 458ff879b07SJung-uk Kim 4595f9b24faSJung-uk Kim Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc); 4605f9b24faSJung-uk Kim return_ACPI_STATUS (Status); 4615f9b24faSJung-uk Kim } 4625f9b24faSJung-uk Kim 4635f9b24faSJung-uk Kim 4645f9b24faSJung-uk Kim /******************************************************************************* 4655f9b24faSJung-uk Kim * 4665f9b24faSJung-uk Kim * FUNCTION: AcpiDsInitPackageElement 4675f9b24faSJung-uk Kim * 4685f9b24faSJung-uk Kim * PARAMETERS: ACPI_PKG_CALLBACK 4695f9b24faSJung-uk Kim * 4705f9b24faSJung-uk Kim * RETURN: Status 4715f9b24faSJung-uk Kim * 4725f9b24faSJung-uk Kim * DESCRIPTION: Resolve a named reference element within a package object 4735f9b24faSJung-uk Kim * 4745f9b24faSJung-uk Kim ******************************************************************************/ 4755f9b24faSJung-uk Kim 4765f9b24faSJung-uk Kim ACPI_STATUS 4775f9b24faSJung-uk Kim AcpiDsInitPackageElement ( 4785f9b24faSJung-uk Kim UINT8 ObjectType, 4795f9b24faSJung-uk Kim ACPI_OPERAND_OBJECT *SourceObject, 4805f9b24faSJung-uk Kim ACPI_GENERIC_STATE *State, 4815f9b24faSJung-uk Kim void *Context) 4825f9b24faSJung-uk Kim { 4835f9b24faSJung-uk Kim ACPI_OPERAND_OBJECT **ElementPtr; 4845f9b24faSJung-uk Kim 4855f9b24faSJung-uk Kim 486f1db5ef7SJung-uk Kim ACPI_FUNCTION_TRACE (DsInitPackageElement); 487f1db5ef7SJung-uk Kim 488f1db5ef7SJung-uk Kim 4895f9b24faSJung-uk Kim if (!SourceObject) 4905f9b24faSJung-uk Kim { 491f1db5ef7SJung-uk Kim return_ACPI_STATUS (AE_OK); 4925f9b24faSJung-uk Kim } 4935f9b24faSJung-uk Kim 4945f9b24faSJung-uk Kim /* 4955f9b24faSJung-uk Kim * The following code is a bit of a hack to workaround a (current) 4965f9b24faSJung-uk Kim * limitation of the ACPI_PKG_CALLBACK interface. We need a pointer 4975f9b24faSJung-uk Kim * to the location within the element array because a new object 4985f9b24faSJung-uk Kim * may be created and stored there. 4995f9b24faSJung-uk Kim */ 5005f9b24faSJung-uk Kim if (Context) 5015f9b24faSJung-uk Kim { 5025f9b24faSJung-uk Kim /* A direct call was made to this function */ 5035f9b24faSJung-uk Kim 5045f9b24faSJung-uk Kim ElementPtr = (ACPI_OPERAND_OBJECT **) Context; 5055f9b24faSJung-uk Kim } 5065f9b24faSJung-uk Kim else 5075f9b24faSJung-uk Kim { 5085f9b24faSJung-uk Kim /* Call came from AcpiUtWalkPackageTree */ 5095f9b24faSJung-uk Kim 5105f9b24faSJung-uk Kim ElementPtr = State->Pkg.ThisTargetObj; 5115f9b24faSJung-uk Kim } 5125f9b24faSJung-uk Kim 5135f9b24faSJung-uk Kim /* We are only interested in reference objects/elements */ 5145f9b24faSJung-uk Kim 5155f9b24faSJung-uk Kim if (SourceObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) 5165f9b24faSJung-uk Kim { 5175f9b24faSJung-uk Kim /* Attempt to resolve the (named) reference to a namespace node */ 5185f9b24faSJung-uk Kim 5195f9b24faSJung-uk Kim AcpiDsResolvePackageElement (ElementPtr); 5205f9b24faSJung-uk Kim } 5215f9b24faSJung-uk Kim else if (SourceObject->Common.Type == ACPI_TYPE_PACKAGE) 5225f9b24faSJung-uk Kim { 5235f9b24faSJung-uk Kim SourceObject->Package.Flags |= AOPOBJ_DATA_VALID; 5245f9b24faSJung-uk Kim } 5255f9b24faSJung-uk Kim 526f1db5ef7SJung-uk Kim return_ACPI_STATUS (AE_OK); 5275f9b24faSJung-uk Kim } 5285f9b24faSJung-uk Kim 5295f9b24faSJung-uk Kim 5305f9b24faSJung-uk Kim /******************************************************************************* 5315f9b24faSJung-uk Kim * 5325f9b24faSJung-uk Kim * FUNCTION: AcpiDsResolvePackageElement 5335f9b24faSJung-uk Kim * 5345f9b24faSJung-uk Kim * PARAMETERS: ElementPtr - Pointer to a reference object 5355f9b24faSJung-uk Kim * 5365f9b24faSJung-uk Kim * RETURN: Possible new element is stored to the indirect ElementPtr 5375f9b24faSJung-uk Kim * 5385f9b24faSJung-uk Kim * DESCRIPTION: Resolve a package element that is a reference to a named 5395f9b24faSJung-uk Kim * object. 5405f9b24faSJung-uk Kim * 5415f9b24faSJung-uk Kim ******************************************************************************/ 5425f9b24faSJung-uk Kim 5435f9b24faSJung-uk Kim static void 5445f9b24faSJung-uk Kim AcpiDsResolvePackageElement ( 5455f9b24faSJung-uk Kim ACPI_OPERAND_OBJECT **ElementPtr) 5465f9b24faSJung-uk Kim { 5475f9b24faSJung-uk Kim ACPI_STATUS Status; 548ff879b07SJung-uk Kim ACPI_STATUS Status2; 5495f9b24faSJung-uk Kim ACPI_GENERIC_STATE ScopeInfo; 5505f9b24faSJung-uk Kim ACPI_OPERAND_OBJECT *Element = *ElementPtr; 5515f9b24faSJung-uk Kim ACPI_NAMESPACE_NODE *ResolvedNode; 552f1db5ef7SJung-uk Kim ACPI_NAMESPACE_NODE *OriginalNode; 553ff879b07SJung-uk Kim char *ExternalPath = ""; 5545f9b24faSJung-uk Kim ACPI_OBJECT_TYPE Type; 5555f9b24faSJung-uk Kim 5565f9b24faSJung-uk Kim 5575f9b24faSJung-uk Kim ACPI_FUNCTION_TRACE (DsResolvePackageElement); 5585f9b24faSJung-uk Kim 5595f9b24faSJung-uk Kim 5605f9b24faSJung-uk Kim /* Check if reference element is already resolved */ 5615f9b24faSJung-uk Kim 5625f9b24faSJung-uk Kim if (Element->Reference.Resolved) 5635f9b24faSJung-uk Kim { 564ff879b07SJung-uk Kim ACPI_DEBUG_PRINT_RAW ((ACPI_DB_PARSE, 565ff879b07SJung-uk Kim "%s: Package element is already resolved\n", 566ff879b07SJung-uk Kim ACPI_GET_FUNCTION_NAME)); 567ff879b07SJung-uk Kim 5685f9b24faSJung-uk Kim return_VOID; 5695f9b24faSJung-uk Kim } 5705f9b24faSJung-uk Kim 5715f9b24faSJung-uk Kim /* Element must be a reference object of correct type */ 5725f9b24faSJung-uk Kim 5735f9b24faSJung-uk Kim ScopeInfo.Scope.Node = Element->Reference.Node; /* Prefix node */ 5745f9b24faSJung-uk Kim 5758438a7a8SJung-uk Kim Status = AcpiNsLookup (&ScopeInfo, (char *) Element->Reference.Aml, 5765f9b24faSJung-uk Kim ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, 5775f9b24faSJung-uk Kim ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, 5785f9b24faSJung-uk Kim NULL, &ResolvedNode); 5795f9b24faSJung-uk Kim if (ACPI_FAILURE (Status)) 5805f9b24faSJung-uk Kim { 5818438a7a8SJung-uk Kim if ((Status == AE_NOT_FOUND) && AcpiGbl_IgnorePackageResolutionErrors) 5828438a7a8SJung-uk Kim { 583ff879b07SJung-uk Kim /* 5848438a7a8SJung-uk Kim * Optionally be silent about the NOT_FOUND case for the referenced 5858438a7a8SJung-uk Kim * name. Although this is potentially a serious problem, 586ff879b07SJung-uk Kim * it can generate a lot of noise/errors on platforms whose 587ff879b07SJung-uk Kim * firmware carries around a bunch of unused Package objects. 5888438a7a8SJung-uk Kim * To disable these errors, set this global to TRUE: 5898438a7a8SJung-uk Kim * AcpiGbl_IgnorePackageResolutionErrors 590ff879b07SJung-uk Kim * 5918438a7a8SJung-uk Kim * If the AML actually tries to use such a package, the unresolved 5928438a7a8SJung-uk Kim * element(s) will be replaced with NULL elements. 593ff879b07SJung-uk Kim */ 5948438a7a8SJung-uk Kim 5958438a7a8SJung-uk Kim /* Referenced name not found, set the element to NULL */ 596ff879b07SJung-uk Kim 597ff879b07SJung-uk Kim AcpiUtRemoveReference (*ElementPtr); 598ff879b07SJung-uk Kim *ElementPtr = NULL; 599ff879b07SJung-uk Kim return_VOID; 600ff879b07SJung-uk Kim } 6018438a7a8SJung-uk Kim 602ff879b07SJung-uk Kim Status2 = AcpiNsExternalizeName (ACPI_UINT32_MAX, 603ff879b07SJung-uk Kim (char *) Element->Reference.Aml, NULL, &ExternalPath); 6045f9b24faSJung-uk Kim 6055f9b24faSJung-uk Kim ACPI_EXCEPTION ((AE_INFO, Status, 606ff879b07SJung-uk Kim "While resolving a named reference package element - %s", 607ff879b07SJung-uk Kim ExternalPath)); 608ff879b07SJung-uk Kim if (ACPI_SUCCESS (Status2)) 609ff879b07SJung-uk Kim { 6105f9b24faSJung-uk Kim ACPI_FREE (ExternalPath); 611ff879b07SJung-uk Kim } 612ff879b07SJung-uk Kim 613ff879b07SJung-uk Kim /* Could not resolve name, set the element to NULL */ 614ff879b07SJung-uk Kim 615ff879b07SJung-uk Kim AcpiUtRemoveReference (*ElementPtr); 6165f9b24faSJung-uk Kim *ElementPtr = NULL; 6175f9b24faSJung-uk Kim return_VOID; 6185f9b24faSJung-uk Kim } 6195f9b24faSJung-uk Kim else if (ResolvedNode->Type == ACPI_TYPE_ANY) 6205f9b24faSJung-uk Kim { 6215f9b24faSJung-uk Kim /* Named reference not resolved, return a NULL package element */ 6225f9b24faSJung-uk Kim 6235f9b24faSJung-uk Kim ACPI_ERROR ((AE_INFO, 6245f9b24faSJung-uk Kim "Could not resolve named package element [%4.4s] in [%4.4s]", 6255f9b24faSJung-uk Kim ResolvedNode->Name.Ascii, ScopeInfo.Scope.Node->Name.Ascii)); 6265f9b24faSJung-uk Kim *ElementPtr = NULL; 6275f9b24faSJung-uk Kim return_VOID; 6285f9b24faSJung-uk Kim } 6295f9b24faSJung-uk Kim 6305f9b24faSJung-uk Kim /* 6315f9b24faSJung-uk Kim * Special handling for Alias objects. We need ResolvedNode to point 6325f9b24faSJung-uk Kim * to the Alias target. This effectively "resolves" the alias. 6335f9b24faSJung-uk Kim */ 6345f9b24faSJung-uk Kim if (ResolvedNode->Type == ACPI_TYPE_LOCAL_ALIAS) 6355f9b24faSJung-uk Kim { 6365f9b24faSJung-uk Kim ResolvedNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, 6375f9b24faSJung-uk Kim ResolvedNode->Object); 6385f9b24faSJung-uk Kim } 6395f9b24faSJung-uk Kim 6405f9b24faSJung-uk Kim /* Update the reference object */ 6415f9b24faSJung-uk Kim 6425f9b24faSJung-uk Kim Element->Reference.Resolved = TRUE; 6435f9b24faSJung-uk Kim Element->Reference.Node = ResolvedNode; 6445f9b24faSJung-uk Kim Type = Element->Reference.Node->Type; 6455f9b24faSJung-uk Kim 6465f9b24faSJung-uk Kim /* 6475f9b24faSJung-uk Kim * Attempt to resolve the node to a value before we insert it into 6485f9b24faSJung-uk Kim * the package. If this is a reference to a common data type, 6495f9b24faSJung-uk Kim * resolve it immediately. According to the ACPI spec, package 6505f9b24faSJung-uk Kim * elements can only be "data objects" or method references. 6515f9b24faSJung-uk Kim * Attempt to resolve to an Integer, Buffer, String or Package. 6525f9b24faSJung-uk Kim * If cannot, return the named reference (for things like Devices, 6535f9b24faSJung-uk Kim * Methods, etc.) Buffer Fields and Fields will resolve to simple 6545f9b24faSJung-uk Kim * objects (int/buf/str/pkg). 6555f9b24faSJung-uk Kim * 6565f9b24faSJung-uk Kim * NOTE: References to things like Devices, Methods, Mutexes, etc. 6575f9b24faSJung-uk Kim * will remain as named references. This behavior is not described 6585f9b24faSJung-uk Kim * in the ACPI spec, but it appears to be an oversight. 6595f9b24faSJung-uk Kim */ 660f1db5ef7SJung-uk Kim OriginalNode = ResolvedNode; 6615f9b24faSJung-uk Kim Status = AcpiExResolveNodeToValue (&ResolvedNode, NULL); 6625f9b24faSJung-uk Kim if (ACPI_FAILURE (Status)) 6635f9b24faSJung-uk Kim { 6645f9b24faSJung-uk Kim return_VOID; 6655f9b24faSJung-uk Kim } 6665f9b24faSJung-uk Kim 6675f9b24faSJung-uk Kim switch (Type) 6685f9b24faSJung-uk Kim { 6695f9b24faSJung-uk Kim /* 6705f9b24faSJung-uk Kim * These object types are a result of named references, so we will 6715f9b24faSJung-uk Kim * leave them as reference objects. In other words, these types 6725f9b24faSJung-uk Kim * have no intrinsic "value". 6735f9b24faSJung-uk Kim */ 6745f9b24faSJung-uk Kim case ACPI_TYPE_DEVICE: 6755f9b24faSJung-uk Kim case ACPI_TYPE_THERMAL: 676f1db5ef7SJung-uk Kim case ACPI_TYPE_METHOD: 6775f9b24faSJung-uk Kim break; 6785f9b24faSJung-uk Kim 6795f9b24faSJung-uk Kim case ACPI_TYPE_MUTEX: 6805f9b24faSJung-uk Kim case ACPI_TYPE_POWER: 6815f9b24faSJung-uk Kim case ACPI_TYPE_PROCESSOR: 6825f9b24faSJung-uk Kim case ACPI_TYPE_EVENT: 6835f9b24faSJung-uk Kim case ACPI_TYPE_REGION: 6845f9b24faSJung-uk Kim 685f1db5ef7SJung-uk Kim /* AcpiExResolveNodeToValue gave these an extra reference */ 686f1db5ef7SJung-uk Kim 687f1db5ef7SJung-uk Kim AcpiUtRemoveReference (OriginalNode->Object); 6885f9b24faSJung-uk Kim break; 6895f9b24faSJung-uk Kim 6905f9b24faSJung-uk Kim default: 6915f9b24faSJung-uk Kim /* 6925f9b24faSJung-uk Kim * For all other types - the node was resolved to an actual 693f1db5ef7SJung-uk Kim * operand object with a value, return the object. Remove 694f1db5ef7SJung-uk Kim * a reference on the existing object. 6955f9b24faSJung-uk Kim */ 696f1db5ef7SJung-uk Kim AcpiUtRemoveReference (Element); 6975f9b24faSJung-uk Kim *ElementPtr = (ACPI_OPERAND_OBJECT *) ResolvedNode; 6985f9b24faSJung-uk Kim break; 6995f9b24faSJung-uk Kim } 7005f9b24faSJung-uk Kim 7015f9b24faSJung-uk Kim return_VOID; 7025f9b24faSJung-uk Kim } 703