Merge from vendor branch BINUTILS:
[dragonfly.git] / sys / contrib / dev / acpica / utobject.c
1 /******************************************************************************
2  *
3  * Module Name: utobject - ACPI object create/delete/size/cache routines
4  *              $Revision: 82 $
5  *
6  *****************************************************************************/
7
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
13  * All rights reserved.
14  *
15  * 2. License
16  *
17  * 2.1. This is your license from Intel Corp. under its intellectual property
18  * rights.  You may have additional license terms from the party that provided
19  * you this software, covering your right to use that party's intellectual
20  * property rights.
21  *
22  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23  * copy of the source code appearing in this file ("Covered Code") an
24  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25  * base code distributed originally by Intel ("Original Intel Code") to copy,
26  * make derivatives, distribute, use and display any portion of the Covered
27  * Code in any form, with the right to sublicense such rights; and
28  *
29  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30  * license (with the right to sublicense), under only those claims of Intel
31  * patents that are infringed by the Original Intel Code, to make, use, sell,
32  * offer to sell, and import the Covered Code and derivative works thereof
33  * solely to the minimum extent necessary to exercise the above copyright
34  * license, and in no event shall the patent license extend to any additions
35  * to or modifications of the Original Intel Code.  No other license or right
36  * is granted directly or by implication, estoppel or otherwise;
37  *
38  * The above copyright and patent license is granted only if the following
39  * conditions are met:
40  *
41  * 3. Conditions
42  *
43  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44  * Redistribution of source code of any substantial portion of the Covered
45  * Code or modification with rights to further distribute source must include
46  * the above Copyright Notice, the above License, this list of Conditions,
47  * and the following Disclaimer and Export Compliance provision.  In addition,
48  * Licensee must cause all Covered Code to which Licensee contributes to
49  * contain a file documenting the changes Licensee made to create that Covered
50  * Code and the date of any change.  Licensee must include in that file the
51  * documentation of any changes made by any predecessor Licensee.  Licensee
52  * must include a prominent statement that the modification is derived,
53  * directly or indirectly, from Original Intel Code.
54  *
55  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56  * Redistribution of source code of any substantial portion of the Covered
57  * Code or modification without rights to further distribute source must
58  * include the following Disclaimer and Export Compliance provision in the
59  * documentation and/or other materials provided with distribution.  In
60  * addition, Licensee may not authorize further sublicense of source of any
61  * portion of the Covered Code, and must include terms to the effect that the
62  * license from Licensee to its licensee is limited to the intellectual
63  * property embodied in the software Licensee provides to its licensee, and
64  * not to intellectual property embodied in modifications its licensee may
65  * make.
66  *
67  * 3.3. Redistribution of Executable. Redistribution in executable form of any
68  * substantial portion of the Covered Code or modification must reproduce the
69  * above Copyright Notice, and the following Disclaimer and Export Compliance
70  * provision in the documentation and/or other materials provided with the
71  * distribution.
72  *
73  * 3.4. Intel retains all right, title, and interest in and to the Original
74  * Intel Code.
75  *
76  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77  * Intel shall be used in advertising or otherwise to promote the sale, use or
78  * other dealings in products derived from or relating to the Covered Code
79  * without prior written authorization from Intel.
80  *
81  * 4. Disclaimer and Export Compliance
82  *
83  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89  * PARTICULAR PURPOSE.
90  *
91  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98  * LIMITED REMEDY.
99  *
100  * 4.3. Licensee shall not export, either directly or indirectly, any of this
101  * software or system incorporating such software without first obtaining any
102  * required license or other approval from the U. S. Department of Commerce or
103  * any other agency or department of the United States Government.  In the
104  * event Licensee exports any such software from the United States or
105  * re-exports any such software from a foreign destination, Licensee shall
106  * ensure that the distribution and export/re-export of the software is in
107  * compliance with all laws, regulations, orders, or other restrictions of the
108  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109  * any of its subsidiaries will export/re-export any technical data, process,
110  * software, or service, directly or indirectly, to any country for which the
111  * United States government or any agency thereof requires an export license,
112  * other governmental approval, or letter of assurance, without first obtaining
113  * such license, approval or letter.
114  *
115  *****************************************************************************/
116 /* $DragonFly: src/sys/contrib/dev/acpica/Attic/utobject.c,v 1.1 2003/09/24 03:32:16 drhodus Exp $                                                               */
117
118 #define __UTOBJECT_C__
119
120 #include "acpi.h"
121 #include "acnamesp.h"
122 #include "amlcode.h"
123
124
125 #define _COMPONENT          ACPI_UTILITIES
126         ACPI_MODULE_NAME    ("utobject")
127
128
129 /*******************************************************************************
130  *
131  * FUNCTION:    AcpiUtCreateInternalObjectDbg
132  *
133  * PARAMETERS:  ModuleName          - Source file name of caller
134  *              LineNumber          - Line number of caller
135  *              ComponentId         - Component type of caller
136  *              Type                - ACPI Type of the new object
137  *
138  * RETURN:      Object              - The new object.  Null on failure
139  *
140  * DESCRIPTION: Create and initialize a new internal object.
141  *
142  * NOTE:        We always allocate the worst-case object descriptor because
143  *              these objects are cached, and we want them to be
144  *              one-size-satisifies-any-request.  This in itself may not be
145  *              the most memory efficient, but the efficiency of the object
146  *              cache should more than make up for this!
147  *
148  ******************************************************************************/
149
150 ACPI_OPERAND_OBJECT  *
151 AcpiUtCreateInternalObjectDbg (
152     char                    *ModuleName,
153     UINT32                  LineNumber,
154     UINT32                  ComponentId,
155     ACPI_OBJECT_TYPE        Type)
156 {
157     ACPI_OPERAND_OBJECT     *Object;
158     ACPI_OPERAND_OBJECT     *SecondObject;
159
160
161     ACPI_FUNCTION_TRACE_STR ("UtCreateInternalObjectDbg", AcpiUtGetTypeName (Type));
162
163
164     /* Allocate the raw object descriptor */
165
166     Object = AcpiUtAllocateObjectDescDbg (ModuleName, LineNumber, ComponentId);
167     if (!Object)
168     {
169         return_PTR (NULL);
170     }
171
172     switch (Type)
173     {
174     case ACPI_TYPE_REGION:
175     case ACPI_TYPE_BUFFER_FIELD:
176
177         /* These types require a secondary object */
178
179         SecondObject = AcpiUtAllocateObjectDescDbg (ModuleName, LineNumber, ComponentId);
180         if (!SecondObject)
181         {
182             AcpiUtDeleteObjectDesc (Object);
183             return_PTR (NULL);
184         }
185
186         SecondObject->Common.Type = ACPI_TYPE_LOCAL_EXTRA;
187         SecondObject->Common.ReferenceCount = 1;
188
189         /* Link the second object to the first */
190
191         Object->Common.NextObject = SecondObject;
192         break;
193
194     default:
195         /* All others have no secondary object */
196         break;
197     }
198
199     /* Save the object type in the object descriptor */
200
201     Object->Common.Type = (UINT8) Type;
202
203     /* Init the reference count */
204
205     Object->Common.ReferenceCount = 1;
206
207     /* Any per-type initialization should go here */
208
209     return_PTR (Object);
210 }
211
212
213 /*******************************************************************************
214  *
215  * FUNCTION:    AcpiUtCreateBufferObject
216  *
217  * PARAMETERS:  BufferSize             - Size of buffer to be created
218  *
219  * RETURN:      Pointer to a new Buffer object
220  *
221  * DESCRIPTION: Create a fully initialized buffer object
222  *
223  ******************************************************************************/
224
225 ACPI_OPERAND_OBJECT *
226 AcpiUtCreateBufferObject (
227     ACPI_SIZE               BufferSize)
228 {
229     ACPI_OPERAND_OBJECT     *BufferDesc;
230     UINT8                   *Buffer;
231
232
233     ACPI_FUNCTION_TRACE_U32 ("UtCreateBufferObject", BufferSize);
234
235
236     /*
237      * Create a new Buffer object
238      */
239     BufferDesc = AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER);
240     if (!BufferDesc)
241     {
242         return_PTR (NULL);
243     }
244
245     /* Allocate the actual buffer */
246
247     Buffer = ACPI_MEM_CALLOCATE (BufferSize);
248     if (!Buffer)
249     {
250         ACPI_REPORT_ERROR (("CreateBuffer: could not allocate size %X\n",
251             (UINT32) BufferSize));
252         AcpiUtRemoveReference (BufferDesc);
253         return_PTR (NULL);
254     }
255
256     /* Complete buffer object initialization */
257
258     BufferDesc->Buffer.Flags |= AOPOBJ_DATA_VALID;
259     BufferDesc->Buffer.Pointer = Buffer;
260     BufferDesc->Buffer.Length = (UINT32) BufferSize;
261
262     /* Return the new buffer descriptor */
263
264     return_PTR (BufferDesc);
265 }
266
267
268 /*******************************************************************************
269  *
270  * FUNCTION:    AcpiUtValidInternalObject
271  *
272  * PARAMETERS:  Object              - Object to be validated
273  *
274  * RETURN:      Validate a pointer to be an ACPI_OPERAND_OBJECT
275  *
276  ******************************************************************************/
277
278 BOOLEAN
279 AcpiUtValidInternalObject (
280     void                    *Object)
281 {
282
283     ACPI_FUNCTION_NAME ("UtValidInternalObject");
284
285
286     /* Check for a null pointer */
287
288     if (!Object)
289     {
290         ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Null Object Ptr\n"));
291         return (FALSE);
292     }
293
294     /* Check the descriptor type field */
295
296     switch (ACPI_GET_DESCRIPTOR_TYPE (Object))
297     {
298     case ACPI_DESC_TYPE_OPERAND:
299
300         /* The object appears to be a valid ACPI_OPERAND_OBJECT  */
301
302         return (TRUE);
303
304     case ACPI_DESC_TYPE_NAMED:
305
306         ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
307             "**** Obj %p is a named obj, not ACPI obj\n", Object));
308         break;
309
310     case ACPI_DESC_TYPE_PARSER:
311
312         ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
313             "**** Obj %p is a parser obj, not ACPI obj\n", Object));
314         break;
315
316     case ACPI_DESC_TYPE_CACHED:
317
318         ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
319             "**** Obj %p has already been released to internal cache\n", Object));
320         break;
321
322     default:
323
324         ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
325             "**** Obj %p has unknown descriptor type %X\n", Object,
326             ACPI_GET_DESCRIPTOR_TYPE (Object)));
327         break;
328     }
329
330     return (FALSE);
331 }
332
333
334 /*******************************************************************************
335  *
336  * FUNCTION:    AcpiUtAllocateObjectDescDbg
337  *
338  * PARAMETERS:  ModuleName          - Caller's module name (for error output)
339  *              LineNumber          - Caller's line number (for error output)
340  *              ComponentId         - Caller's component ID (for error output)
341  *
342  * RETURN:      Pointer to newly allocated object descriptor.  Null on error
343  *
344  * DESCRIPTION: Allocate a new object descriptor.  Gracefully handle
345  *              error conditions.
346  *
347  ******************************************************************************/
348
349 void *
350 AcpiUtAllocateObjectDescDbg (
351     char                    *ModuleName,
352     UINT32                  LineNumber,
353     UINT32                  ComponentId)
354 {
355     ACPI_OPERAND_OBJECT     *Object;
356
357
358     ACPI_FUNCTION_TRACE ("UtAllocateObjectDescDbg");
359
360
361     Object = AcpiUtAcquireFromCache (ACPI_MEM_LIST_OPERAND);
362     if (!Object)
363     {
364         _ACPI_REPORT_ERROR (ModuleName, LineNumber, ComponentId,
365                         ("Could not allocate an object descriptor\n"));
366
367         return_PTR (NULL);
368     }
369
370     /* Mark the descriptor type */
371
372     ACPI_SET_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_OPERAND);
373
374     ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p Size %X\n",
375             Object, (UINT32) sizeof (ACPI_OPERAND_OBJECT)));
376
377     return_PTR (Object);
378 }
379
380
381 /*******************************************************************************
382  *
383  * FUNCTION:    AcpiUtDeleteObjectDesc
384  *
385  * PARAMETERS:  Object          - An Acpi internal object to be deleted
386  *
387  * RETURN:      None.
388  *
389  * DESCRIPTION: Free an ACPI object descriptor or add it to the object cache
390  *
391  ******************************************************************************/
392
393 void
394 AcpiUtDeleteObjectDesc (
395     ACPI_OPERAND_OBJECT     *Object)
396 {
397     ACPI_FUNCTION_TRACE_PTR ("UtDeleteObjectDesc", Object);
398
399
400     /* Object must be an ACPI_OPERAND_OBJECT  */
401
402     if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND)
403     {
404         ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
405             "Obj %p is not an ACPI object\n", Object));
406         return_VOID;
407     }
408
409     AcpiUtReleaseToCache (ACPI_MEM_LIST_OPERAND, Object);
410
411     return_VOID;
412 }
413
414
415 /*******************************************************************************
416  *
417  * FUNCTION:    AcpiUtDeleteObjectCache
418  *
419  * PARAMETERS:  None
420  *
421  * RETURN:      None
422  *
423  * DESCRIPTION: Purge the global state object cache.  Used during subsystem
424  *              termination.
425  *
426  ******************************************************************************/
427
428 void
429 AcpiUtDeleteObjectCache (
430     void)
431 {
432     ACPI_FUNCTION_TRACE ("UtDeleteObjectCache");
433
434
435     AcpiUtDeleteGenericCache (ACPI_MEM_LIST_OPERAND);
436     return_VOID;
437 }
438
439
440 /*******************************************************************************
441  *
442  * FUNCTION:    AcpiUtGetSimpleObjectSize
443  *
444  * PARAMETERS:  *InternalObject     - Pointer to the object we are examining
445  *              *ObjLength          - Where the length is returned
446  *
447  * RETURN:      Status
448  *
449  * DESCRIPTION: This function is called to determine the space required to
450  *              contain a simple object for return to an external user.
451  *
452  *              The length includes the object structure plus any additional
453  *              needed space.
454  *
455  ******************************************************************************/
456
457 ACPI_STATUS
458 AcpiUtGetSimpleObjectSize (
459     ACPI_OPERAND_OBJECT     *InternalObject,
460     ACPI_SIZE               *ObjLength)
461 {
462     ACPI_SIZE               Length;
463     ACPI_STATUS             Status = AE_OK;
464
465
466     ACPI_FUNCTION_TRACE_PTR ("UtGetSimpleObjectSize", InternalObject);
467
468
469     /* Handle a null object (Could be a uninitialized package element -- which is legal) */
470
471     if (!InternalObject)
472     {
473         *ObjLength = 0;
474         return_ACPI_STATUS (AE_OK);
475     }
476
477     /* Start with the length of the Acpi object */
478
479     Length = sizeof (ACPI_OBJECT);
480
481     if (ACPI_GET_DESCRIPTOR_TYPE (InternalObject) == ACPI_DESC_TYPE_NAMED)
482     {
483         /* Object is a named object (reference), just return the length */
484
485         *ObjLength = ACPI_ROUND_UP_TO_NATIVE_WORD (Length);
486         return_ACPI_STATUS (Status);
487     }
488
489     /*
490      * The final length depends on the object type
491      * Strings and Buffers are packed right up against the parent object and
492      * must be accessed bytewise or there may be alignment problems on
493      * certain processors
494      */
495     switch (ACPI_GET_OBJECT_TYPE (InternalObject))
496     {
497     case ACPI_TYPE_STRING:
498
499         Length += (ACPI_SIZE) InternalObject->String.Length + 1;
500         break;
501
502
503     case ACPI_TYPE_BUFFER:
504
505         Length += (ACPI_SIZE) InternalObject->Buffer.Length;
506         break;
507
508
509     case ACPI_TYPE_INTEGER:
510     case ACPI_TYPE_PROCESSOR:
511     case ACPI_TYPE_POWER:
512
513         /*
514          * No extra data for these types
515          */
516         break;
517
518
519     case ACPI_TYPE_LOCAL_REFERENCE:
520
521         switch (InternalObject->Reference.Opcode)
522         {
523         case AML_INT_NAMEPATH_OP:
524
525             /*
526              * Get the actual length of the full pathname to this object.
527              * The reference will be converted to the pathname to the object
528              */
529             Length += ACPI_ROUND_UP_TO_NATIVE_WORD (AcpiNsGetPathnameLength (InternalObject->Reference.Node));
530             break;
531
532         default:
533
534             /*
535              * No other reference opcodes are supported.
536              * Notably, Locals and Args are not supported, but this may be
537              * required eventually.
538              */
539             ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
540                 "Unsupported Reference opcode=%X in object %p\n",
541                 InternalObject->Reference.Opcode, InternalObject));
542             Status = AE_TYPE;
543             break;
544         }
545         break;
546
547
548     default:
549
550         ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unsupported type=%X in object %p\n",
551             ACPI_GET_OBJECT_TYPE (InternalObject), InternalObject));
552         Status = AE_TYPE;
553         break;
554     }
555
556     /*
557      * Account for the space required by the object rounded up to the next
558      * multiple of the machine word size.  This keeps each object aligned
559      * on a machine word boundary. (preventing alignment faults on some
560      * machines.)
561      */
562     *ObjLength = ACPI_ROUND_UP_TO_NATIVE_WORD (Length);
563     return_ACPI_STATUS (Status);
564 }
565
566
567 /*******************************************************************************
568  *
569  * FUNCTION:    AcpiUtGetElementLength
570  *
571  * PARAMETERS:  ACPI_PKG_CALLBACK
572  *
573  * RETURN:      Status
574  *
575  * DESCRIPTION: Get the length of one package element.
576  *
577  ******************************************************************************/
578
579 ACPI_STATUS
580 AcpiUtGetElementLength (
581     UINT8                   ObjectType,
582     ACPI_OPERAND_OBJECT     *SourceObject,
583     ACPI_GENERIC_STATE      *State,
584     void                    *Context)
585 {
586     ACPI_STATUS             Status = AE_OK;
587     ACPI_PKG_INFO           *Info = (ACPI_PKG_INFO *) Context;
588     ACPI_SIZE               ObjectSpace;
589
590
591     switch (ObjectType)
592     {
593     case ACPI_COPY_TYPE_SIMPLE:
594
595         /*
596          * Simple object - just get the size (Null object/entry is handled
597          * here also) and sum it into the running package length
598          */
599         Status = AcpiUtGetSimpleObjectSize (SourceObject, &ObjectSpace);
600         if (ACPI_FAILURE (Status))
601         {
602             return (Status);
603         }
604
605         Info->Length += ObjectSpace;
606         break;
607
608
609     case ACPI_COPY_TYPE_PACKAGE:
610
611         /* Package object - nothing much to do here, let the walk handle it */
612
613         Info->NumPackages++;
614         State->Pkg.ThisTargetObj = NULL;
615         break;
616
617
618     default:
619
620         /* No other types allowed */
621
622         return (AE_BAD_PARAMETER);
623     }
624
625     return (Status);
626 }
627
628
629 /*******************************************************************************
630  *
631  * FUNCTION:    AcpiUtGetPackageObjectSize
632  *
633  * PARAMETERS:  *InternalObject     - Pointer to the object we are examining
634  *              *ObjLength          - Where the length is returned
635  *
636  * RETURN:      Status
637  *
638  * DESCRIPTION: This function is called to determine the space required to
639  *              contain a package object for return to an external user.
640  *
641  *              This is moderately complex since a package contains other
642  *              objects including packages.
643  *
644  ******************************************************************************/
645
646 ACPI_STATUS
647 AcpiUtGetPackageObjectSize (
648     ACPI_OPERAND_OBJECT     *InternalObject,
649     ACPI_SIZE               *ObjLength)
650 {
651     ACPI_STATUS             Status;
652     ACPI_PKG_INFO           Info;
653
654
655     ACPI_FUNCTION_TRACE_PTR ("UtGetPackageObjectSize", InternalObject);
656
657
658     Info.Length      = 0;
659     Info.ObjectSpace = 0;
660     Info.NumPackages = 1;
661
662     Status = AcpiUtWalkPackageTree (InternalObject, NULL,
663                             AcpiUtGetElementLength, &Info);
664     if (ACPI_FAILURE (Status))
665     {
666         return_ACPI_STATUS (Status);
667     }
668
669     /*
670      * We have handled all of the objects in all levels of the package.
671      * just add the length of the package objects themselves.
672      * Round up to the next machine word.
673      */
674     Info.Length += ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT)) *
675                     (ACPI_SIZE) Info.NumPackages;
676
677     /* Return the total package length */
678
679     *ObjLength = Info.Length;
680     return_ACPI_STATUS (Status);
681 }
682
683
684 /*******************************************************************************
685  *
686  * FUNCTION:    AcpiUtGetObjectSize
687  *
688  * PARAMETERS:  *InternalObject     - Pointer to the object we are examining
689  *              *ObjLength          - Where the length will be returned
690  *
691  * RETURN:      Status
692  *
693  * DESCRIPTION: This function is called to determine the space required to
694  *              contain an object for return to an API user.
695  *
696  ******************************************************************************/
697
698 ACPI_STATUS
699 AcpiUtGetObjectSize(
700     ACPI_OPERAND_OBJECT     *InternalObject,
701     ACPI_SIZE               *ObjLength)
702 {
703     ACPI_STATUS             Status;
704
705
706     ACPI_FUNCTION_ENTRY ();
707
708
709     if ((ACPI_GET_DESCRIPTOR_TYPE (InternalObject) == ACPI_DESC_TYPE_OPERAND) &&
710         (ACPI_GET_OBJECT_TYPE (InternalObject) == ACPI_TYPE_PACKAGE))
711     {
712         Status = AcpiUtGetPackageObjectSize (InternalObject, ObjLength);
713     }
714     else
715     {
716         Status = AcpiUtGetSimpleObjectSize (InternalObject, ObjLength);
717     }
718
719     return (Status);
720 }
721
722