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