1 /******************************************************************************
2  *
3  * Module Name: exdump - Interpreter debug output routines
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2014, Intel Corp.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions, and the following disclaimer,
16  *    without modification.
17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18  *    substantially similar to the "NO WARRANTY" disclaimer below
19  *    ("Disclaimer") and any redistribution must be conditioned upon
20  *    including a substantially similar Disclaimer requirement for further
21  *    binary redistribution.
22  * 3. Neither the names of the above-listed copyright holders nor the names
23  *    of any contributors may be used to endorse or promote products derived
24  *    from this software without specific prior written permission.
25  *
26  * Alternatively, this software may be distributed under the terms of the
27  * GNU General Public License ("GPL") version 2 as published by the Free
28  * Software Foundation.
29  *
30  * NO WARRANTY
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41  * POSSIBILITY OF SUCH DAMAGES.
42  */
43 
44 #define __EXDUMP_C__
45 
46 #include "acpi.h"
47 #include "accommon.h"
48 #include "acinterp.h"
49 #include "amlcode.h"
50 #include "acnamesp.h"
51 
52 
53 #define _COMPONENT          ACPI_EXECUTER
54         ACPI_MODULE_NAME    ("exdump")
55 
56 /*
57  * The following routines are used for debug output only
58  */
59 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
60 
61 /* Local prototypes */
62 
63 static void
64 AcpiExOutString (
65     char                    *Title,
66     char                    *Value);
67 
68 static void
69 AcpiExOutPointer (
70     char                    *Title,
71     void                    *Value);
72 
73 static void
74 AcpiExDumpObject (
75     ACPI_OPERAND_OBJECT     *ObjDesc,
76     ACPI_EXDUMP_INFO        *Info);
77 
78 static void
79 AcpiExDumpReferenceObj (
80     ACPI_OPERAND_OBJECT     *ObjDesc);
81 
82 static void
83 AcpiExDumpPackageObj (
84     ACPI_OPERAND_OBJECT     *ObjDesc,
85     UINT32                  Level,
86     UINT32                  Index);
87 
88 
89 /*******************************************************************************
90  *
91  * Object Descriptor info tables
92  *
93  * Note: The first table entry must be an INIT opcode and must contain
94  * the table length (number of table entries)
95  *
96  ******************************************************************************/
97 
98 static ACPI_EXDUMP_INFO     AcpiExDumpInteger[2] =
99 {
100     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpInteger),        NULL},
101     {ACPI_EXD_UINT64,   ACPI_EXD_OFFSET (Integer.Value),                "Value"}
102 };
103 
104 static ACPI_EXDUMP_INFO     AcpiExDumpString[4] =
105 {
106     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpString),         NULL},
107     {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (String.Length),                "Length"},
108     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (String.Pointer),               "Pointer"},
109     {ACPI_EXD_STRING,   0,                                              NULL}
110 };
111 
112 static ACPI_EXDUMP_INFO     AcpiExDumpBuffer[5] =
113 {
114     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpBuffer),         NULL},
115     {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (Buffer.Length),                "Length"},
116     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Buffer.Pointer),               "Pointer"},
117     {ACPI_EXD_NODE,     ACPI_EXD_OFFSET (Buffer.Node),                  "Parent Node"},
118     {ACPI_EXD_BUFFER,   0,                                              NULL}
119 };
120 
121 static ACPI_EXDUMP_INFO     AcpiExDumpPackage[6] =
122 {
123     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpPackage),        NULL},
124     {ACPI_EXD_NODE,     ACPI_EXD_OFFSET (Package.Node),                 "Parent Node"},
125     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Package.Flags),                "Flags"},
126     {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (Package.Count),                "Elements"},
127     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Package.Elements),             "Element List"},
128     {ACPI_EXD_PACKAGE,  0,                                              NULL}
129 };
130 
131 static ACPI_EXDUMP_INFO     AcpiExDumpDevice[4] =
132 {
133     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpDevice),         NULL},
134     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Device.NotifyList[0]),         "System Notify"},
135     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Device.NotifyList[1]),         "Device Notify"},
136     {ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (Device.Handler),               "Handler"}
137 };
138 
139 static ACPI_EXDUMP_INFO     AcpiExDumpEvent[2] =
140 {
141     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpEvent),          NULL},
142     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Event.OsSemaphore),            "OsSemaphore"}
143 };
144 
145 static ACPI_EXDUMP_INFO     AcpiExDumpMethod[9] =
146 {
147     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpMethod),         NULL},
148     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Method.InfoFlags),             "Info Flags"},
149     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Method.ParamCount),            "Parameter Count"},
150     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Method.SyncLevel),             "Sync Level"},
151     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Method.Mutex),                 "Mutex"},
152     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Method.OwnerId),               "Owner Id"},
153     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Method.ThreadCount),           "Thread Count"},
154     {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (Method.AmlLength),             "Aml Length"},
155     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Method.AmlStart),              "Aml Start"}
156 };
157 
158 static ACPI_EXDUMP_INFO     AcpiExDumpMutex[5] =
159 {
160     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpMutex),          NULL},
161     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Mutex.SyncLevel),              "Sync Level"},
162     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Mutex.OwnerThread),            "Owner Thread"},
163     {ACPI_EXD_UINT16,   ACPI_EXD_OFFSET (Mutex.AcquisitionDepth),       "Acquire Depth"},
164     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Mutex.OsMutex),                "OsMutex"}
165 };
166 
167 static ACPI_EXDUMP_INFO     AcpiExDumpRegion[8] =
168 {
169     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpRegion),         NULL},
170     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Region.SpaceId),               "Space Id"},
171     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Region.Flags),                 "Flags"},
172     {ACPI_EXD_NODE,     ACPI_EXD_OFFSET (Region.Node),                  "Parent Node"},
173     {ACPI_EXD_ADDRESS,  ACPI_EXD_OFFSET (Region.Address),               "Address"},
174     {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (Region.Length),                "Length"},
175     {ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (Region.Handler),               "Handler"},
176     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Region.Next),                  "Next"}
177 };
178 
179 static ACPI_EXDUMP_INFO     AcpiExDumpPower[6] =
180 {
181     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpPower),          NULL},
182     {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (PowerResource.SystemLevel),    "System Level"},
183     {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (PowerResource.ResourceOrder),  "Resource Order"},
184     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (PowerResource.NotifyList[0]),  "System Notify"},
185     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (PowerResource.NotifyList[1]),  "Device Notify"},
186     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (PowerResource.Handler),        "Handler"}
187 };
188 
189 static ACPI_EXDUMP_INFO     AcpiExDumpProcessor[7] =
190 {
191     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpProcessor),      NULL},
192     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Processor.ProcId),             "Processor ID"},
193     {ACPI_EXD_UINT8 ,   ACPI_EXD_OFFSET (Processor.Length),             "Length"},
194     {ACPI_EXD_ADDRESS,  ACPI_EXD_OFFSET (Processor.Address),            "Address"},
195     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Processor.NotifyList[0]),      "System Notify"},
196     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Processor.NotifyList[1]),      "Device Notify"},
197     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Processor.Handler),            "Handler"}
198 };
199 
200 static ACPI_EXDUMP_INFO     AcpiExDumpThermal[4] =
201 {
202     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpThermal),        NULL},
203     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (ThermalZone.NotifyList[0]),    "System Notify"},
204     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (ThermalZone.NotifyList[1]),    "Device Notify"},
205     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (ThermalZone.Handler),          "Handler"}
206 };
207 
208 static ACPI_EXDUMP_INFO     AcpiExDumpBufferField[3] =
209 {
210     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpBufferField),    NULL},
211     {ACPI_EXD_FIELD,    0,                                              NULL},
212     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (BufferField.BufferObj),        "Buffer Object"}
213 };
214 
215 static ACPI_EXDUMP_INFO     AcpiExDumpRegionField[5] =
216 {
217     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpRegionField),    NULL},
218     {ACPI_EXD_FIELD,    0,                                              NULL},
219     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Field.AccessLength),           "AccessLength"},
220     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Field.RegionObj),              "Region Object"},
221     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Field.ResourceBuffer),         "ResourceBuffer"}
222 };
223 
224 static ACPI_EXDUMP_INFO     AcpiExDumpBankField[5] =
225 {
226     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpBankField),      NULL},
227     {ACPI_EXD_FIELD,    0,                                              NULL},
228     {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (BankField.Value),              "Value"},
229     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (BankField.RegionObj),          "Region Object"},
230     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (BankField.BankObj),            "Bank Object"}
231 };
232 
233 static ACPI_EXDUMP_INFO     AcpiExDumpIndexField[5] =
234 {
235     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpBankField),      NULL},
236     {ACPI_EXD_FIELD,    0,                                              NULL},
237     {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (IndexField.Value),             "Value"},
238     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (IndexField.IndexObj),          "Index Object"},
239     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (IndexField.DataObj),           "Data Object"}
240 };
241 
242 static ACPI_EXDUMP_INFO     AcpiExDumpReference[8] =
243 {
244     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpReference),       NULL},
245     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Reference.Class),              "Class"},
246     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Reference.TargetType),         "Target Type"},
247     {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (Reference.Value),              "Value"},
248     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Reference.Object),             "Object Desc"},
249     {ACPI_EXD_NODE,     ACPI_EXD_OFFSET (Reference.Node),               "Node"},
250     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Reference.Where),              "Where"},
251     {ACPI_EXD_REFERENCE,0,                                              NULL}
252 };
253 
254 static ACPI_EXDUMP_INFO     AcpiExDumpAddressHandler[6] =
255 {
256     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpAddressHandler), NULL},
257     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (AddressSpace.SpaceId),         "Space Id"},
258     {ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (AddressSpace.Next),            "Next"},
259     {ACPI_EXD_RGN_LIST, ACPI_EXD_OFFSET (AddressSpace.RegionList),      "Region List"},
260     {ACPI_EXD_NODE,     ACPI_EXD_OFFSET (AddressSpace.Node),            "Node"},
261     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (AddressSpace.Context),         "Context"}
262 };
263 
264 static ACPI_EXDUMP_INFO     AcpiExDumpNotify[7] =
265 {
266     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpNotify),         NULL},
267     {ACPI_EXD_NODE,     ACPI_EXD_OFFSET (Notify.Node),                  "Node"},
268     {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (Notify.HandlerType),           "Handler Type"},
269     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Notify.Handler),               "Handler"},
270     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Notify.Context),               "Context"},
271     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Notify.Next[0]),               "Next System Notify"},
272     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Notify.Next[1]),               "Next Device Notify"}
273 };
274 
275 static ACPI_EXDUMP_INFO     AcpiExDumpExtra[6] =
276 {
277     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpExtra),          NULL},
278     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Extra.Method_REG),             "_REG Method"},
279     {ACPI_EXD_NODE,     ACPI_EXD_OFFSET (Extra.ScopeNode),              "Scope Node"},
280     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Extra.RegionContext),          "Region Context"},
281     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Extra.AmlStart),               "Aml Start"},
282     {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (Extra.AmlLength),              "Aml Length"}
283 };
284 
285 static ACPI_EXDUMP_INFO     AcpiExDumpData[3] =
286 {
287     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpData),           NULL},
288     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Data.Handler),                 "Handler"},
289     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Data.Pointer),                 "Raw Data"}
290 };
291 
292 /* Miscellaneous tables */
293 
294 static ACPI_EXDUMP_INFO     AcpiExDumpCommon[5] =
295 {
296     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpCommon),         NULL},
297     {ACPI_EXD_TYPE ,    0,                                              NULL},
298     {ACPI_EXD_UINT16,   ACPI_EXD_OFFSET (Common.ReferenceCount),        "Reference Count"},
299     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Common.Flags),                 "Flags"},
300     {ACPI_EXD_LIST,     ACPI_EXD_OFFSET (Common.NextObject),            "Object List"}
301 };
302 
303 static ACPI_EXDUMP_INFO     AcpiExDumpFieldCommon[7] =
304 {
305     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpFieldCommon),    NULL},
306     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (CommonField.FieldFlags),       "Field Flags"},
307     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (CommonField.AccessByteWidth),  "Access Byte Width"},
308     {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (CommonField.BitLength),        "Bit Length"},
309     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (CommonField.StartFieldBitOffset),"Field Bit Offset"},
310     {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (CommonField.BaseByteOffset),   "Base Byte Offset"},
311     {ACPI_EXD_NODE,     ACPI_EXD_OFFSET (CommonField.Node),             "Parent Node"}
312 };
313 
314 static ACPI_EXDUMP_INFO     AcpiExDumpNode[7] =
315 {
316     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpNode),           NULL},
317     {ACPI_EXD_UINT8,    ACPI_EXD_NSOFFSET (Flags),                      "Flags"},
318     {ACPI_EXD_UINT8,    ACPI_EXD_NSOFFSET (OwnerId),                    "Owner Id"},
319     {ACPI_EXD_LIST,     ACPI_EXD_NSOFFSET (Object),                     "Object List"},
320     {ACPI_EXD_NODE,     ACPI_EXD_NSOFFSET (Parent),                     "Parent"},
321     {ACPI_EXD_NODE,     ACPI_EXD_NSOFFSET (Child),                      "Child"},
322     {ACPI_EXD_NODE,     ACPI_EXD_NSOFFSET (Peer),                       "Peer"}
323 };
324 
325 
326 /* Dispatch table, indexed by object type */
327 
328 static ACPI_EXDUMP_INFO     *AcpiExDumpInfo[] =
329 {
330     NULL,
331     AcpiExDumpInteger,
332     AcpiExDumpString,
333     AcpiExDumpBuffer,
334     AcpiExDumpPackage,
335     NULL,
336     AcpiExDumpDevice,
337     AcpiExDumpEvent,
338     AcpiExDumpMethod,
339     AcpiExDumpMutex,
340     AcpiExDumpRegion,
341     AcpiExDumpPower,
342     AcpiExDumpProcessor,
343     AcpiExDumpThermal,
344     AcpiExDumpBufferField,
345     NULL,
346     NULL,
347     AcpiExDumpRegionField,
348     AcpiExDumpBankField,
349     AcpiExDumpIndexField,
350     AcpiExDumpReference,
351     NULL,
352     NULL,
353     AcpiExDumpNotify,
354     AcpiExDumpAddressHandler,
355     NULL,
356     NULL,
357     NULL,
358     AcpiExDumpExtra,
359     AcpiExDumpData
360 };
361 
362 
363 /*******************************************************************************
364  *
365  * FUNCTION:    AcpiExDumpObject
366  *
367  * PARAMETERS:  ObjDesc             - Descriptor to dump
368  *              Info                - Info table corresponding to this object
369  *                                    type
370  *
371  * RETURN:      None
372  *
373  * DESCRIPTION: Walk the info table for this object
374  *
375  ******************************************************************************/
376 
377 static void
378 AcpiExDumpObject (
379     ACPI_OPERAND_OBJECT     *ObjDesc,
380     ACPI_EXDUMP_INFO        *Info)
381 {
382     UINT8                   *Target;
383     char                    *Name;
384     const char              *ReferenceName;
385     UINT8                   Count;
386     ACPI_OPERAND_OBJECT     *Start;
387     ACPI_OPERAND_OBJECT     *Data = NULL;
388     ACPI_OPERAND_OBJECT     *Next;
389     ACPI_NAMESPACE_NODE     *Node;
390 
391 
392     if (!Info)
393     {
394         AcpiOsPrintf (
395             "ExDumpObject: Display not implemented for object type %s\n",
396             AcpiUtGetObjectTypeName (ObjDesc));
397         return;
398     }
399 
400     /* First table entry must contain the table length (# of table entries) */
401 
402     Count = Info->Offset;
403 
404     while (Count)
405     {
406         Target = ACPI_ADD_PTR (UINT8, ObjDesc, Info->Offset);
407         Name = Info->Name;
408 
409         switch (Info->Opcode)
410         {
411         case ACPI_EXD_INIT:
412 
413             break;
414 
415         case ACPI_EXD_TYPE:
416 
417             AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
418                 ObjDesc->Common.Type, AcpiUtGetObjectTypeName (ObjDesc));
419             break;
420 
421         case ACPI_EXD_UINT8:
422 
423             AcpiOsPrintf ("%20s : %2.2X\n", Name, *Target);
424             break;
425 
426         case ACPI_EXD_UINT16:
427 
428             AcpiOsPrintf ("%20s : %4.4X\n", Name, ACPI_GET16 (Target));
429             break;
430 
431         case ACPI_EXD_UINT32:
432 
433             AcpiOsPrintf ("%20s : %8.8X\n", Name, ACPI_GET32 (Target));
434             break;
435 
436         case ACPI_EXD_UINT64:
437 
438             AcpiOsPrintf ("%20s : %8.8X%8.8X\n", "Value",
439                 ACPI_FORMAT_UINT64 (ACPI_GET64 (Target)));
440             break;
441 
442         case ACPI_EXD_POINTER:
443         case ACPI_EXD_ADDRESS:
444 
445             AcpiExOutPointer (Name, *ACPI_CAST_PTR (void *, Target));
446             break;
447 
448         case ACPI_EXD_STRING:
449 
450             AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX);
451             AcpiOsPrintf ("\n");
452             break;
453 
454         case ACPI_EXD_BUFFER:
455 
456             ACPI_DUMP_BUFFER (ObjDesc->Buffer.Pointer, ObjDesc->Buffer.Length);
457             break;
458 
459         case ACPI_EXD_PACKAGE:
460 
461             /* Dump the package contents */
462 
463             AcpiOsPrintf ("\nPackage Contents:\n");
464             AcpiExDumpPackageObj (ObjDesc, 0, 0);
465             break;
466 
467         case ACPI_EXD_FIELD:
468 
469             AcpiExDumpObject (ObjDesc, AcpiExDumpFieldCommon);
470             break;
471 
472         case ACPI_EXD_REFERENCE:
473 
474             ReferenceName = AcpiUtGetReferenceName (ObjDesc);
475             AcpiExOutString ("Class Name", ACPI_CAST_PTR (char, ReferenceName));
476             AcpiExDumpReferenceObj (ObjDesc);
477             break;
478 
479         case ACPI_EXD_LIST:
480 
481             Start = *ACPI_CAST_PTR (void *, Target);
482             Next = Start;
483 
484             AcpiOsPrintf ("%20s : %p", Name, Next);
485             if (Next)
486             {
487                 AcpiOsPrintf ("(%s %2.2X)",
488                     AcpiUtGetObjectTypeName (Next), Next->Common.Type);
489 
490                 while (Next->Common.NextObject)
491                 {
492                     if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&
493                         !Data)
494                     {
495                         Data = Next;
496                     }
497 
498                     Next = Next->Common.NextObject;
499                     AcpiOsPrintf ("->%p(%s %2.2X)", Next,
500                         AcpiUtGetObjectTypeName (Next), Next->Common.Type);
501 
502                     if ((Next == Start) || (Next == Data))
503                     {
504                         AcpiOsPrintf ("\n**** Error: Object list appears to be circular linked");
505                         break;
506                     }
507                 }
508             }
509 
510             AcpiOsPrintf ("\n", Next);
511             break;
512 
513         case ACPI_EXD_HDLR_LIST:
514 
515             Start = *ACPI_CAST_PTR (void *, Target);
516             Next = Start;
517 
518             AcpiOsPrintf ("%20s : %p", Name, Next);
519             if (Next)
520             {
521                 AcpiOsPrintf ("(%s %2.2X)",
522                     AcpiUtGetObjectTypeName (Next), Next->Common.Type);
523 
524                 while (Next->AddressSpace.Next)
525                 {
526                     if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&
527                         !Data)
528                     {
529                         Data = Next;
530                     }
531 
532                     Next = Next->AddressSpace.Next;
533                     AcpiOsPrintf ("->%p(%s %2.2X)", Next,
534                         AcpiUtGetObjectTypeName (Next), Next->Common.Type);
535 
536                     if ((Next == Start) || (Next == Data))
537                     {
538                         AcpiOsPrintf ("\n**** Error: Handler list appears to be circular linked");
539                         break;
540                     }
541                 }
542             }
543 
544             AcpiOsPrintf ("\n", Next);
545             break;
546 
547         case ACPI_EXD_RGN_LIST:
548 
549             Start = *ACPI_CAST_PTR (void *, Target);
550             Next = Start;
551 
552             AcpiOsPrintf ("%20s : %p", Name, Next);
553             if (Next)
554             {
555                 AcpiOsPrintf ("(%s %2.2X)",
556                     AcpiUtGetObjectTypeName (Next), Next->Common.Type);
557 
558                 while (Next->Region.Next)
559                 {
560                     if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&
561                         !Data)
562                     {
563                         Data = Next;
564                     }
565 
566                     Next = Next->Region.Next;
567                     AcpiOsPrintf ("->%p(%s %2.2X)", Next,
568                         AcpiUtGetObjectTypeName (Next), Next->Common.Type);
569 
570                     if ((Next == Start) || (Next == Data))
571                     {
572                         AcpiOsPrintf ("\n**** Error: Region list appears to be circular linked");
573                         break;
574                     }
575                 }
576             }
577 
578             AcpiOsPrintf ("\n", Next);
579             break;
580 
581         case ACPI_EXD_NODE:
582 
583             Node = *ACPI_CAST_PTR (ACPI_NAMESPACE_NODE *, Target);
584 
585             AcpiOsPrintf ("%20s : %p", Name, Node);
586             if (Node)
587             {
588                 AcpiOsPrintf (" [%4.4s]", Node->Name.Ascii);
589             }
590             AcpiOsPrintf ("\n");
591             break;
592 
593         default:
594 
595             AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
596                 Info->Opcode);
597             return;
598         }
599 
600         Info++;
601         Count--;
602     }
603 }
604 
605 
606 /*******************************************************************************
607  *
608  * FUNCTION:    AcpiExDumpOperand
609  *
610  * PARAMETERS:  *ObjDesc        - Pointer to entry to be dumped
611  *              Depth           - Current nesting depth
612  *
613  * RETURN:      None
614  *
615  * DESCRIPTION: Dump an operand object
616  *
617  ******************************************************************************/
618 
619 void
620 AcpiExDumpOperand (
621     ACPI_OPERAND_OBJECT     *ObjDesc,
622     UINT32                  Depth)
623 {
624     UINT32                  Length;
625     UINT32                  Index;
626 
627 
628     ACPI_FUNCTION_NAME (ExDumpOperand)
629 
630 
631     /* Check if debug output enabled */
632 
633     if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_EXEC, _COMPONENT))
634     {
635         return;
636     }
637 
638     if (!ObjDesc)
639     {
640         /* This could be a null element of a package */
641 
642         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Null Object Descriptor\n"));
643         return;
644     }
645 
646     if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED)
647     {
648         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p Namespace Node: ", ObjDesc));
649         ACPI_DUMP_ENTRY (ObjDesc, ACPI_LV_EXEC);
650         return;
651     }
652 
653     if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
654     {
655         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
656             "%p is not a node or operand object: [%s]\n",
657             ObjDesc, AcpiUtGetDescriptorName (ObjDesc)));
658         ACPI_DUMP_BUFFER (ObjDesc, sizeof (ACPI_OPERAND_OBJECT));
659         return;
660     }
661 
662     /* ObjDesc is a valid object */
663 
664     if (Depth > 0)
665     {
666         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%*s[%u] %p ",
667             Depth, " ", Depth, ObjDesc));
668     }
669     else
670     {
671         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", ObjDesc));
672     }
673 
674     /* Decode object type */
675 
676     switch (ObjDesc->Common.Type)
677     {
678     case ACPI_TYPE_LOCAL_REFERENCE:
679 
680         AcpiOsPrintf ("Reference: [%s] ", AcpiUtGetReferenceName (ObjDesc));
681 
682         switch (ObjDesc->Reference.Class)
683         {
684         case ACPI_REFCLASS_DEBUG:
685 
686             AcpiOsPrintf ("\n");
687             break;
688 
689         case ACPI_REFCLASS_INDEX:
690 
691             AcpiOsPrintf ("%p\n", ObjDesc->Reference.Object);
692             break;
693 
694         case ACPI_REFCLASS_TABLE:
695 
696             AcpiOsPrintf ("Table Index %X\n", ObjDesc->Reference.Value);
697             break;
698 
699         case ACPI_REFCLASS_REFOF:
700 
701             AcpiOsPrintf ("%p [%s]\n", ObjDesc->Reference.Object,
702                 AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *)
703                     ObjDesc->Reference.Object)->Common.Type));
704             break;
705 
706         case ACPI_REFCLASS_NAME:
707 
708             AcpiOsPrintf ("- [%4.4s]\n", ObjDesc->Reference.Node->Name.Ascii);
709             break;
710 
711         case ACPI_REFCLASS_ARG:
712         case ACPI_REFCLASS_LOCAL:
713 
714             AcpiOsPrintf ("%X\n", ObjDesc->Reference.Value);
715             break;
716 
717         default:    /* Unknown reference class */
718 
719             AcpiOsPrintf ("%2.2X\n", ObjDesc->Reference.Class);
720             break;
721         }
722         break;
723 
724     case ACPI_TYPE_BUFFER:
725 
726         AcpiOsPrintf ("Buffer length %.2X @ %p\n",
727             ObjDesc->Buffer.Length, ObjDesc->Buffer.Pointer);
728 
729         /* Debug only -- dump the buffer contents */
730 
731         if (ObjDesc->Buffer.Pointer)
732         {
733             Length = ObjDesc->Buffer.Length;
734             if (Length > 128)
735             {
736                 Length = 128;
737             }
738 
739             AcpiOsPrintf ("Buffer Contents: (displaying length 0x%.2X)\n",
740                 Length);
741             ACPI_DUMP_BUFFER (ObjDesc->Buffer.Pointer, Length);
742         }
743         break;
744 
745     case ACPI_TYPE_INTEGER:
746 
747         AcpiOsPrintf ("Integer %8.8X%8.8X\n",
748             ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
749         break;
750 
751     case ACPI_TYPE_PACKAGE:
752 
753         AcpiOsPrintf ("Package [Len %X] ElementArray %p\n",
754             ObjDesc->Package.Count, ObjDesc->Package.Elements);
755 
756         /*
757          * If elements exist, package element pointer is valid,
758          * and debug_level exceeds 1, dump package's elements.
759          */
760         if (ObjDesc->Package.Count &&
761             ObjDesc->Package.Elements &&
762             AcpiDbgLevel > 1)
763         {
764             for (Index = 0; Index < ObjDesc->Package.Count; Index++)
765             {
766                 AcpiExDumpOperand (ObjDesc->Package.Elements[Index], Depth+1);
767             }
768         }
769         break;
770 
771     case ACPI_TYPE_REGION:
772 
773         AcpiOsPrintf ("Region %s (%X)",
774             AcpiUtGetRegionName (ObjDesc->Region.SpaceId),
775             ObjDesc->Region.SpaceId);
776 
777         /*
778          * If the address and length have not been evaluated,
779          * don't print them.
780          */
781         if (!(ObjDesc->Region.Flags & AOPOBJ_DATA_VALID))
782         {
783             AcpiOsPrintf ("\n");
784         }
785         else
786         {
787             AcpiOsPrintf (" base %8.8X%8.8X Length %X\n",
788                 ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
789                 ObjDesc->Region.Length);
790         }
791         break;
792 
793     case ACPI_TYPE_STRING:
794 
795         AcpiOsPrintf ("String length %X @ %p ",
796             ObjDesc->String.Length,
797             ObjDesc->String.Pointer);
798 
799         AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX);
800         AcpiOsPrintf ("\n");
801         break;
802 
803     case ACPI_TYPE_LOCAL_BANK_FIELD:
804 
805         AcpiOsPrintf ("BankField\n");
806         break;
807 
808     case ACPI_TYPE_LOCAL_REGION_FIELD:
809 
810         AcpiOsPrintf ("RegionField: Bits=%X AccWidth=%X Lock=%X Update=%X at "
811             "byte=%X bit=%X of below:\n",
812             ObjDesc->Field.BitLength,
813             ObjDesc->Field.AccessByteWidth,
814             ObjDesc->Field.FieldFlags & AML_FIELD_LOCK_RULE_MASK,
815             ObjDesc->Field.FieldFlags & AML_FIELD_UPDATE_RULE_MASK,
816             ObjDesc->Field.BaseByteOffset,
817             ObjDesc->Field.StartFieldBitOffset);
818 
819         AcpiExDumpOperand (ObjDesc->Field.RegionObj, Depth+1);
820         break;
821 
822     case ACPI_TYPE_LOCAL_INDEX_FIELD:
823 
824         AcpiOsPrintf ("IndexField\n");
825         break;
826 
827     case ACPI_TYPE_BUFFER_FIELD:
828 
829         AcpiOsPrintf ("BufferField: %X bits at byte %X bit %X of\n",
830             ObjDesc->BufferField.BitLength,
831             ObjDesc->BufferField.BaseByteOffset,
832             ObjDesc->BufferField.StartFieldBitOffset);
833 
834         if (!ObjDesc->BufferField.BufferObj)
835         {
836             ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL*\n"));
837         }
838         else if ((ObjDesc->BufferField.BufferObj)->Common.Type !=
839                     ACPI_TYPE_BUFFER)
840         {
841             AcpiOsPrintf ("*not a Buffer*\n");
842         }
843         else
844         {
845             AcpiExDumpOperand (ObjDesc->BufferField.BufferObj, Depth+1);
846         }
847         break;
848 
849     case ACPI_TYPE_EVENT:
850 
851         AcpiOsPrintf ("Event\n");
852         break;
853 
854     case ACPI_TYPE_METHOD:
855 
856         AcpiOsPrintf ("Method(%X) @ %p:%X\n",
857             ObjDesc->Method.ParamCount,
858             ObjDesc->Method.AmlStart,
859             ObjDesc->Method.AmlLength);
860         break;
861 
862     case ACPI_TYPE_MUTEX:
863 
864         AcpiOsPrintf ("Mutex\n");
865         break;
866 
867     case ACPI_TYPE_DEVICE:
868 
869         AcpiOsPrintf ("Device\n");
870         break;
871 
872     case ACPI_TYPE_POWER:
873 
874         AcpiOsPrintf ("Power\n");
875         break;
876 
877     case ACPI_TYPE_PROCESSOR:
878 
879         AcpiOsPrintf ("Processor\n");
880         break;
881 
882     case ACPI_TYPE_THERMAL:
883 
884         AcpiOsPrintf ("Thermal\n");
885         break;
886 
887     default:
888 
889         /* Unknown Type */
890 
891         AcpiOsPrintf ("Unknown Type %X\n", ObjDesc->Common.Type);
892         break;
893     }
894 
895     return;
896 }
897 
898 
899 /*******************************************************************************
900  *
901  * FUNCTION:    AcpiExDumpOperands
902  *
903  * PARAMETERS:  Operands            - A list of Operand objects
904  *              OpcodeName          - AML opcode name
905  *              NumOperands         - Operand count for this opcode
906  *
907  * DESCRIPTION: Dump the operands associated with the opcode
908  *
909  ******************************************************************************/
910 
911 void
912 AcpiExDumpOperands (
913     ACPI_OPERAND_OBJECT     **Operands,
914     const char              *OpcodeName,
915     UINT32                  NumOperands)
916 {
917     ACPI_FUNCTION_NAME (ExDumpOperands);
918 
919 
920     if (!OpcodeName)
921     {
922         OpcodeName = "UNKNOWN";
923     }
924 
925     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
926         "**** Start operand dump for opcode [%s], %u operands\n",
927         OpcodeName, NumOperands));
928 
929     if (NumOperands == 0)
930     {
931         NumOperands = 1;
932     }
933 
934     /* Dump the individual operands */
935 
936     while (NumOperands)
937     {
938         AcpiExDumpOperand (*Operands, 0);
939         Operands++;
940         NumOperands--;
941     }
942 
943     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
944         "**** End operand dump for [%s]\n", OpcodeName));
945     return;
946 }
947 
948 
949 /*******************************************************************************
950  *
951  * FUNCTION:    AcpiExOut* functions
952  *
953  * PARAMETERS:  Title               - Descriptive text
954  *              Value               - Value to be displayed
955  *
956  * DESCRIPTION: Object dump output formatting functions. These functions
957  *              reduce the number of format strings required and keeps them
958  *              all in one place for easy modification.
959  *
960  ******************************************************************************/
961 
962 static void
963 AcpiExOutString (
964     char                    *Title,
965     char                    *Value)
966 {
967     AcpiOsPrintf ("%20s : %s\n", Title, Value);
968 }
969 
970 static void
971 AcpiExOutPointer (
972     char                    *Title,
973     void                    *Value)
974 {
975     AcpiOsPrintf ("%20s : %p\n", Title, Value);
976 }
977 
978 
979 /*******************************************************************************
980  *
981  * FUNCTION:    AcpiExDumpNamespaceNode
982  *
983  * PARAMETERS:  Node                - Descriptor to dump
984  *              Flags               - Force display if TRUE
985  *
986  * DESCRIPTION: Dumps the members of the given.Node
987  *
988  ******************************************************************************/
989 
990 void
991 AcpiExDumpNamespaceNode (
992     ACPI_NAMESPACE_NODE     *Node,
993     UINT32                  Flags)
994 {
995 
996     ACPI_FUNCTION_ENTRY ();
997 
998 
999     if (!Flags)
1000     {
1001         /* Check if debug output enabled */
1002 
1003         if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS, _COMPONENT))
1004         {
1005             return;
1006         }
1007     }
1008 
1009     AcpiOsPrintf ("%20s : %4.4s\n", "Name", AcpiUtGetNodeName (Node));
1010     AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
1011         Node->Type, AcpiUtGetTypeName (Node->Type));
1012 
1013     AcpiExDumpObject (ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node),
1014         AcpiExDumpNode);
1015 }
1016 
1017 
1018 /*******************************************************************************
1019  *
1020  * FUNCTION:    AcpiExDumpReferenceObj
1021  *
1022  * PARAMETERS:  Object              - Descriptor to dump
1023  *
1024  * DESCRIPTION: Dumps a reference object
1025  *
1026  ******************************************************************************/
1027 
1028 static void
1029 AcpiExDumpReferenceObj (
1030     ACPI_OPERAND_OBJECT     *ObjDesc)
1031 {
1032     ACPI_BUFFER             RetBuf;
1033     ACPI_STATUS             Status;
1034 
1035 
1036     RetBuf.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
1037 
1038     if (ObjDesc->Reference.Class == ACPI_REFCLASS_NAME)
1039     {
1040         AcpiOsPrintf (" %p ", ObjDesc->Reference.Node);
1041 
1042         Status = AcpiNsHandleToPathname (ObjDesc->Reference.Node, &RetBuf);
1043         if (ACPI_FAILURE (Status))
1044         {
1045             AcpiOsPrintf (" Could not convert name to pathname\n");
1046         }
1047         else
1048         {
1049            AcpiOsPrintf ("%s\n", (char *) RetBuf.Pointer);
1050            ACPI_FREE (RetBuf.Pointer);
1051         }
1052     }
1053     else if (ObjDesc->Reference.Object)
1054     {
1055         if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND)
1056         {
1057             AcpiOsPrintf (" Target: %p", ObjDesc->Reference.Object);
1058             if (ObjDesc->Reference.Class == ACPI_REFCLASS_TABLE)
1059             {
1060                 AcpiOsPrintf (" Table Index: %X\n", ObjDesc->Reference.Value);
1061             }
1062             else
1063             {
1064                 AcpiOsPrintf (" Target: %p [%s]\n", ObjDesc->Reference.Object,
1065                     AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *)
1066                         ObjDesc->Reference.Object)->Common.Type));
1067             }
1068         }
1069         else
1070         {
1071             AcpiOsPrintf (" Target: %p\n", ObjDesc->Reference.Object);
1072         }
1073     }
1074 }
1075 
1076 
1077 /*******************************************************************************
1078  *
1079  * FUNCTION:    AcpiExDumpPackageObj
1080  *
1081  * PARAMETERS:  ObjDesc             - Descriptor to dump
1082  *              Level               - Indentation Level
1083  *              Index               - Package index for this object
1084  *
1085  * DESCRIPTION: Dumps the elements of the package
1086  *
1087  ******************************************************************************/
1088 
1089 static void
1090 AcpiExDumpPackageObj (
1091     ACPI_OPERAND_OBJECT     *ObjDesc,
1092     UINT32                  Level,
1093     UINT32                  Index)
1094 {
1095     UINT32                  i;
1096 
1097 
1098     /* Indentation and index output */
1099 
1100     if (Level > 0)
1101     {
1102         for (i = 0; i < Level; i++)
1103         {
1104             AcpiOsPrintf ("  ");
1105         }
1106 
1107         AcpiOsPrintf ("[%.2d] ", Index);
1108     }
1109 
1110     AcpiOsPrintf ("%p ", ObjDesc);
1111 
1112     /* Null package elements are allowed */
1113 
1114     if (!ObjDesc)
1115     {
1116         AcpiOsPrintf ("[Null Object]\n");
1117         return;
1118     }
1119 
1120     /* Packages may only contain a few object types */
1121 
1122     switch (ObjDesc->Common.Type)
1123     {
1124     case ACPI_TYPE_INTEGER:
1125 
1126         AcpiOsPrintf ("[Integer] = %8.8X%8.8X\n",
1127             ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
1128         break;
1129 
1130     case ACPI_TYPE_STRING:
1131 
1132         AcpiOsPrintf ("[String]  Value: ");
1133         AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX);
1134         AcpiOsPrintf ("\n");
1135         break;
1136 
1137     case ACPI_TYPE_BUFFER:
1138 
1139         AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length);
1140         if (ObjDesc->Buffer.Length)
1141         {
1142             AcpiUtDebugDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
1143                 ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT);
1144         }
1145         else
1146         {
1147             AcpiOsPrintf ("\n");
1148         }
1149         break;
1150 
1151     case ACPI_TYPE_PACKAGE:
1152 
1153         AcpiOsPrintf ("[Package] Contains %u Elements:\n",
1154             ObjDesc->Package.Count);
1155 
1156         for (i = 0; i < ObjDesc->Package.Count; i++)
1157         {
1158             AcpiExDumpPackageObj (ObjDesc->Package.Elements[i], Level+1, i);
1159         }
1160         break;
1161 
1162     case ACPI_TYPE_LOCAL_REFERENCE:
1163 
1164         AcpiOsPrintf ("[Object Reference] Type [%s] %2.2X",
1165             AcpiUtGetReferenceName (ObjDesc),
1166             ObjDesc->Reference.Class);
1167         AcpiExDumpReferenceObj (ObjDesc);
1168         break;
1169 
1170     default:
1171 
1172         AcpiOsPrintf ("[Unknown Type] %X\n", ObjDesc->Common.Type);
1173         break;
1174     }
1175 }
1176 
1177 
1178 /*******************************************************************************
1179  *
1180  * FUNCTION:    AcpiExDumpObjectDescriptor
1181  *
1182  * PARAMETERS:  ObjDesc             - Descriptor to dump
1183  *              Flags               - Force display if TRUE
1184  *
1185  * DESCRIPTION: Dumps the members of the object descriptor given.
1186  *
1187  ******************************************************************************/
1188 
1189 void
1190 AcpiExDumpObjectDescriptor (
1191     ACPI_OPERAND_OBJECT     *ObjDesc,
1192     UINT32                  Flags)
1193 {
1194     ACPI_FUNCTION_TRACE (ExDumpObjectDescriptor);
1195 
1196 
1197     if (!ObjDesc)
1198     {
1199         return_VOID;
1200     }
1201 
1202     if (!Flags)
1203     {
1204         /* Check if debug output enabled */
1205 
1206         if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS, _COMPONENT))
1207         {
1208             return_VOID;
1209         }
1210     }
1211 
1212     if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED)
1213     {
1214         AcpiExDumpNamespaceNode ((ACPI_NAMESPACE_NODE *) ObjDesc, Flags);
1215 
1216         AcpiOsPrintf ("\nAttached Object (%p):\n",
1217             ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object);
1218 
1219         ObjDesc = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object;
1220         goto DumpObject;
1221     }
1222 
1223     if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
1224     {
1225         AcpiOsPrintf (
1226             "%p is not an ACPI operand object: [%s]\n",
1227             ObjDesc, AcpiUtGetDescriptorName (ObjDesc));
1228         return_VOID;
1229     }
1230 
1231     /* Validate the object type */
1232 
1233     if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX)
1234     {
1235         AcpiOsPrintf ("Not a known object type: %2.2X\n",
1236             ObjDesc->Common.Type);
1237         return_VOID;
1238     }
1239 
1240 
1241 DumpObject:
1242 
1243     /* Common Fields */
1244 
1245     AcpiExDumpObject (ObjDesc, AcpiExDumpCommon);
1246 
1247     /* Object-specific fields */
1248 
1249     AcpiExDumpObject (ObjDesc, AcpiExDumpInfo[ObjDesc->Common.Type]);
1250 
1251     if (ObjDesc->Common.Type == ACPI_TYPE_REGION)
1252     {
1253         ObjDesc = ObjDesc->Common.NextObject;
1254         if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX)
1255         {
1256             AcpiOsPrintf ("Secondary object is not a known object type: %2.2X\n",
1257                 ObjDesc->Common.Type);
1258 
1259             return_VOID;
1260         }
1261 
1262         AcpiOsPrintf ("\nExtra attached Object (%p):\n", ObjDesc);
1263         AcpiExDumpObject (ObjDesc, AcpiExDumpInfo[ObjDesc->Common.Type]);
1264     }
1265 
1266     return_VOID;
1267 }
1268 
1269 #endif
1270