exdump.c revision 77424
1/******************************************************************************
2 *
3 * Module Name: exdump - Interpreter debug output routines
4 *              $Revision: 114 $
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999, 2000, 2001, 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 "actables.h"
124
125#define _COMPONENT          ACPI_EXECUTER
126        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:    AcpiExShowHexValue
138 *
139 * PARAMETERS:  ByteCount           - Number of bytes to print (1, 2, or 4)
140 *              *AmlPtr             - Address in AML stream of bytes to print
141 *              InterpreterMode     - Current running mode (load1/Load2/Exec)
142 *              LeadSpace           - # of spaces to print ahead of value
143 *                                    0 => none ahead but one behind
144 *
145 * DESCRIPTION: Print ByteCount byte(s) starting at AmlPtr as a single
146 *              value, in hex.  If ByteCount > 1 or the value printed is > 9, also
147 *              print in decimal.
148 *
149 ****************************************************************************/
150
151void
152AcpiExShowHexValue (
153    UINT32                  ByteCount,
154    UINT8                   *AmlPtr,
155    UINT32                  LeadSpace)
156{
157    UINT32                  Value;                  /*  Value retrieved from AML stream */
158    UINT32                  ShowDecimalValue;
159    UINT32                  Length;                 /*  Length of printed field */
160    UINT8                   *CurrentAmlPtr = NULL;  /*  Pointer to current byte of AML value    */
161
162
163    FUNCTION_TRACE ("ExShowHexValue");
164
165
166    if (!AmlPtr)
167    {
168        REPORT_ERROR (("ExShowHexValue: null pointer\n"));
169    }
170
171    /*
172     * AML numbers are always stored little-endian,
173     * even if the processor is big-endian.
174     */
175    for (CurrentAmlPtr = AmlPtr + ByteCount,
176            Value = 0;
177            CurrentAmlPtr > AmlPtr; )
178    {
179        Value = (Value << 8) + (UINT32)* --CurrentAmlPtr;
180    }
181
182    Length = LeadSpace * ByteCount + 2;
183    if (ByteCount > 1)
184    {
185        Length += (ByteCount - 1);
186    }
187
188    ShowDecimalValue = (ByteCount > 1 || Value > 9);
189    if (ShowDecimalValue)
190    {
191        Length += 3 + AcpiExDigitsNeeded (Value, 10);
192    }
193
194    DEBUG_PRINT (TRACE_LOAD, (""));
195
196    for (Length = LeadSpace; Length; --Length )
197    {
198        DEBUG_PRINT_RAW (TRACE_LOAD, (" "));
199    }
200
201    while (ByteCount--)
202    {
203        DEBUG_PRINT_RAW (TRACE_LOAD, ("%02x", *AmlPtr++));
204
205        if (ByteCount)
206        {
207            DEBUG_PRINT_RAW (TRACE_LOAD, (" "));
208        }
209    }
210
211    if (ShowDecimalValue)
212    {
213        DEBUG_PRINT_RAW (TRACE_LOAD, (" [%ld]", Value));
214    }
215
216    if (0 == LeadSpace)
217    {
218        DEBUG_PRINT_RAW (TRACE_LOAD, (" "));
219    }
220
221    DEBUG_PRINT_RAW (TRACE_LOAD, ("\n"));
222    return_VOID;
223}
224
225
226/*****************************************************************************
227 *
228 * FUNCTION:    AcpiExDumpOperand
229 *
230 * PARAMETERS:  *EntryDesc          - Pointer to entry to be dumped
231 *
232 * RETURN:      Status
233 *
234 * DESCRIPTION: Dump a stack entry
235 *
236 ****************************************************************************/
237
238ACPI_STATUS
239AcpiExDumpOperand (
240    ACPI_OPERAND_OBJECT     *EntryDesc)
241{
242    UINT8                   *Buf = NULL;
243    UINT32                  Length;
244    UINT32                  i;
245
246
247    PROC_NAME ("ExDumpOperand")
248
249
250    if (!EntryDesc)
251    {
252        /*
253         * This usually indicates that something serious is wrong --
254         * since most (if not all)
255         * code that dumps the stack expects something to be there!
256         */
257        DEBUG_PRINTP (ACPI_INFO, ("Null stack entry ptr\n"));
258        return (AE_OK);
259    }
260
261    if (VALID_DESCRIPTOR_TYPE (EntryDesc, ACPI_DESC_TYPE_NAMED))
262    {
263        DEBUG_PRINTP (ACPI_INFO, ("Node: \n"));
264        DUMP_ENTRY (EntryDesc, ACPI_INFO);
265        return (AE_OK);
266    }
267
268    if (AcpiTbSystemTablePointer (EntryDesc))
269    {
270        DEBUG_PRINTP (ACPI_INFO, ("%p is an AML pointer\n",
271            EntryDesc));
272        return (AE_OK);
273    }
274
275    if (!VALID_DESCRIPTOR_TYPE (EntryDesc, ACPI_DESC_TYPE_INTERNAL))
276    {
277        DEBUG_PRINTP (ACPI_INFO, ("%p Not a local object \n", EntryDesc));
278        DUMP_BUFFER (EntryDesc, sizeof (ACPI_OPERAND_OBJECT));
279        return (AE_OK);
280    }
281
282    /*  EntryDesc is a valid object  */
283
284    DEBUG_PRINTP (ACPI_INFO, ("%p ", EntryDesc));
285
286    switch (EntryDesc->Common.Type)
287    {
288    case INTERNAL_TYPE_REFERENCE:
289
290        switch (EntryDesc->Reference.Opcode)
291        {
292        case AML_ZERO_OP:
293
294            DEBUG_PRINT_RAW (ACPI_INFO, ("Reference: Zero\n"));
295            break;
296
297
298        case AML_ONE_OP:
299
300            DEBUG_PRINT_RAW (ACPI_INFO, ("Reference: One\n"));
301            break;
302
303
304        case AML_ONES_OP:
305
306            DEBUG_PRINT_RAW (ACPI_INFO, ("Reference: Ones\n"));
307            break;
308
309
310        case AML_DEBUG_OP:
311
312            DEBUG_PRINT_RAW (ACPI_INFO, ("Reference: Debug\n"));
313            break;
314
315
316        case AML_NAME_OP:
317
318            DUMP_PATHNAME (EntryDesc->Reference.Object, "Reference: Name: ",
319                            ACPI_INFO, _COMPONENT);
320            DUMP_ENTRY (EntryDesc->Reference.Object, ACPI_INFO);
321            break;
322
323
324        case AML_INDEX_OP:
325
326            DEBUG_PRINT_RAW (ACPI_INFO, ("Reference: Index %p\n",
327                        EntryDesc->Reference.Object));
328            break;
329
330
331        case AML_ARG_OP:
332
333            DEBUG_PRINT_RAW (ACPI_INFO, ("Reference: Arg%d",
334                        EntryDesc->Reference.Offset));
335
336            if (ACPI_TYPE_INTEGER == EntryDesc->Common.Type)
337            {
338                /* Value is a Number */
339
340                DEBUG_PRINT_RAW (ACPI_INFO, (" value is [%ld]",
341                                            EntryDesc->Integer.Value));
342            }
343
344            DEBUG_PRINT_RAW (ACPI_INFO, ("\n"));
345            break;
346
347
348        case AML_LOCAL_OP:
349
350            DEBUG_PRINT_RAW (ACPI_INFO, ("Reference: Local%d",
351                        EntryDesc->Reference.Offset));
352
353            if (ACPI_TYPE_INTEGER == EntryDesc->Common.Type)
354            {
355
356                /* Value is a Number */
357
358                DEBUG_PRINT_RAW (ACPI_INFO, (" value is [%ld]",
359                                            EntryDesc->Integer.Value));
360            }
361
362            DEBUG_PRINT_RAW (ACPI_INFO, ("\n"));
363            break;
364
365
366        case AML_INT_NAMEPATH_OP:
367            DEBUG_PRINT_RAW (ACPI_INFO, ("Reference.Node->Name %x\n",
368                        EntryDesc->Reference.Node->Name));
369            break;
370
371        default:
372
373            /*  unknown opcode  */
374
375            DEBUG_PRINT_RAW (ACPI_INFO, ("Unknown opcode=%X\n",
376                EntryDesc->Reference.Opcode));
377            break;
378
379        }
380
381        break;
382
383
384    case ACPI_TYPE_BUFFER:
385
386        DEBUG_PRINT_RAW (ACPI_INFO, ("Buffer len %X @ %p \n",
387                    EntryDesc->Buffer.Length,
388                    EntryDesc->Buffer.Pointer));
389
390        Length = EntryDesc->Buffer.Length;
391
392        if (Length > 64)
393        {
394            Length = 64;
395        }
396
397        /* Debug only -- dump the buffer contents */
398
399        if (EntryDesc->Buffer.Pointer)
400        {
401            DEBUG_PRINT_RAW (ACPI_INFO, ("Buffer Contents: "));
402
403            for (Buf = EntryDesc->Buffer.Pointer; Length--; ++Buf)
404            {
405                DEBUG_PRINT_RAW (ACPI_INFO,
406                    (Length ? " %02x" : " %02x", *Buf));
407            }
408            DEBUG_PRINT_RAW (ACPI_INFO,("\n"));
409        }
410
411        break;
412
413
414    case ACPI_TYPE_INTEGER:
415
416        DEBUG_PRINT_RAW (ACPI_INFO, ("Number %lX\n",
417                    EntryDesc->Integer.Value));
418        break;
419
420
421    case INTERNAL_TYPE_IF:
422
423        DEBUG_PRINT_RAW (ACPI_INFO, ("If [Number] %lX\n",
424                    EntryDesc->Integer.Value));
425        break;
426
427
428    case INTERNAL_TYPE_WHILE:
429
430        DEBUG_PRINT_RAW (ACPI_INFO, ("While [Number] %lX\n",
431                    EntryDesc->Integer.Value));
432        break;
433
434
435    case ACPI_TYPE_PACKAGE:
436
437        DEBUG_PRINT_RAW (ACPI_INFO, ("Package count %X @ %p\n",
438                    EntryDesc->Package.Count, EntryDesc->Package.Elements));
439
440
441        /*
442         * If elements exist, package vector pointer is valid,
443         * and debug_level exceeds 1, dump package's elements.
444         */
445        if (EntryDesc->Package.Count &&
446            EntryDesc->Package.Elements &&
447            GetDebugLevel () > 1)
448        {
449            ACPI_OPERAND_OBJECT**Element;
450            UINT16              ElementIndex;
451
452            for (ElementIndex = 0, Element = EntryDesc->Package.Elements;
453                  ElementIndex < EntryDesc->Package.Count;
454                  ++ElementIndex, ++Element)
455            {
456                AcpiExDumpOperand (*Element);
457            }
458        }
459
460        DEBUG_PRINT_RAW (ACPI_INFO, ("\n"));
461
462        break;
463
464
465    case ACPI_TYPE_REGION:
466
467        DEBUG_PRINT_RAW (ACPI_INFO, ("Region %s (%X)",
468            AcpiUtGetRegionName (EntryDesc->Region.SpaceId),
469            EntryDesc->Region.SpaceId));
470
471        /*
472         * If the address and length have not been evaluated,
473         * don't print them.
474         */
475        if (!(EntryDesc->Region.Flags & AOPOBJ_DATA_VALID))
476        {
477            DEBUG_PRINT_RAW (ACPI_INFO, ("\n"));
478        }
479        else
480        {
481            DEBUG_PRINT_RAW (ACPI_INFO, (" base %p Length %X\n",
482                EntryDesc->Region.Address, EntryDesc->Region.Length));
483        }
484        break;
485
486
487    case ACPI_TYPE_STRING:
488
489        DEBUG_PRINT_RAW (ACPI_INFO, ("String length %X @ %p\n\n",
490                    EntryDesc->String.Length, EntryDesc->String.Pointer));
491
492        for (i=0; i < EntryDesc->String.Length; i++)
493        {
494            DEBUG_PRINT_RAW (ACPI_INFO, ("%c",
495                        EntryDesc->String.Pointer[i]));
496        }
497
498        DEBUG_PRINT_RAW (ACPI_INFO, ("\n\n"));
499        break;
500
501
502    case INTERNAL_TYPE_BANK_FIELD:
503
504        DEBUG_PRINT_RAW (ACPI_INFO, ("BankField\n"));
505        break;
506
507
508    case INTERNAL_TYPE_REGION_FIELD:
509
510        DEBUG_PRINT_RAW (ACPI_INFO,
511            ("RegionField: bits=%X  bitaccwidth=%X lock=%X update=%X at byte=%lX bit=%X of below:\n",
512            EntryDesc->Field.BitLength,      EntryDesc->Field.AccessBitWidth,
513            EntryDesc->Field.LockRule,       EntryDesc->Field.UpdateRule,
514            EntryDesc->Field.BaseByteOffset, EntryDesc->Field.StartFieldBitOffset));
515        DUMP_STACK_ENTRY (EntryDesc->Field.RegionObj);
516        break;
517
518
519    case INTERNAL_TYPE_INDEX_FIELD:
520
521        DEBUG_PRINT_RAW (ACPI_INFO, ("IndexField\n"));
522        break;
523
524
525    case ACPI_TYPE_BUFFER_FIELD:
526
527        DEBUG_PRINT_RAW (ACPI_INFO,
528            ("BufferField: %X bits at byte %lX bit %X of \n",
529            EntryDesc->BufferField.BitLength, EntryDesc->BufferField.BaseByteOffset,
530            EntryDesc->BufferField.StartFieldBitOffset));
531
532        if (!EntryDesc->BufferField.BufferObj)
533        {
534            DEBUG_PRINT (ACPI_INFO, ("*NULL* \n"));
535        }
536
537        else if (ACPI_TYPE_BUFFER !=
538                     EntryDesc->BufferField.BufferObj->Common.Type)
539        {
540            DEBUG_PRINT_RAW (ACPI_INFO, ("*not a Buffer* \n"));
541        }
542
543        else
544        {
545            DUMP_STACK_ENTRY (EntryDesc->BufferField.BufferObj);
546        }
547
548        break;
549
550
551    case ACPI_TYPE_EVENT:
552
553        DEBUG_PRINT_RAW (ACPI_INFO, ("Event\n"));
554        break;
555
556
557    case ACPI_TYPE_METHOD:
558
559        DEBUG_PRINT_RAW (ACPI_INFO,
560            ("Method(%X) @ %p:%lX\n",
561            EntryDesc->Method.ParamCount,
562            EntryDesc->Method.Pcode, EntryDesc->Method.PcodeLength));
563        break;
564
565
566    case ACPI_TYPE_MUTEX:
567
568        DEBUG_PRINT_RAW (ACPI_INFO, ("Mutex\n"));
569        break;
570
571
572    case ACPI_TYPE_DEVICE:
573
574        DEBUG_PRINT_RAW (ACPI_INFO, ("Device\n"));
575        break;
576
577
578    case ACPI_TYPE_POWER:
579
580        DEBUG_PRINT_RAW (ACPI_INFO, ("Power\n"));
581        break;
582
583
584    case ACPI_TYPE_PROCESSOR:
585
586        DEBUG_PRINT_RAW (ACPI_INFO, ("Processor\n"));
587        break;
588
589
590    case ACPI_TYPE_THERMAL:
591
592        DEBUG_PRINT_RAW (ACPI_INFO, ("Thermal\n"));
593        break;
594
595
596    default:
597        /*  unknown EntryDesc->Common.Type value    */
598
599        DEBUG_PRINT_RAW (ACPI_INFO, ("Unknown Type %X\n",
600            EntryDesc->Common.Type));
601
602        /* Back up to previous entry */
603
604        EntryDesc--;
605
606
607        /* TBD: [Restructure]  Change to use dump object routine !! */
608        /*       What is all of this?? */
609
610        DUMP_BUFFER (EntryDesc, sizeof (ACPI_OPERAND_OBJECT));
611        DUMP_BUFFER (++EntryDesc, sizeof (ACPI_OPERAND_OBJECT));
612        DUMP_BUFFER (++EntryDesc, sizeof (ACPI_OPERAND_OBJECT));
613        break;
614
615    }
616
617    return (AE_OK);
618}
619
620
621/*****************************************************************************
622 *
623 * FUNCTION:    AcpiExDumpOperands
624 *
625 * PARAMETERS:  InterpreterMode      - Load or Exec
626 *              *Ident              - Identification
627 *              NumLevels           - # of stack entries to dump above line
628 *              *Note               - Output notation
629 *
630 * DESCRIPTION: Dump the object stack
631 *
632 ****************************************************************************/
633
634void
635AcpiExDumpOperands (
636    ACPI_OPERAND_OBJECT     **Operands,
637    OPERATING_MODE          InterpreterMode,
638    NATIVE_CHAR             *Ident,
639    UINT32                  NumLevels,
640    NATIVE_CHAR             *Note,
641    NATIVE_CHAR             *ModuleName,
642    UINT32                  LineNumber)
643{
644    NATIVE_UINT             i;
645    ACPI_OPERAND_OBJECT     **EntryDesc;
646
647
648    if (!Ident)
649    {
650        Ident = "?";
651    }
652
653    if (!Note)
654    {
655        Note = "?";
656    }
657
658
659    DEBUG_PRINT (ACPI_INFO,
660        ("************* AcpiExDumpOperands  Mode=%X ******************\n",
661        InterpreterMode));
662    DEBUG_PRINT (ACPI_INFO,
663        ("From %12s(%d)  %s: %s\n", ModuleName, LineNumber, Ident, Note));
664
665    if (NumLevels == 0)
666    {
667        NumLevels = 1;
668    }
669
670    /* Dump the stack starting at the top, working down */
671
672    for (i = 0; NumLevels > 0; i--, NumLevels--)
673    {
674        EntryDesc = &Operands[i];
675
676        if (ACPI_FAILURE (AcpiExDumpOperand (*EntryDesc)))
677        {
678            break;
679        }
680    }
681
682    return;
683}
684
685
686/*****************************************************************************
687 *
688 * FUNCTION:    AcpiExDumpNode
689 *
690 * PARAMETERS:  *Node           - Descriptor to dump
691 *              Flags               - Force display
692 *
693 * DESCRIPTION: Dumps the members of the given.Node
694 *
695 ****************************************************************************/
696
697void
698AcpiExDumpNode (
699    ACPI_NAMESPACE_NODE     *Node,
700    UINT32                  Flags)
701{
702
703    if (!Flags)
704    {
705        if (!((TRACE_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer)))
706        {
707            return;
708        }
709    }
710
711
712    AcpiOsPrintf ("%20s : %4.4s\n", "Name",             &Node->Name);
713    AcpiOsPrintf ("%20s : %s\n",    "Type",             AcpiUtGetTypeName (Node->Type));
714    AcpiOsPrintf ("%20s : %X\n",    "Flags",            Node->Flags);
715    AcpiOsPrintf ("%20s : %X\n",    "Owner Id",         Node->OwnerId);
716    AcpiOsPrintf ("%20s : %X\n",    "Reference Count",  Node->ReferenceCount);
717    AcpiOsPrintf ("%20s : %p\n",    "Attached Object",  Node->Object);
718    AcpiOsPrintf ("%20s : %p\n",    "ChildList",        Node->Child);
719    AcpiOsPrintf ("%20s : %p\n",    "NextPeer",         Node->Peer);
720    AcpiOsPrintf ("%20s : %p\n",    "Parent",           AcpiNsGetParentObject (Node));
721}
722
723
724/*****************************************************************************
725 *
726 * FUNCTION:    AcpiExDumpObjectDescriptor
727 *
728 * PARAMETERS:  *Object             - Descriptor to dump
729 *              Flags               - Force display
730 *
731 * DESCRIPTION: Dumps the members of the object descriptor given.
732 *
733 ****************************************************************************/
734
735void
736AcpiExDumpObjectDescriptor (
737    ACPI_OPERAND_OBJECT     *ObjDesc,
738    UINT32                  Flags)
739{
740    FUNCTION_TRACE ("ExDumpObjectDescriptor");
741
742
743    if (!Flags)
744    {
745        if (!((TRACE_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer)))
746        {
747            return;
748        }
749    }
750
751    if (!(VALID_DESCRIPTOR_TYPE (ObjDesc, ACPI_DESC_TYPE_INTERNAL)))
752    {
753        AcpiOsPrintf ("%p is not a valid ACPI object\n", ObjDesc);
754        return;
755    }
756
757    /* Common Fields */
758
759    AcpiOsPrintf ("%20s : %X\n",   "Reference Count", ObjDesc->Common.ReferenceCount);
760    AcpiOsPrintf ("%20s : %X\n",   "Flags", ObjDesc->Common.Flags);
761
762    /* Object-specific Fields */
763
764    switch (ObjDesc->Common.Type)
765    {
766    case ACPI_TYPE_INTEGER:
767
768        AcpiOsPrintf ("%20s : %s\n", "Type", "Number");
769        AcpiOsPrintf ("%20s : %X\n", "Value", ObjDesc->Integer.Value);
770        break;
771
772
773    case ACPI_TYPE_STRING:
774
775        AcpiOsPrintf ("%20s : %s\n", "Type", "String");
776        AcpiOsPrintf ("%20s : %X\n", "Length", ObjDesc->String.Length);
777        AcpiOsPrintf ("%20s : %p\n", "Pointer", ObjDesc->String.Pointer);
778        break;
779
780
781    case ACPI_TYPE_BUFFER:
782
783        AcpiOsPrintf ("%20s : %s\n", "Type", "Buffer");
784        AcpiOsPrintf ("%20s : %X\n", "Length", ObjDesc->Buffer.Length);
785        AcpiOsPrintf ("%20s : %p\n", "Pointer", ObjDesc->Buffer.Pointer);
786        break;
787
788
789    case ACPI_TYPE_PACKAGE:
790
791        AcpiOsPrintf ("%20s : %s\n", "Type", "Package");
792        AcpiOsPrintf ("%20s : %X\n", "Count", ObjDesc->Package.Count);
793        AcpiOsPrintf ("%20s : %p\n", "Elements", ObjDesc->Package.Elements);
794        AcpiOsPrintf ("%20s : %p\n", "NextElement", ObjDesc->Package.NextElement);
795        break;
796
797
798    case ACPI_TYPE_BUFFER_FIELD:
799
800        AcpiOsPrintf ("%20s : %s\n", "Type", "BufferField");
801        AcpiOsPrintf ("%20s : %X\n", "BitLength", ObjDesc->BufferField.BitLength);
802        AcpiOsPrintf ("%20s : %X\n", "BitOffset", ObjDesc->BufferField.StartFieldBitOffset);
803        AcpiOsPrintf ("%20s : %X\n", "BaseByteOffset",ObjDesc->BufferField.BaseByteOffset);
804        AcpiOsPrintf ("%20s : %p\n", "BufferObj", ObjDesc->BufferField.BufferObj);
805        break;
806
807
808    case ACPI_TYPE_DEVICE:
809
810        AcpiOsPrintf ("%20s : %s\n", "Type", "Device");
811        AcpiOsPrintf ("%20s : %p\n", "AddrHandler", ObjDesc->Device.AddrHandler);
812        AcpiOsPrintf ("%20s : %p\n", "SysHandler", ObjDesc->Device.SysHandler);
813        AcpiOsPrintf ("%20s : %p\n", "DrvHandler", ObjDesc->Device.DrvHandler);
814        break;
815
816    case ACPI_TYPE_EVENT:
817
818        AcpiOsPrintf ("%20s : %s\n", "Type", "Event");
819        AcpiOsPrintf ("%20s : %X\n", "Semaphore", ObjDesc->Event.Semaphore);
820        break;
821
822
823    case ACPI_TYPE_METHOD:
824
825        AcpiOsPrintf ("%20s : %s\n", "Type", "Method");
826        AcpiOsPrintf ("%20s : %X\n", "ParamCount", ObjDesc->Method.ParamCount);
827        AcpiOsPrintf ("%20s : %X\n", "Concurrency", ObjDesc->Method.Concurrency);
828        AcpiOsPrintf ("%20s : %p\n", "Semaphore", ObjDesc->Method.Semaphore);
829        AcpiOsPrintf ("%20s : %X\n", "PcodeLength", ObjDesc->Method.PcodeLength);
830        AcpiOsPrintf ("%20s : %X\n", "Pcode", ObjDesc->Method.Pcode);
831        break;
832
833
834    case ACPI_TYPE_MUTEX:
835
836        AcpiOsPrintf ("%20s : %s\n", "Type", "Mutex");
837        AcpiOsPrintf ("%20s : %X\n", "SyncLevel", ObjDesc->Mutex.SyncLevel);
838        AcpiOsPrintf ("%20s : %p\n", "Owner", ObjDesc->Mutex.Owner);
839        AcpiOsPrintf ("%20s : %X\n", "AcquisitionDepth", ObjDesc->Mutex.AcquisitionDepth);
840        AcpiOsPrintf ("%20s : %p\n", "Semaphore", ObjDesc->Mutex.Semaphore);
841        break;
842
843
844    case ACPI_TYPE_REGION:
845
846        AcpiOsPrintf ("%20s : %s\n", "Type", "Region");
847        AcpiOsPrintf ("%20s : %X\n", "SpaceId", ObjDesc->Region.SpaceId);
848        AcpiOsPrintf ("%20s : %X\n", "Flags", ObjDesc->Region.Flags);
849        AcpiOsPrintf ("%20s : %X\n", "Address", ObjDesc->Region.Address);
850        AcpiOsPrintf ("%20s : %X\n", "Length", ObjDesc->Region.Length);
851        AcpiOsPrintf ("%20s : %p\n", "AddrHandler", ObjDesc->Region.AddrHandler);
852        AcpiOsPrintf ("%20s : %p\n", "Next", ObjDesc->Region.Next);
853        break;
854
855
856    case ACPI_TYPE_POWER:
857
858        AcpiOsPrintf ("%20s : %s\n", "Type", "PowerResource");
859        AcpiOsPrintf ("%20s : %X\n", "SystemLevel", ObjDesc->PowerResource.SystemLevel);
860        AcpiOsPrintf ("%20s : %X\n", "ResourceOrder", ObjDesc->PowerResource.ResourceOrder);
861        AcpiOsPrintf ("%20s : %p\n", "SysHandler", ObjDesc->PowerResource.SysHandler);
862        AcpiOsPrintf ("%20s : %p\n", "DrvHandler", ObjDesc->PowerResource.DrvHandler);
863        break;
864
865
866    case ACPI_TYPE_PROCESSOR:
867
868        AcpiOsPrintf ("%20s : %s\n", "Type", "Processor");
869        AcpiOsPrintf ("%20s : %X\n", "Processor ID", ObjDesc->Processor.ProcId);
870        AcpiOsPrintf ("%20s : %X\n", "Length", ObjDesc->Processor.Length);
871        AcpiOsPrintf ("%20s : %X\n", "Address", ObjDesc->Processor.Address);
872        AcpiOsPrintf ("%20s : %p\n", "SysHandler", ObjDesc->Processor.SysHandler);
873        AcpiOsPrintf ("%20s : %p\n", "DrvHandler", ObjDesc->Processor.DrvHandler);
874        AcpiOsPrintf ("%20s : %p\n", "AddrHandler", ObjDesc->Processor.AddrHandler);
875        break;
876
877
878    case ACPI_TYPE_THERMAL:
879
880        AcpiOsPrintf ("%20s : %s\n", "Type", "ThermalZone");
881        AcpiOsPrintf ("%20s : %p\n", "SysHandler", ObjDesc->ThermalZone.SysHandler);
882        AcpiOsPrintf ("%20s : %p\n", "DrvHandler", ObjDesc->ThermalZone.DrvHandler);
883        AcpiOsPrintf ("%20s : %p\n", "AddrHandler", ObjDesc->ThermalZone.AddrHandler);
884        break;
885
886
887    case INTERNAL_TYPE_REGION_FIELD:
888
889        AcpiOsPrintf ("%20s : %p\n", "AccessBitWidth", ObjDesc->Field.AccessBitWidth);
890        AcpiOsPrintf ("%20s : %p\n", "BitLength", ObjDesc->Field.BitLength);
891        AcpiOsPrintf ("%20s : %p\n", "BaseByteOffset",ObjDesc->Field.BaseByteOffset);
892        AcpiOsPrintf ("%20s : %p\n", "BitOffset", ObjDesc->Field.StartFieldBitOffset);
893        AcpiOsPrintf ("%20s : %p\n", "RegionObj", ObjDesc->Field.RegionObj);
894        break;
895
896
897    case INTERNAL_TYPE_BANK_FIELD:
898
899        AcpiOsPrintf ("%20s : %s\n", "Type", "BankField");
900        AcpiOsPrintf ("%20s : %X\n", "AccessBitWidth", ObjDesc->BankField.AccessBitWidth);
901        AcpiOsPrintf ("%20s : %X\n", "LockRule", ObjDesc->BankField.LockRule);
902        AcpiOsPrintf ("%20s : %X\n", "UpdateRule", ObjDesc->BankField.UpdateRule);
903        AcpiOsPrintf ("%20s : %X\n", "BitLength", ObjDesc->BankField.BitLength);
904        AcpiOsPrintf ("%20s : %X\n", "BitOffset", ObjDesc->BankField.StartFieldBitOffset);
905        AcpiOsPrintf ("%20s : %X\n", "BaseByteOffset", ObjDesc->BankField.BaseByteOffset);
906        AcpiOsPrintf ("%20s : %X\n", "Value", ObjDesc->BankField.Value);
907        AcpiOsPrintf ("%20s : %p\n", "RegionObj", ObjDesc->BankField.RegionObj);
908        AcpiOsPrintf ("%20s : %X\n", "BankRegisterObj", ObjDesc->BankField.BankRegisterObj);
909        break;
910
911
912    case INTERNAL_TYPE_INDEX_FIELD:
913
914        AcpiOsPrintf ("%20s : %s\n", "Type", "IndexField");
915        AcpiOsPrintf ("%20s : %X\n", "AccessBitWidth", ObjDesc->IndexField.AccessBitWidth);
916        AcpiOsPrintf ("%20s : %X\n", "LockRule", ObjDesc->IndexField.LockRule);
917        AcpiOsPrintf ("%20s : %X\n", "UpdateRule", ObjDesc->IndexField.UpdateRule);
918        AcpiOsPrintf ("%20s : %X\n", "BitLength", ObjDesc->IndexField.BitLength);
919        AcpiOsPrintf ("%20s : %X\n", "BitOffset", ObjDesc->IndexField.StartFieldBitOffset);
920        AcpiOsPrintf ("%20s : %X\n", "Value", ObjDesc->IndexField.Value);
921        AcpiOsPrintf ("%20s : %X\n", "Index", ObjDesc->IndexField.IndexObj);
922        AcpiOsPrintf ("%20s : %X\n", "Data", ObjDesc->IndexField.DataObj);
923        break;
924
925
926    case INTERNAL_TYPE_REFERENCE:
927
928        AcpiOsPrintf ("%20s : %s\n", "Type", "Reference");
929        AcpiOsPrintf ("%20s : %X\n", "TargetType", ObjDesc->Reference.TargetType);
930        AcpiOsPrintf ("%20s : %X\n", "Opcode", ObjDesc->Reference.Opcode);
931        AcpiOsPrintf ("%20s : %X\n", "Offset", ObjDesc->Reference.Offset);
932        AcpiOsPrintf ("%20s : %p\n", "ObjDesc", ObjDesc->Reference.Object);
933        AcpiOsPrintf ("%20s : %p\n", "Node", ObjDesc->Reference.Node);
934        AcpiOsPrintf ("%20s : %p\n", "Where", ObjDesc->Reference.Where);
935        break;
936
937
938    case INTERNAL_TYPE_ADDRESS_HANDLER:
939
940        AcpiOsPrintf ("%20s : %s\n", "Type", "Address Handler");
941        AcpiOsPrintf ("%20s : %X\n", "SpaceId", ObjDesc->AddrHandler.SpaceId);
942        AcpiOsPrintf ("%20s : %p\n", "Next", ObjDesc->AddrHandler.Next);
943        AcpiOsPrintf ("%20s : %p\n", "RegionList", ObjDesc->AddrHandler.RegionList);
944        AcpiOsPrintf ("%20s : %p\n", "Node", ObjDesc->AddrHandler.Node);
945        AcpiOsPrintf ("%20s : %p\n", "Handler", ObjDesc->AddrHandler.Handler);
946        AcpiOsPrintf ("%20s : %p\n", "Context", ObjDesc->AddrHandler.Context);
947        break;
948
949
950    case INTERNAL_TYPE_NOTIFY:
951
952        AcpiOsPrintf ("%20s : %s\n", "Type", "Notify Handler");
953        AcpiOsPrintf ("%20s : %p\n", "Node", ObjDesc->NotifyHandler.Node);
954        AcpiOsPrintf ("%20s : %p\n", "Handler", ObjDesc->NotifyHandler.Handler);
955        AcpiOsPrintf ("%20s : %p\n", "Context", ObjDesc->NotifyHandler.Context);
956        break;
957
958
959    case INTERNAL_TYPE_ALIAS:
960    case INTERNAL_TYPE_FIELD_DEFN:
961    case INTERNAL_TYPE_BANK_FIELD_DEFN:
962    case INTERNAL_TYPE_INDEX_FIELD_DEFN:
963    case INTERNAL_TYPE_IF:
964    case INTERNAL_TYPE_ELSE:
965    case INTERNAL_TYPE_WHILE:
966    case INTERNAL_TYPE_SCOPE:
967    case INTERNAL_TYPE_DEF_ANY:
968
969        AcpiOsPrintf ("*** Structure display not implemented for type %X! ***\n",
970            ObjDesc->Common.Type);
971        break;
972
973
974    default:
975
976        AcpiOsPrintf ("*** Cannot display unknown type %X! ***\n", ObjDesc->Common.Type);
977        break;
978    }
979
980    return_VOID;
981}
982
983#endif
984
985