Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:03

0001 /******************************************************************************
0002  *
0003  * Module Name: utids - support for device IDs - HID, UID, CID, SUB, CLS
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 "acinterp.h"
0155 
0156 
0157 #define _COMPONENT          ACPI_UTILITIES
0158         ACPI_MODULE_NAME    ("utids")
0159 
0160 
0161 /*******************************************************************************
0162  *
0163  * FUNCTION:    AcpiUtExecute_HID
0164  *
0165  * PARAMETERS:  DeviceNode          - Node for the device
0166  *              ReturnId            - Where the string HID is returned
0167  *
0168  * RETURN:      Status
0169  *
0170  * DESCRIPTION: Executes the _HID control method that returns the hardware
0171  *              ID of the device. The HID is either an 32-bit encoded EISAID
0172  *              Integer or a String. A string is always returned. An EISAID
0173  *              is converted to a string.
0174  *
0175  *              NOTE: Internal function, no parameter validation
0176  *
0177  ******************************************************************************/
0178 
0179 ACPI_STATUS
0180 AcpiUtExecute_HID (
0181     ACPI_NAMESPACE_NODE     *DeviceNode,
0182     ACPI_PNP_DEVICE_ID      **ReturnId)
0183 {
0184     ACPI_OPERAND_OBJECT     *ObjDesc;
0185     ACPI_PNP_DEVICE_ID      *Hid;
0186     UINT32                  Length;
0187     ACPI_STATUS             Status;
0188 
0189 
0190     ACPI_FUNCTION_TRACE (UtExecute_HID);
0191 
0192 
0193     Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__HID,
0194         ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc);
0195     if (ACPI_FAILURE (Status))
0196     {
0197         return_ACPI_STATUS (Status);
0198     }
0199 
0200     /* Get the size of the String to be returned, includes null terminator */
0201 
0202     if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER)
0203     {
0204         Length = ACPI_EISAID_STRING_SIZE;
0205     }
0206     else
0207     {
0208         Length = ObjDesc->String.Length + 1;
0209     }
0210 
0211     /* Allocate a buffer for the HID */
0212 
0213     Hid = ACPI_ALLOCATE_ZEROED (
0214         sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
0215     if (!Hid)
0216     {
0217         Status = AE_NO_MEMORY;
0218         goto Cleanup;
0219     }
0220 
0221     /* Area for the string starts after PNP_DEVICE_ID struct */
0222 
0223     Hid->String = ACPI_ADD_PTR (char, Hid, sizeof (ACPI_PNP_DEVICE_ID));
0224 
0225     /* Convert EISAID to a string or simply copy existing string */
0226 
0227     if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER)
0228     {
0229         AcpiExEisaIdToString (Hid->String, ObjDesc->Integer.Value);
0230     }
0231     else
0232     {
0233         strcpy (Hid->String, ObjDesc->String.Pointer);
0234     }
0235 
0236     Hid->Length = Length;
0237     *ReturnId = Hid;
0238 
0239 
0240 Cleanup:
0241 
0242     /* On exit, we must delete the return object */
0243 
0244     AcpiUtRemoveReference (ObjDesc);
0245     return_ACPI_STATUS (Status);
0246 }
0247 
0248 
0249 /*******************************************************************************
0250  *
0251  * FUNCTION:    AcpiUtExecute_UID
0252  *
0253  * PARAMETERS:  DeviceNode          - Node for the device
0254  *              ReturnId            - Where the string UID is returned
0255  *
0256  * RETURN:      Status
0257  *
0258  * DESCRIPTION: Executes the _UID control method that returns the unique
0259  *              ID of the device. The UID is either a 64-bit Integer (NOT an
0260  *              EISAID) or a string. Always returns a string. A 64-bit integer
0261  *              is converted to a decimal string.
0262  *
0263  *              NOTE: Internal function, no parameter validation
0264  *
0265  ******************************************************************************/
0266 
0267 ACPI_STATUS
0268 AcpiUtExecute_UID (
0269     ACPI_NAMESPACE_NODE     *DeviceNode,
0270     ACPI_PNP_DEVICE_ID      **ReturnId)
0271 {
0272     ACPI_OPERAND_OBJECT     *ObjDesc;
0273     ACPI_PNP_DEVICE_ID      *Uid;
0274     UINT32                  Length;
0275     ACPI_STATUS             Status;
0276 
0277 
0278     ACPI_FUNCTION_TRACE (UtExecute_UID);
0279 
0280 
0281     Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__UID,
0282         ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc);
0283     if (ACPI_FAILURE (Status))
0284     {
0285         return_ACPI_STATUS (Status);
0286     }
0287 
0288     /* Get the size of the String to be returned, includes null terminator */
0289 
0290     if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER)
0291     {
0292         Length = ACPI_MAX64_DECIMAL_DIGITS + 1;
0293     }
0294     else
0295     {
0296         Length = ObjDesc->String.Length + 1;
0297     }
0298 
0299     /* Allocate a buffer for the UID */
0300 
0301     Uid = ACPI_ALLOCATE_ZEROED (
0302         sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
0303     if (!Uid)
0304     {
0305         Status = AE_NO_MEMORY;
0306         goto Cleanup;
0307     }
0308 
0309     /* Area for the string starts after PNP_DEVICE_ID struct */
0310 
0311     Uid->String = ACPI_ADD_PTR (char, Uid, sizeof (ACPI_PNP_DEVICE_ID));
0312 
0313     /* Convert an Integer to string, or just copy an existing string */
0314 
0315     if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER)
0316     {
0317         AcpiExIntegerToString (Uid->String, ObjDesc->Integer.Value);
0318     }
0319     else
0320     {
0321         strcpy (Uid->String, ObjDesc->String.Pointer);
0322     }
0323 
0324     Uid->Length = Length;
0325     *ReturnId = Uid;
0326 
0327 
0328 Cleanup:
0329 
0330     /* On exit, we must delete the return object */
0331 
0332     AcpiUtRemoveReference (ObjDesc);
0333     return_ACPI_STATUS (Status);
0334 }
0335 
0336 
0337 /*******************************************************************************
0338  *
0339  * FUNCTION:    AcpiUtExecute_CID
0340  *
0341  * PARAMETERS:  DeviceNode          - Node for the device
0342  *              ReturnCidList       - Where the CID list is returned
0343  *
0344  * RETURN:      Status, list of CID strings
0345  *
0346  * DESCRIPTION: Executes the _CID control method that returns one or more
0347  *              compatible hardware IDs for the device.
0348  *
0349  *              NOTE: Internal function, no parameter validation
0350  *
0351  * A _CID method can return either a single compatible ID or a package of
0352  * compatible IDs. Each compatible ID can be one of the following:
0353  * 1) Integer (32 bit compressed EISA ID) or
0354  * 2) String (PCI ID format, e.g. "PCI\VEN_vvvv&DEV_dddd&SUBSYS_ssssssss")
0355  *
0356  * The Integer CIDs are converted to string format by this function.
0357  *
0358  ******************************************************************************/
0359 
0360 ACPI_STATUS
0361 AcpiUtExecute_CID (
0362     ACPI_NAMESPACE_NODE     *DeviceNode,
0363     ACPI_PNP_DEVICE_ID_LIST **ReturnCidList)
0364 {
0365     ACPI_OPERAND_OBJECT     **CidObjects;
0366     ACPI_OPERAND_OBJECT     *ObjDesc;
0367     ACPI_PNP_DEVICE_ID_LIST *CidList;
0368     char                    *NextIdString;
0369     UINT32                  StringAreaSize;
0370     UINT32                  Length;
0371     UINT32                  CidListSize;
0372     ACPI_STATUS             Status;
0373     UINT32                  Count;
0374     UINT32                  i;
0375 
0376 
0377     ACPI_FUNCTION_TRACE (UtExecute_CID);
0378 
0379 
0380     /* Evaluate the _CID method for this device */
0381 
0382     Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__CID,
0383         ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_PACKAGE,
0384         &ObjDesc);
0385     if (ACPI_FAILURE (Status))
0386     {
0387         return_ACPI_STATUS (Status);
0388     }
0389 
0390     /*
0391      * Get the count and size of the returned _CIDs. _CID can return either
0392      * a Package of Integers/Strings or a single Integer or String.
0393      * Note: This section also validates that all CID elements are of the
0394      * correct type (Integer or String).
0395      */
0396     if (ObjDesc->Common.Type == ACPI_TYPE_PACKAGE)
0397     {
0398         Count = ObjDesc->Package.Count;
0399         CidObjects = ObjDesc->Package.Elements;
0400     }
0401     else /* Single Integer or String CID */
0402     {
0403         Count = 1;
0404         CidObjects = &ObjDesc;
0405     }
0406 
0407     StringAreaSize = 0;
0408     for (i = 0; i < Count; i++)
0409     {
0410         /* String lengths include null terminator */
0411 
0412         switch (CidObjects[i]->Common.Type)
0413         {
0414         case ACPI_TYPE_INTEGER:
0415 
0416             StringAreaSize += ACPI_EISAID_STRING_SIZE;
0417             break;
0418 
0419         case ACPI_TYPE_STRING:
0420 
0421             StringAreaSize += CidObjects[i]->String.Length + 1;
0422             break;
0423 
0424         default:
0425 
0426             Status = AE_TYPE;
0427             goto Cleanup;
0428         }
0429     }
0430 
0431     /*
0432      * Now that we know the length of the CIDs, allocate return buffer:
0433      * 1) Size of the base structure +
0434      * 2) Size of the CID PNP_DEVICE_ID array +
0435      * 3) Size of the actual CID strings
0436      */
0437     CidListSize = sizeof (ACPI_PNP_DEVICE_ID_LIST) +
0438         (Count * sizeof (ACPI_PNP_DEVICE_ID)) +
0439         StringAreaSize;
0440 
0441     CidList = ACPI_ALLOCATE_ZEROED (CidListSize);
0442     if (!CidList)
0443     {
0444         Status = AE_NO_MEMORY;
0445         goto Cleanup;
0446     }
0447 
0448     /* Area for CID strings starts after the CID PNP_DEVICE_ID array */
0449 
0450     NextIdString = ACPI_CAST_PTR (char, CidList->Ids) +
0451         ((ACPI_SIZE) Count * sizeof (ACPI_PNP_DEVICE_ID));
0452 
0453     /* Copy/convert the CIDs to the return buffer */
0454 
0455     for (i = 0; i < Count; i++)
0456     {
0457         if (CidObjects[i]->Common.Type == ACPI_TYPE_INTEGER)
0458         {
0459             /* Convert the Integer (EISAID) CID to a string */
0460 
0461             AcpiExEisaIdToString (
0462                 NextIdString, CidObjects[i]->Integer.Value);
0463             Length = ACPI_EISAID_STRING_SIZE;
0464         }
0465         else /* ACPI_TYPE_STRING */
0466         {
0467             /* Copy the String CID from the returned object */
0468 
0469             strcpy (NextIdString, CidObjects[i]->String.Pointer);
0470             Length = CidObjects[i]->String.Length + 1;
0471         }
0472 
0473         CidList->Ids[i].String = NextIdString;
0474         CidList->Ids[i].Length = Length;
0475         NextIdString += Length;
0476     }
0477 
0478     /* Finish the CID list */
0479 
0480     CidList->Count = Count;
0481     CidList->ListSize = CidListSize;
0482     *ReturnCidList = CidList;
0483 
0484 
0485 Cleanup:
0486 
0487     /* On exit, we must delete the _CID return object */
0488 
0489     AcpiUtRemoveReference (ObjDesc);
0490     return_ACPI_STATUS (Status);
0491 }
0492 
0493 
0494 /*******************************************************************************
0495  *
0496  * FUNCTION:    AcpiUtExecute_CLS
0497  *
0498  * PARAMETERS:  DeviceNode          - Node for the device
0499  *              ReturnId            - Where the _CLS is returned
0500  *
0501  * RETURN:      Status
0502  *
0503  * DESCRIPTION: Executes the _CLS control method that returns PCI-defined
0504  *              class code of the device. The _CLS value is always a package
0505  *              containing PCI class information as a list of integers.
0506  *              The returned string has format "BBSSPP", where:
0507  *                BB = Base-class code
0508  *                SS = Sub-class code
0509  *                PP = Programming Interface code
0510  *
0511  ******************************************************************************/
0512 
0513 ACPI_STATUS
0514 AcpiUtExecute_CLS (
0515     ACPI_NAMESPACE_NODE     *DeviceNode,
0516     ACPI_PNP_DEVICE_ID      **ReturnId)
0517 {
0518     ACPI_OPERAND_OBJECT     *ObjDesc;
0519     ACPI_OPERAND_OBJECT     **ClsObjects;
0520     UINT32                  Count;
0521     ACPI_PNP_DEVICE_ID      *Cls;
0522     UINT32                  Length;
0523     ACPI_STATUS             Status;
0524     UINT8                   ClassCode[3] = {0, 0, 0};
0525 
0526 
0527     ACPI_FUNCTION_TRACE (UtExecute_CLS);
0528 
0529 
0530     Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__CLS,
0531         ACPI_BTYPE_PACKAGE, &ObjDesc);
0532     if (ACPI_FAILURE (Status))
0533     {
0534         return_ACPI_STATUS (Status);
0535     }
0536 
0537     /* Get the size of the String to be returned, includes null terminator */
0538 
0539     Length = ACPI_PCICLS_STRING_SIZE;
0540     ClsObjects = ObjDesc->Package.Elements;
0541     Count = ObjDesc->Package.Count;
0542 
0543     if (ObjDesc->Common.Type == ACPI_TYPE_PACKAGE)
0544     {
0545         if (Count > 0 && ClsObjects[0]->Common.Type == ACPI_TYPE_INTEGER)
0546         {
0547             ClassCode[0] = (UINT8) ClsObjects[0]->Integer.Value;
0548         }
0549         if (Count > 1 && ClsObjects[1]->Common.Type == ACPI_TYPE_INTEGER)
0550         {
0551             ClassCode[1] = (UINT8) ClsObjects[1]->Integer.Value;
0552         }
0553         if (Count > 2 && ClsObjects[2]->Common.Type == ACPI_TYPE_INTEGER)
0554         {
0555             ClassCode[2] = (UINT8) ClsObjects[2]->Integer.Value;
0556         }
0557     }
0558 
0559     /* Allocate a buffer for the CLS */
0560 
0561     Cls = ACPI_ALLOCATE_ZEROED (
0562         sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
0563     if (!Cls)
0564     {
0565         Status = AE_NO_MEMORY;
0566         goto Cleanup;
0567     }
0568 
0569     /* Area for the string starts after PNP_DEVICE_ID struct */
0570 
0571     Cls->String = ACPI_ADD_PTR (char, Cls, sizeof (ACPI_PNP_DEVICE_ID));
0572 
0573     /* Simply copy existing string */
0574 
0575     AcpiExPciClsToString (Cls->String, ClassCode);
0576     Cls->Length = Length;
0577     *ReturnId = Cls;
0578 
0579 
0580 Cleanup:
0581 
0582     /* On exit, we must delete the return object */
0583 
0584     AcpiUtRemoveReference (ObjDesc);
0585     return_ACPI_STATUS (Status);
0586 }