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