]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/contrib/dev/acpica/exdump.c
Vendor import of the Intel ACPI CA 20021118 drop.
[FreeBSD/FreeBSD.git] / sys / contrib / dev / acpica / exdump.c
1 /******************************************************************************
2  *
3  * Module Name: exdump - Interpreter debug output routines
4  *              $Revision: 163 $
5  *
6  *****************************************************************************/
7
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2002, 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
117 #define __EXDUMP_C__
118
119 #include "acpi.h"
120 #include "acinterp.h"
121 #include "amlcode.h"
122 #include "acnamesp.h"
123 #include "acparser.h"
124
125 #define _COMPONENT          ACPI_EXECUTER
126         ACPI_MODULE_NAME    ("exdump")
127
128
129 /*
130  * The following routines are used for debug output only
131  */
132
133 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
134
135 /*****************************************************************************
136  *
137  * FUNCTION:    AcpiExDumpOperand
138  *
139  * PARAMETERS:  *ObjDesc          - Pointer to entry to be dumped
140  *
141  * RETURN:      Status
142  *
143  * DESCRIPTION: Dump an operand object
144  *
145  ****************************************************************************/
146
147 void
148 AcpiExDumpOperand (
149     ACPI_OPERAND_OBJECT     *ObjDesc)
150 {
151     UINT8                   *Buf = NULL;
152     UINT32                  Length;
153     ACPI_OPERAND_OBJECT     **Element;
154     UINT16                  ElementIndex;
155
156
157     ACPI_FUNCTION_NAME ("ExDumpOperand")
158
159
160     if (!((ACPI_LV_EXEC & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer)))
161     {
162         return;
163     }
164
165     if (!ObjDesc)
166     {
167         /*
168          * This usually indicates that something serious is wrong --
169          * since most (if not all)
170          * code that dumps the stack expects something to be there!
171          */
172         AcpiOsPrintf ("Null stack entry ptr\n");
173         return;
174     }
175
176     if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED)
177     {
178         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p NS Node: ", ObjDesc));
179         ACPI_DUMP_ENTRY (ObjDesc, ACPI_LV_EXEC);
180         return;
181     }
182
183     if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
184     {
185         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p is not a local object\n", ObjDesc));
186         ACPI_DUMP_BUFFER (ObjDesc, sizeof (ACPI_OPERAND_OBJECT));
187         return;
188     }
189
190     /*  ObjDesc is a valid object  */
191
192     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", ObjDesc));
193
194     switch (ACPI_GET_OBJECT_TYPE (ObjDesc))
195     {
196     case ACPI_TYPE_LOCAL_REFERENCE:
197
198         switch (ObjDesc->Reference.Opcode)
199         {
200         case AML_DEBUG_OP:
201
202             AcpiOsPrintf ("Reference: Debug\n");
203             break;
204
205
206         case AML_NAME_OP:
207
208             ACPI_DUMP_PATHNAME (ObjDesc->Reference.Object, "Reference: Name: ",
209                             ACPI_LV_INFO, _COMPONENT);
210             ACPI_DUMP_ENTRY (ObjDesc->Reference.Object, ACPI_LV_INFO);
211             break;
212
213
214         case AML_INDEX_OP:
215
216             AcpiOsPrintf ("Reference: Index %p\n",
217                         ObjDesc->Reference.Object);
218             break;
219
220
221         case AML_REF_OF_OP:
222
223             AcpiOsPrintf ("Reference: (RefOf) %p\n",
224                         ObjDesc->Reference.Object);
225             break;
226
227
228         case AML_ARG_OP:
229
230             AcpiOsPrintf ("Reference: Arg%d",
231                         ObjDesc->Reference.Offset);
232
233             if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_INTEGER)
234             {
235                 /* Value is a Number */
236
237                 AcpiOsPrintf (" value is [%8.8X%8.8x]",
238                             ACPI_HIDWORD(ObjDesc->Integer.Value),
239                             ACPI_LODWORD(ObjDesc->Integer.Value));
240             }
241
242             AcpiOsPrintf ("\n");
243             break;
244
245
246         case AML_LOCAL_OP:
247
248             AcpiOsPrintf ("Reference: Local%d",
249                         ObjDesc->Reference.Offset);
250
251             if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_INTEGER)
252             {
253
254                 /* Value is a Number */
255
256                 AcpiOsPrintf (" value is [%8.8X%8.8x]",
257                             ACPI_HIDWORD(ObjDesc->Integer.Value),
258                             ACPI_LODWORD(ObjDesc->Integer.Value));
259             }
260
261             AcpiOsPrintf ("\n");
262             break;
263
264
265         case AML_INT_NAMEPATH_OP:
266
267             AcpiOsPrintf ("Reference.Node->Name %X\n",
268                         ObjDesc->Reference.Node->Name.Integer);
269             break;
270
271
272         default:
273
274             /*  unknown opcode  */
275
276             AcpiOsPrintf ("Unknown Reference opcode=%X\n",
277                 ObjDesc->Reference.Opcode);
278             break;
279
280         }
281
282         break;
283
284
285     case ACPI_TYPE_BUFFER:
286
287         AcpiOsPrintf ("Buffer len %X @ %p \n",
288                     ObjDesc->Buffer.Length,
289                     ObjDesc->Buffer.Pointer);
290
291         Length = ObjDesc->Buffer.Length;
292
293         if (Length > 64)
294         {
295             Length = 64;
296         }
297
298         /* Debug only -- dump the buffer contents */
299
300         if (ObjDesc->Buffer.Pointer)
301         {
302             AcpiOsPrintf ("Buffer Contents: ");
303
304             for (Buf = ObjDesc->Buffer.Pointer; Length--; ++Buf)
305             {
306                 AcpiOsPrintf (" %02x", *Buf);
307             }
308             AcpiOsPrintf ("\n");
309         }
310
311         break;
312
313
314     case ACPI_TYPE_INTEGER:
315
316         AcpiOsPrintf ("Integer %8.8X%8.8X\n",
317                     ACPI_HIDWORD (ObjDesc->Integer.Value),
318                     ACPI_LODWORD (ObjDesc->Integer.Value));
319         break;
320
321
322     case ACPI_TYPE_PACKAGE:
323
324         AcpiOsPrintf ("Package count %X @ %p\n",
325                     ObjDesc->Package.Count, ObjDesc->Package.Elements);
326
327         /*
328          * If elements exist, package vector pointer is valid,
329          * and debug_level exceeds 1, dump package's elements.
330          */
331         if (ObjDesc->Package.Count &&
332             ObjDesc->Package.Elements &&
333             AcpiDbgLevel > 1)
334         {
335             for (ElementIndex = 0, Element = ObjDesc->Package.Elements;
336                   ElementIndex < ObjDesc->Package.Count;
337                   ++ElementIndex, ++Element)
338             {
339                 AcpiExDumpOperand (*Element);
340             }
341         }
342         AcpiOsPrintf ("\n");
343         break;
344
345
346     case ACPI_TYPE_REGION:
347
348         AcpiOsPrintf ("Region %s (%X)",
349             AcpiUtGetRegionName (ObjDesc->Region.SpaceId),
350             ObjDesc->Region.SpaceId);
351
352         /*
353          * If the address and length have not been evaluated,
354          * don't print them.
355          */
356         if (!(ObjDesc->Region.Flags & AOPOBJ_DATA_VALID))
357         {
358             AcpiOsPrintf ("\n");
359         }
360         else
361         {
362             AcpiOsPrintf (" base %8.8X%8.8X Length %X\n",
363                 ACPI_HIDWORD (ObjDesc->Region.Address),
364                 ACPI_LODWORD (ObjDesc->Region.Address),
365                 ObjDesc->Region.Length);
366         }
367         break;
368
369
370     case ACPI_TYPE_STRING:
371
372         AcpiOsPrintf ("String length %X @ %p ",
373                     ObjDesc->String.Length, ObjDesc->String.Pointer);
374         AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX);
375         AcpiOsPrintf ("\n");
376         break;
377
378
379     case ACPI_TYPE_LOCAL_BANK_FIELD:
380
381         AcpiOsPrintf ("BankField\n");
382         break;
383
384
385     case ACPI_TYPE_LOCAL_REGION_FIELD:
386
387         AcpiOsPrintf (
388             "RegionField: Bits=%X AccWidth=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n",
389             ObjDesc->Field.BitLength, ObjDesc->Field.AccessByteWidth,
390             ObjDesc->Field.FieldFlags & AML_FIELD_LOCK_RULE_MASK,
391             ObjDesc->Field.FieldFlags & AML_FIELD_UPDATE_RULE_MASK,
392             ObjDesc->Field.BaseByteOffset, ObjDesc->Field.StartFieldBitOffset);
393         ACPI_DUMP_STACK_ENTRY (ObjDesc->Field.RegionObj);
394         break;
395
396
397     case ACPI_TYPE_LOCAL_INDEX_FIELD:
398
399         AcpiOsPrintf ("IndexField\n");
400         break;
401
402
403     case ACPI_TYPE_BUFFER_FIELD:
404
405         AcpiOsPrintf (
406             "BufferField: %X bits at byte %X bit %X of \n",
407             ObjDesc->BufferField.BitLength, ObjDesc->BufferField.BaseByteOffset,
408             ObjDesc->BufferField.StartFieldBitOffset);
409
410         if (!ObjDesc->BufferField.BufferObj)
411         {
412             ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL* \n"));
413         }
414         else if (ACPI_GET_OBJECT_TYPE (ObjDesc->BufferField.BufferObj) != ACPI_TYPE_BUFFER)
415         {
416             AcpiOsPrintf ("*not a Buffer* \n");
417         }
418         else
419         {
420             ACPI_DUMP_STACK_ENTRY (ObjDesc->BufferField.BufferObj);
421         }
422
423         break;
424
425
426     case ACPI_TYPE_EVENT:
427
428         AcpiOsPrintf ("Event\n");
429         break;
430
431
432     case ACPI_TYPE_METHOD:
433
434         AcpiOsPrintf (
435             "Method(%X) @ %p:%X\n",
436             ObjDesc->Method.ParamCount,
437             ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength);
438         break;
439
440
441     case ACPI_TYPE_MUTEX:
442
443         AcpiOsPrintf ("Mutex\n");
444         break;
445
446
447     case ACPI_TYPE_DEVICE:
448
449         AcpiOsPrintf ("Device\n");
450         break;
451
452
453     case ACPI_TYPE_POWER:
454
455         AcpiOsPrintf ("Power\n");
456         break;
457
458
459     case ACPI_TYPE_PROCESSOR:
460
461         AcpiOsPrintf ("Processor\n");
462         break;
463
464
465     case ACPI_TYPE_THERMAL:
466
467         AcpiOsPrintf ("Thermal\n");
468         break;
469
470
471     default:
472         /* Unknown Type */
473
474         AcpiOsPrintf ("Unknown Type %X\n", ACPI_GET_OBJECT_TYPE (ObjDesc));
475         break;
476     }
477
478     return;
479 }
480
481
482 /*****************************************************************************
483  *
484  * FUNCTION:    AcpiExDumpOperands
485  *
486  * PARAMETERS:  InterpreterMode      - Load or Exec
487  *              *Ident              - Identification
488  *              NumLevels           - # of stack entries to dump above line
489  *              *Note               - Output notation
490  *
491  * DESCRIPTION: Dump the object stack
492  *
493  ****************************************************************************/
494
495 void
496 AcpiExDumpOperands (
497     ACPI_OPERAND_OBJECT     **Operands,
498     ACPI_INTERPRETER_MODE   InterpreterMode,
499     NATIVE_CHAR             *Ident,
500     UINT32                  NumLevels,
501     NATIVE_CHAR             *Note,
502     NATIVE_CHAR             *ModuleName,
503     UINT32                  LineNumber)
504 {
505     NATIVE_UINT             i;
506     ACPI_OPERAND_OBJECT     **ObjDesc;
507
508
509     ACPI_FUNCTION_NAME ("ExDumpOperands");
510
511
512     if (!Ident)
513     {
514         Ident = "?";
515     }
516
517     if (!Note)
518     {
519         Note = "?";
520     }
521
522     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
523         "************* Operand Stack Contents (Opcode [%s], %d Operands)\n",
524         Ident, NumLevels));
525
526     if (NumLevels == 0)
527     {
528         NumLevels = 1;
529     }
530
531     /* Dump the operand stack starting at the top */
532
533     for (i = 0; NumLevels > 0; i--, NumLevels--)
534     {
535         ObjDesc = &Operands[i];
536         AcpiExDumpOperand (*ObjDesc);
537     }
538
539     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
540         "************* Stack dump from %s(%d), %s\n",
541         ModuleName, LineNumber, Note));
542     return;
543 }
544
545
546 /*****************************************************************************
547  *
548  * FUNCTION:    AcpiExOut*
549  *
550  * PARAMETERS:  Title               - Descriptive text
551  *              Value               - Value to be displayed
552  *
553  * DESCRIPTION: Object dump output formatting functions.  These functions
554  *              reduce the number of format strings required and keeps them
555  *              all in one place for easy modification.
556  *
557  ****************************************************************************/
558
559 void
560 AcpiExOutString (
561     char                    *Title,
562     char                    *Value)
563 {
564     AcpiOsPrintf ("%20s : %s\n", Title, Value);
565 }
566
567 void
568 AcpiExOutPointer (
569     char                    *Title,
570     void                    *Value)
571 {
572     AcpiOsPrintf ("%20s : %p\n", Title, Value);
573 }
574
575 void
576 AcpiExOutInteger (
577     char                    *Title,
578     UINT32                  Value)
579 {
580     AcpiOsPrintf ("%20s : %X\n", Title, Value);
581 }
582
583 void
584 AcpiExOutAddress (
585     char                    *Title,
586     ACPI_PHYSICAL_ADDRESS   Value)
587 {
588
589 #if ACPI_MACHINE_WIDTH == 16
590     AcpiOsPrintf ("%20s : %p\n", Title, Value);
591 #else
592     AcpiOsPrintf ("%20s : %8.8X%8.8X\n", Title,
593                 ACPI_HIDWORD (Value), ACPI_LODWORD (Value));
594 #endif
595 }
596
597
598 /*****************************************************************************
599  *
600  * FUNCTION:    AcpiExDumpNode
601  *
602  * PARAMETERS:  *Node           - Descriptor to dump
603  *              Flags               - Force display
604  *
605  * DESCRIPTION: Dumps the members of the given.Node
606  *
607  ****************************************************************************/
608
609 void
610 AcpiExDumpNode (
611     ACPI_NAMESPACE_NODE     *Node,
612     UINT32                  Flags)
613 {
614
615     ACPI_FUNCTION_ENTRY ();
616
617
618     if (!Flags)
619     {
620         if (!((ACPI_LV_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer)))
621         {
622             return;
623         }
624     }
625
626     AcpiOsPrintf ("%20s : %4.4s\n",       "Name", Node->Name.Ascii);
627     AcpiExOutString  ("Type",             AcpiUtGetTypeName (Node->Type));
628     AcpiExOutInteger ("Flags",            Node->Flags);
629     AcpiExOutInteger ("Owner Id",         Node->OwnerId);
630     AcpiExOutInteger ("Reference Count",  Node->ReferenceCount);
631     AcpiExOutPointer ("Attached Object",  AcpiNsGetAttachedObject (Node));
632     AcpiExOutPointer ("ChildList",        Node->Child);
633     AcpiExOutPointer ("NextPeer",         Node->Peer);
634     AcpiExOutPointer ("Parent",           AcpiNsGetParentNode (Node));
635 }
636
637
638 /*****************************************************************************
639  *
640  * FUNCTION:    AcpiExDumpObjectDescriptor
641  *
642  * PARAMETERS:  *Object             - Descriptor to dump
643  *              Flags               - Force display
644  *
645  * DESCRIPTION: Dumps the members of the object descriptor given.
646  *
647  ****************************************************************************/
648
649 void
650 AcpiExDumpObjectDescriptor (
651     ACPI_OPERAND_OBJECT     *ObjDesc,
652     UINT32                  Flags)
653 {
654     UINT32                  i;
655
656
657     ACPI_FUNCTION_TRACE ("ExDumpObjectDescriptor");
658
659
660     if (!Flags)
661     {
662         if (!((ACPI_LV_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer)))
663         {
664             return_VOID;
665         }
666     }
667
668     if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED)
669     {
670         AcpiExDumpNode ((ACPI_NAMESPACE_NODE *) ObjDesc, Flags);
671         AcpiOsPrintf ("\nAttached Object (%p):\n", ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object);
672         AcpiExDumpObjectDescriptor (((ACPI_NAMESPACE_NODE *) ObjDesc)->Object, Flags);
673         return;
674     }
675
676     if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
677     {
678         AcpiOsPrintf ("ExDumpObjectDescriptor: %p is not a valid ACPI object\n", ObjDesc);
679         return_VOID;
680     }
681
682     /* Common Fields */
683
684     AcpiExOutString  ("Type",            AcpiUtGetObjectTypeName (ObjDesc));
685     AcpiExOutInteger ("Reference Count", ObjDesc->Common.ReferenceCount);
686     AcpiExOutInteger ("Flags",           ObjDesc->Common.Flags);
687
688     /* Object-specific Fields */
689
690     switch (ACPI_GET_OBJECT_TYPE (ObjDesc))
691     {
692     case ACPI_TYPE_INTEGER:
693
694         AcpiOsPrintf ("%20s : %8.8X%8.8X\n", "Value",
695                         ACPI_HIDWORD (ObjDesc->Integer.Value),
696                         ACPI_LODWORD (ObjDesc->Integer.Value));
697         break;
698
699
700     case ACPI_TYPE_STRING:
701
702         AcpiExOutInteger ("Length",          ObjDesc->String.Length);
703
704         AcpiOsPrintf ("%20s : %p  ", "Pointer", ObjDesc->String.Pointer);
705         AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX);
706         AcpiOsPrintf ("\n");
707         break;
708
709
710     case ACPI_TYPE_BUFFER:
711
712         AcpiExOutInteger ("Length",          ObjDesc->Buffer.Length);
713         AcpiExOutPointer ("Pointer",         ObjDesc->Buffer.Pointer);
714         ACPI_DUMP_BUFFER (ObjDesc->Buffer.Pointer, ObjDesc->Buffer.Length);
715         break;
716
717
718     case ACPI_TYPE_PACKAGE:
719
720         AcpiExOutInteger ("Flags",           ObjDesc->Package.Flags);
721         AcpiExOutInteger ("Count",           ObjDesc->Package.Count);
722         AcpiExOutPointer ("Elements",        ObjDesc->Package.Elements);
723
724         /* Dump the package contents */
725
726         if (ObjDesc->Package.Count > 0)
727         {
728             AcpiOsPrintf ("\nPackage Contents:\n");
729             for (i = 0; i < ObjDesc->Package.Count; i++)
730             {
731                 AcpiOsPrintf ("[%.3d] %p", i, ObjDesc->Package.Elements[i]);
732                 if (ObjDesc->Package.Elements[i])
733                 {
734                     AcpiOsPrintf (" %s", AcpiUtGetObjectTypeName (ObjDesc->Package.Elements[i]));
735                 }
736                 AcpiOsPrintf ("\n");
737             }
738         }
739         break;
740
741
742     case ACPI_TYPE_DEVICE:
743
744         AcpiExOutPointer ("AddrHandler",     ObjDesc->Device.AddrHandler);
745         AcpiExOutPointer ("SysHandler",      ObjDesc->Device.SysHandler);
746         AcpiExOutPointer ("DrvHandler",      ObjDesc->Device.DrvHandler);
747         break;
748
749
750     case ACPI_TYPE_EVENT:
751
752         AcpiExOutPointer ("Semaphore",       ObjDesc->Event.Semaphore);
753         break;
754
755
756     case ACPI_TYPE_METHOD:
757
758         AcpiExOutInteger ("ParamCount",      ObjDesc->Method.ParamCount);
759         AcpiExOutInteger ("Concurrency",     ObjDesc->Method.Concurrency);
760         AcpiExOutPointer ("Semaphore",       ObjDesc->Method.Semaphore);
761         AcpiExOutInteger ("OwningId",        ObjDesc->Method.OwningId);
762         AcpiExOutInteger ("AmlLength",       ObjDesc->Method.AmlLength);
763         AcpiExOutPointer ("AmlStart",        ObjDesc->Method.AmlStart);
764         break;
765
766
767     case ACPI_TYPE_MUTEX:
768
769         AcpiExOutInteger ("SyncLevel",       ObjDesc->Mutex.SyncLevel);
770         AcpiExOutPointer ("OwnerThread",     ObjDesc->Mutex.OwnerThread);
771         AcpiExOutInteger ("AcquisitionDepth",ObjDesc->Mutex.AcquisitionDepth);
772         AcpiExOutPointer ("Semaphore",       ObjDesc->Mutex.Semaphore);
773         break;
774
775
776     case ACPI_TYPE_REGION:
777
778         AcpiExOutInteger ("SpaceId",         ObjDesc->Region.SpaceId);
779         AcpiExOutInteger ("Flags",           ObjDesc->Region.Flags);
780         AcpiExOutAddress ("Address",         ObjDesc->Region.Address);
781         AcpiExOutInteger ("Length",          ObjDesc->Region.Length);
782         AcpiExOutPointer ("AddrHandler",     ObjDesc->Region.AddrHandler);
783         AcpiExOutPointer ("Next",            ObjDesc->Region.Next);
784         break;
785
786
787     case ACPI_TYPE_POWER:
788
789         AcpiExOutInteger ("SystemLevel",     ObjDesc->PowerResource.SystemLevel);
790         AcpiExOutInteger ("ResourceOrder",   ObjDesc->PowerResource.ResourceOrder);
791         AcpiExOutPointer ("SysHandler",      ObjDesc->PowerResource.SysHandler);
792         AcpiExOutPointer ("DrvHandler",      ObjDesc->PowerResource.DrvHandler);
793         break;
794
795
796     case ACPI_TYPE_PROCESSOR:
797
798         AcpiExOutInteger ("Processor ID",    ObjDesc->Processor.ProcId);
799         AcpiExOutInteger ("Length",          ObjDesc->Processor.Length);
800         AcpiExOutAddress ("Address",         (ACPI_PHYSICAL_ADDRESS) ObjDesc->Processor.Address);
801         AcpiExOutPointer ("SysHandler",      ObjDesc->Processor.SysHandler);
802         AcpiExOutPointer ("DrvHandler",      ObjDesc->Processor.DrvHandler);
803         AcpiExOutPointer ("AddrHandler",     ObjDesc->Processor.AddrHandler);
804         break;
805
806
807     case ACPI_TYPE_THERMAL:
808
809         AcpiExOutPointer ("SysHandler",      ObjDesc->ThermalZone.SysHandler);
810         AcpiExOutPointer ("DrvHandler",      ObjDesc->ThermalZone.DrvHandler);
811         AcpiExOutPointer ("AddrHandler",     ObjDesc->ThermalZone.AddrHandler);
812         break;
813
814
815     case ACPI_TYPE_BUFFER_FIELD:
816     case ACPI_TYPE_LOCAL_REGION_FIELD:
817     case ACPI_TYPE_LOCAL_BANK_FIELD:
818     case ACPI_TYPE_LOCAL_INDEX_FIELD:
819
820         AcpiExOutInteger ("FieldFlags",      ObjDesc->CommonField.FieldFlags);
821         AcpiExOutInteger ("AccessByteWidth", ObjDesc->CommonField.AccessByteWidth);
822         AcpiExOutInteger ("BitLength",       ObjDesc->CommonField.BitLength);
823         AcpiExOutInteger ("FldBitOffset",    ObjDesc->CommonField.StartFieldBitOffset);
824         AcpiExOutInteger ("BaseByteOffset",  ObjDesc->CommonField.BaseByteOffset);
825         AcpiExOutInteger ("DatumValidBits",  ObjDesc->CommonField.DatumValidBits);
826         AcpiExOutInteger ("EndFldValidBits", ObjDesc->CommonField.EndFieldValidBits);
827         AcpiExOutInteger ("EndBufValidBits", ObjDesc->CommonField.EndBufferValidBits);
828         AcpiExOutPointer ("ParentNode",      ObjDesc->CommonField.Node);
829
830         switch (ACPI_GET_OBJECT_TYPE (ObjDesc))
831         {
832         case ACPI_TYPE_BUFFER_FIELD:
833             AcpiExOutPointer ("BufferObj",       ObjDesc->BufferField.BufferObj);
834             break;
835
836         case ACPI_TYPE_LOCAL_REGION_FIELD:
837             AcpiExOutPointer ("RegionObj",       ObjDesc->Field.RegionObj);
838             break;
839
840         case ACPI_TYPE_LOCAL_BANK_FIELD:
841             AcpiExOutInteger ("Value",           ObjDesc->BankField.Value);
842             AcpiExOutPointer ("RegionObj",       ObjDesc->BankField.RegionObj);
843             AcpiExOutPointer ("BankObj",         ObjDesc->BankField.BankObj);
844             break;
845
846         case ACPI_TYPE_LOCAL_INDEX_FIELD:
847             AcpiExOutInteger ("Value",           ObjDesc->IndexField.Value);
848             AcpiExOutPointer ("Index",           ObjDesc->IndexField.IndexObj);
849             AcpiExOutPointer ("Data",            ObjDesc->IndexField.DataObj);
850             break;
851
852         default:
853             /* All object types covered above */
854             break;
855         }
856         break;
857
858
859     case ACPI_TYPE_LOCAL_REFERENCE:
860
861         AcpiExOutInteger ("TargetType",      ObjDesc->Reference.TargetType);
862         AcpiExOutString  ("Opcode",          (AcpiPsGetOpcodeInfo (ObjDesc->Reference.Opcode))->Name);
863         AcpiExOutInteger ("Offset",          ObjDesc->Reference.Offset);
864         AcpiExOutPointer ("ObjDesc",         ObjDesc->Reference.Object);
865         AcpiExOutPointer ("Node",            ObjDesc->Reference.Node);
866         AcpiExOutPointer ("Where",           ObjDesc->Reference.Where);
867         break;
868
869
870     case ACPI_TYPE_LOCAL_ADDRESS_HANDLER:
871
872         AcpiExOutInteger ("SpaceId",         ObjDesc->AddrHandler.SpaceId);
873         AcpiExOutPointer ("Next",            ObjDesc->AddrHandler.Next);
874         AcpiExOutPointer ("RegionList",      ObjDesc->AddrHandler.RegionList);
875         AcpiExOutPointer ("Node",            ObjDesc->AddrHandler.Node);
876         AcpiExOutPointer ("Context",         ObjDesc->AddrHandler.Context);
877         break;
878
879
880     case ACPI_TYPE_LOCAL_NOTIFY:
881
882         AcpiExOutPointer ("Node",            ObjDesc->NotifyHandler.Node);
883         AcpiExOutPointer ("Context",         ObjDesc->NotifyHandler.Context);
884         break;
885
886
887     case ACPI_TYPE_LOCAL_ALIAS:
888     case ACPI_TYPE_LOCAL_EXTRA:
889     case ACPI_TYPE_LOCAL_DATA:
890     default:
891
892         AcpiOsPrintf ("ExDumpObjectDescriptor: Display not implemented for object type %s\n",
893             AcpiUtGetObjectTypeName (ObjDesc));
894         break;
895     }
896
897     return_VOID;
898 }
899
900 #endif
901