nsdump.c revision 107325
1/******************************************************************************
2 *
3 * Module Name: nsdump - table dumping routines for debug
4 *              $Revision: 146 $
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
27 * make derivatives, distribute, use and display any portion of the Covered
28 * Code in any form, with the right to sublicense such rights; and
29 *
30 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
31 * license (with the right to sublicense), under only those claims of Intel
32 * patents that are infringed by the Original Intel Code, to make, use, sell,
33 * offer to sell, and import the Covered Code and derivative works thereof
34 * solely to the minimum extent necessary to exercise the above copyright
35 * license, and in no event shall the patent license extend to any additions
36 * to or modifications of the Original Intel Code.  No other license or right
37 * is granted directly or by implication, estoppel or otherwise;
38 *
39 * The above copyright and patent license is granted only if the following
40 * conditions are met:
41 *
42 * 3. Conditions
43 *
44 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
45 * Redistribution of source code of any substantial portion of the Covered
46 * Code or modification with rights to further distribute source must include
47 * the above Copyright Notice, the above License, this list of Conditions,
48 * and the following Disclaimer and Export Compliance provision.  In addition,
49 * Licensee must cause all Covered Code to which Licensee contributes to
50 * contain a file documenting the changes Licensee made to create that Covered
51 * Code and the date of any change.  Licensee must include in that file the
52 * documentation of any changes made by any predecessor Licensee.  Licensee
53 * must include a prominent statement that the modification is derived,
54 * directly or indirectly, from Original Intel Code.
55 *
56 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
57 * Redistribution of source code of any substantial portion of the Covered
58 * Code or modification without rights to further distribute source must
59 * include the following Disclaimer and Export Compliance provision in the
60 * documentation and/or other materials provided with distribution.  In
61 * addition, Licensee may not authorize further sublicense of source of any
62 * portion of the Covered Code, and must include terms to the effect that the
63 * license from Licensee to its licensee is limited to the intellectual
64 * property embodied in the software Licensee provides to its licensee, and
65 * not to intellectual property embodied in modifications its licensee may
66 * make.
67 *
68 * 3.3. Redistribution of Executable. Redistribution in executable form of any
69 * substantial portion of the Covered Code or modification must reproduce the
70 * above Copyright Notice, and the following Disclaimer and Export Compliance
71 * provision in the documentation and/or other materials provided with the
72 * distribution.
73 *
74 * 3.4. Intel retains all right, title, and interest in and to the Original
75 * Intel Code.
76 *
77 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
78 * Intel shall be used in advertising or otherwise to promote the sale, use or
79 * other dealings in products derived from or relating to the Covered Code
80 * without prior written authorization from Intel.
81 *
82 * 4. Disclaimer and Export Compliance
83 *
84 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
85 * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
86 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
87 * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
88 * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
89 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90 * PARTICULAR PURPOSE.
91 *
92 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
93 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
94 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
95 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
96 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
97 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
98 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99 * LIMITED REMEDY.
100 *
101 * 4.3. Licensee shall not export, either directly or indirectly, any of this
102 * software or system incorporating such software without first obtaining any
103 * required license or other approval from the U. S. Department of Commerce or
104 * any other agency or department of the United States Government.  In the
105 * event Licensee exports any such software from the United States or
106 * re-exports any such software from a foreign destination, Licensee shall
107 * ensure that the distribution and export/re-export of the software is in
108 * compliance with all laws, regulations, orders, or other restrictions of the
109 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
110 * any of its subsidiaries will export/re-export any technical data, process,
111 * software, or service, directly or indirectly, to any country for which the
112 * United States government or any agency thereof requires an export license,
113 * other governmental approval, or letter of assurance, without first obtaining
114 * such license, approval or letter.
115 *
116 *****************************************************************************/
117
118#define __NSDUMP_C__
119
120#include "acpi.h"
121#include "acnamesp.h"
122#include "acparser.h"
123
124
125#define _COMPONENT          ACPI_NAMESPACE
126        ACPI_MODULE_NAME    ("nsdump")
127
128#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
129
130
131/*******************************************************************************
132 *
133 * FUNCTION:    AcpiNsPrintPathname
134 *
135 * PARAMETERS:  NumSegment          - Number of ACPI name segments
136 *              Pathname            - The compressed (internal) path
137 *
138 * DESCRIPTION: Print an object's full namespace pathname
139 *
140 ******************************************************************************/
141
142void
143AcpiNsPrintPathname (
144    UINT32                  NumSegments,
145    char                    *Pathname)
146{
147    ACPI_FUNCTION_NAME ("NsPrintPathname");
148
149
150    if (!(AcpiDbgLevel & ACPI_LV_NAMES) || !(AcpiDbgLayer & ACPI_NAMESPACE))
151    {
152        return;
153    }
154
155        /* Print the entire name */
156
157    ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "["));
158
159    while (NumSegments)
160    {
161        AcpiOsPrintf ("%4.4s", Pathname);
162        Pathname += ACPI_NAME_SIZE;
163
164        NumSegments--;
165        if (NumSegments)
166        {
167            AcpiOsPrintf (".");
168        }
169    }
170
171    AcpiOsPrintf ("]\n");
172}
173
174
175/*******************************************************************************
176 *
177 * FUNCTION:    AcpiNsDumpPathname
178 *
179 * PARAMETERS:  Handle              - Object
180 *              Msg                 - Prefix message
181 *              Level               - Desired debug level
182 *              Component           - Caller's component ID
183 *
184 * DESCRIPTION: Print an object's full namespace pathname
185 *              Manages allocation/freeing of a pathname buffer
186 *
187 ******************************************************************************/
188
189ACPI_STATUS
190AcpiNsDumpPathname (
191    ACPI_HANDLE             Handle,
192    NATIVE_CHAR             *Msg,
193    UINT32                  Level,
194    UINT32                  Component)
195{
196    ACPI_BUFFER             Buffer;
197    ACPI_STATUS             Status;
198
199
200    ACPI_FUNCTION_TRACE ("NsDumpPathname");
201
202
203    /* Do this only if the requested debug level and component are enabled */
204
205    if (!(AcpiDbgLevel & Level) || !(AcpiDbgLayer & Component))
206    {
207        return_ACPI_STATUS (AE_OK);
208    }
209
210    /* Convert handle to a full pathname and print it (with supplied message) */
211
212    Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
213
214    Status = AcpiNsHandleToPathname (Handle, &Buffer);
215    if (ACPI_SUCCESS (Status))
216    {
217        AcpiOsPrintf ("%s %s (Node %p)\n", Msg, (char *) Buffer.Pointer, Handle);
218        ACPI_MEM_FREE (Buffer.Pointer);
219    }
220
221    return_ACPI_STATUS (Status);
222}
223
224
225/*******************************************************************************
226 *
227 * FUNCTION:    AcpiNsDumpOneObject
228 *
229 * PARAMETERS:  Handle              - Node to be dumped
230 *              Level               - Nesting level of the handle
231 *              Context             - Passed into WalkNamespace
232 *
233 * DESCRIPTION: Dump a single Node
234 *              This procedure is a UserFunction called by AcpiNsWalkNamespace.
235 *
236 ******************************************************************************/
237
238ACPI_STATUS
239AcpiNsDumpOneObject (
240    ACPI_HANDLE             ObjHandle,
241    UINT32                  Level,
242    void                    *Context,
243    void                    **ReturnValue)
244{
245    ACPI_WALK_INFO          *Info = (ACPI_WALK_INFO *) Context;
246    ACPI_NAMESPACE_NODE     *ThisNode;
247    ACPI_OPERAND_OBJECT     *ObjDesc = NULL;
248    ACPI_OBJECT_TYPE        ObjType;
249    ACPI_OBJECT_TYPE        Type;
250    UINT32                  BytesToDump;
251    UINT32                  DbgLevel;
252    UINT32                  i;
253
254
255    ACPI_FUNCTION_NAME ("NsDumpOneObject");
256
257
258    /* Is output enabled? */
259
260    if (!(AcpiDbgLevel & Info->DebugLevel))
261    {
262        return (AE_OK);
263    }
264
265    if (!ObjHandle)
266    {
267        ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null object handle\n"));
268        return (AE_OK);
269    }
270
271    ThisNode = AcpiNsMapHandleToNode (ObjHandle);
272    Type = ThisNode->Type;
273
274    /* Check if the owner matches */
275
276    if ((Info->OwnerId != ACPI_UINT32_MAX) &&
277        (Info->OwnerId != ThisNode->OwnerId))
278    {
279        return (AE_OK);
280    }
281
282    /* Indent the object according to the level */
283
284    AcpiOsPrintf ("%2d%*s", (UINT32) Level - 1, (int) Level * 2, " ");
285
286    /* Check the node type and name */
287
288    if (Type > ACPI_TYPE_LOCAL_MAX)
289    {
290        ACPI_REPORT_WARNING (("Invalid ACPI Type %08X\n", Type));
291    }
292
293    if (!AcpiUtValidAcpiName (ThisNode->Name.Integer))
294    {
295        ACPI_REPORT_WARNING (("Invalid ACPI Name %08X\n", ThisNode->Name.Integer));
296    }
297
298    /*
299     * Now we can print out the pertinent information
300     */
301    AcpiOsPrintf ("%4.4s %-12s %p ",
302            ThisNode->Name.Ascii, AcpiUtGetTypeName (Type), ThisNode);
303
304    DbgLevel = AcpiDbgLevel;
305    AcpiDbgLevel = 0;
306    ObjDesc = AcpiNsGetAttachedObject (ThisNode);
307    AcpiDbgLevel = DbgLevel;
308
309    switch (Info->DisplayType)
310    {
311    case ACPI_DISPLAY_SUMMARY:
312
313        if (!ObjDesc)
314        {
315            /* No attached object, we are done */
316
317            AcpiOsPrintf ("\n");
318            return (AE_OK);
319        }
320
321        switch (Type)
322        {
323        case ACPI_TYPE_PROCESSOR:
324
325            AcpiOsPrintf ("ID %X Len %.4X Addr %p\n",
326                        ObjDesc->Processor.ProcId,
327                        ObjDesc->Processor.Length,
328                        (char *) ObjDesc->Processor.Address);
329            break;
330
331
332        case ACPI_TYPE_DEVICE:
333
334            AcpiOsPrintf ("Notify object: %p", ObjDesc);
335            break;
336
337
338        case ACPI_TYPE_METHOD:
339
340            AcpiOsPrintf ("Args %X Len %.4X Aml %p\n",
341                        (UINT32) ObjDesc->Method.ParamCount,
342                        ObjDesc->Method.AmlLength,
343                        ObjDesc->Method.AmlStart);
344            break;
345
346
347        case ACPI_TYPE_INTEGER:
348
349            AcpiOsPrintf ("= %8.8X%8.8X\n",
350                        ACPI_HIDWORD (ObjDesc->Integer.Value),
351                        ACPI_LODWORD (ObjDesc->Integer.Value));
352            break;
353
354
355        case ACPI_TYPE_PACKAGE:
356
357            if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
358            {
359                AcpiOsPrintf ("Elements %.2X\n",
360                            ObjDesc->Package.Count);
361            }
362            else
363            {
364                AcpiOsPrintf ("[Length not yet evaluated]\n");
365            }
366            break;
367
368
369        case ACPI_TYPE_BUFFER:
370
371            if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
372            {
373                AcpiOsPrintf ("Len %.2X",
374                            ObjDesc->Buffer.Length);
375
376                /* Dump some of the buffer */
377
378                if (ObjDesc->Buffer.Length > 0)
379                {
380                    AcpiOsPrintf (" =");
381                    for (i = 0; (i < ObjDesc->Buffer.Length && i < 12); i++)
382                    {
383                        AcpiOsPrintf (" %.2hX", ObjDesc->Buffer.Pointer[i]);
384                    }
385                }
386                AcpiOsPrintf ("\n");
387            }
388            else
389            {
390                AcpiOsPrintf ("[Length not yet evaluated]\n");
391            }
392            break;
393
394
395        case ACPI_TYPE_STRING:
396
397            AcpiOsPrintf ("Len %.2X ", ObjDesc->String.Length);
398            AcpiUtPrintString (ObjDesc->String.Pointer, 32);
399            AcpiOsPrintf ("\n");
400            break;
401
402
403        case ACPI_TYPE_REGION:
404
405            AcpiOsPrintf ("[%s]", AcpiUtGetRegionName (ObjDesc->Region.SpaceId));
406            if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
407            {
408                AcpiOsPrintf (" Addr %8.8X%8.8X Len %.4X\n",
409                            ACPI_HIDWORD (ObjDesc->Region.Address),
410                            ACPI_LODWORD (ObjDesc->Region.Address),
411                            ObjDesc->Region.Length);
412            }
413            else
414            {
415                AcpiOsPrintf (" [Address/Length not yet evaluated]\n");
416            }
417            break;
418
419
420        case ACPI_TYPE_LOCAL_REFERENCE:
421
422            AcpiOsPrintf ("[%s]\n",
423                    AcpiPsGetOpcodeName (ObjDesc->Reference.Opcode));
424            break;
425
426
427        case ACPI_TYPE_BUFFER_FIELD:
428
429            if (ObjDesc->BufferField.BufferObj &&
430                ObjDesc->BufferField.BufferObj->Buffer.Node)
431            {
432                AcpiOsPrintf ("Buf [%4.4s]",
433                        ObjDesc->BufferField.BufferObj->Buffer.Node->Name.Ascii);
434            }
435            break;
436
437
438        case ACPI_TYPE_LOCAL_REGION_FIELD:
439
440            AcpiOsPrintf ("Rgn [%4.4s]",
441                    ObjDesc->CommonField.RegionObj->Region.Node->Name.Ascii);
442            break;
443
444
445        case ACPI_TYPE_LOCAL_BANK_FIELD:
446
447            AcpiOsPrintf ("Rgn [%4.4s] Bnk [%4.4s]",
448                    ObjDesc->CommonField.RegionObj->Region.Node->Name.Ascii,
449                    ObjDesc->BankField.BankObj->CommonField.Node->Name.Ascii);
450            break;
451
452
453        case ACPI_TYPE_LOCAL_INDEX_FIELD:
454
455            AcpiOsPrintf ("Idx [%4.4s] Dat [%4.4s]",
456                    ObjDesc->IndexField.IndexObj->CommonField.Node->Name.Ascii,
457                    ObjDesc->IndexField.DataObj->CommonField.Node->Name.Ascii);
458            break;
459
460
461        case ACPI_TYPE_LOCAL_ALIAS:
462
463            AcpiOsPrintf ("Target %4.4s (%p)\n", ((ACPI_NAMESPACE_NODE *) ObjDesc)->Name.Ascii, ObjDesc);
464            break;
465
466        default:
467
468            AcpiOsPrintf ("Object %p\n", ObjDesc);
469            break;
470        }
471
472        /* Common field handling */
473
474        switch (Type)
475        {
476        case ACPI_TYPE_BUFFER_FIELD:
477        case ACPI_TYPE_LOCAL_REGION_FIELD:
478        case ACPI_TYPE_LOCAL_BANK_FIELD:
479        case ACPI_TYPE_LOCAL_INDEX_FIELD:
480
481            AcpiOsPrintf (" Off %.2X Len %.2X Acc %.2hd\n",
482                    (ObjDesc->CommonField.BaseByteOffset * 8)
483                        + ObjDesc->CommonField.StartFieldBitOffset,
484                    ObjDesc->CommonField.BitLength,
485                    ObjDesc->CommonField.AccessByteWidth);
486            break;
487
488        default:
489            break;
490        }
491        break;
492
493
494    case ACPI_DISPLAY_OBJECTS:
495
496        AcpiOsPrintf ("O:%p", ObjDesc);
497        if (!ObjDesc)
498        {
499            /* No attached object, we are done */
500
501            AcpiOsPrintf ("\n");
502            return (AE_OK);
503        }
504
505        AcpiOsPrintf ("(R%d)",
506                ObjDesc->Common.ReferenceCount);
507
508        switch (Type)
509        {
510        case ACPI_TYPE_METHOD:
511
512            /* Name is a Method and its AML offset/length are set */
513
514            AcpiOsPrintf (" M:%p-%X\n", ObjDesc->Method.AmlStart,
515                                        ObjDesc->Method.AmlLength);
516            break;
517
518        case ACPI_TYPE_INTEGER:
519
520            AcpiOsPrintf (" N:%X%X\n", ACPI_HIDWORD(ObjDesc->Integer.Value),
521                                       ACPI_LODWORD(ObjDesc->Integer.Value));
522            break;
523
524        case ACPI_TYPE_STRING:
525
526            AcpiOsPrintf (" S:%p-%X\n", ObjDesc->String.Pointer,
527                                        ObjDesc->String.Length);
528            break;
529
530        case ACPI_TYPE_BUFFER:
531
532            AcpiOsPrintf (" B:%p-%X\n", ObjDesc->Buffer.Pointer,
533                                        ObjDesc->Buffer.Length);
534            break;
535
536        default:
537
538            AcpiOsPrintf ("\n");
539            break;
540        }
541        break;
542
543
544    default:
545        AcpiOsPrintf ("\n");
546        break;
547    }
548
549    /* If debug turned off, done */
550
551    if (!(AcpiDbgLevel & ACPI_LV_VALUES))
552    {
553        return (AE_OK);
554    }
555
556
557    /* If there is an attached object, display it */
558
559    DbgLevel     = AcpiDbgLevel;
560    AcpiDbgLevel = 0;
561    ObjDesc      = AcpiNsGetAttachedObject (ThisNode);
562    AcpiDbgLevel = DbgLevel;
563
564    /* Dump attached objects */
565
566    while (ObjDesc)
567    {
568        ObjType = ACPI_TYPE_INVALID;
569        AcpiOsPrintf ("        Attached Object %p: ", ObjDesc);
570
571        /* Decode the type of attached object and dump the contents */
572
573        switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
574        {
575        case ACPI_DESC_TYPE_NAMED:
576
577            AcpiOsPrintf ("(Ptr to Node)\n");
578            BytesToDump = sizeof (ACPI_NAMESPACE_NODE);
579            break;
580
581
582        case ACPI_DESC_TYPE_OPERAND:
583
584            ObjType = ACPI_GET_OBJECT_TYPE (ObjDesc);
585
586            if (ObjType > ACPI_TYPE_LOCAL_MAX)
587            {
588                AcpiOsPrintf ("(Ptr to ACPI Object type %X [UNKNOWN])\n", ObjType);
589                BytesToDump = 32;
590            }
591            else
592            {
593                AcpiOsPrintf ("(Ptr to ACPI Object type %s, %X)\n",
594                                    AcpiUtGetTypeName (ObjType), ObjType);
595                BytesToDump = sizeof (ACPI_OPERAND_OBJECT);
596            }
597            break;
598
599
600        default:
601
602            AcpiOsPrintf ("(String or Buffer ptr - not an object descriptor)\n");
603            BytesToDump = 16;
604            break;
605        }
606
607        ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
608
609        /* If value is NOT an internal object, we are done */
610
611        if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
612        {
613            goto Cleanup;
614        }
615
616        /*
617         * Valid object, get the pointer to next level, if any
618         */
619        switch (ObjType)
620        {
621        case ACPI_TYPE_STRING:
622            ObjDesc = (void *) ObjDesc->String.Pointer;
623            break;
624
625        case ACPI_TYPE_BUFFER:
626            ObjDesc = (void *) ObjDesc->Buffer.Pointer;
627            break;
628
629        case ACPI_TYPE_BUFFER_FIELD:
630            ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->BufferField.BufferObj;
631            break;
632
633        case ACPI_TYPE_PACKAGE:
634            ObjDesc = (void *) ObjDesc->Package.Elements;
635            break;
636
637        case ACPI_TYPE_METHOD:
638            ObjDesc = (void *) ObjDesc->Method.AmlStart;
639            break;
640
641        case ACPI_TYPE_LOCAL_REGION_FIELD:
642            ObjDesc = (void *) ObjDesc->Field.RegionObj;
643            break;
644
645        case ACPI_TYPE_LOCAL_BANK_FIELD:
646            ObjDesc = (void *) ObjDesc->BankField.RegionObj;
647            break;
648
649        case ACPI_TYPE_LOCAL_INDEX_FIELD:
650            ObjDesc = (void *) ObjDesc->IndexField.IndexObj;
651            break;
652
653        default:
654            goto Cleanup;
655        }
656
657        ObjType = ACPI_TYPE_INVALID;   /* Terminate loop after next pass */
658    }
659
660Cleanup:
661    AcpiOsPrintf ("\n");
662    return (AE_OK);
663}
664
665
666/*******************************************************************************
667 *
668 * FUNCTION:    AcpiNsDumpObjects
669 *
670 * PARAMETERS:  Type                - Object type to be dumped
671 *              MaxDepth            - Maximum depth of dump.  Use ACPI_UINT32_MAX
672 *                                    for an effectively unlimited depth.
673 *              OwnerId             - Dump only objects owned by this ID.  Use
674 *                                    ACPI_UINT32_MAX to match all owners.
675 *              StartHandle         - Where in namespace to start/end search
676 *
677 * DESCRIPTION: Dump typed objects within the loaded namespace.
678 *              Uses AcpiNsWalkNamespace in conjunction with AcpiNsDumpOneObject.
679 *
680 ******************************************************************************/
681
682void
683AcpiNsDumpObjects (
684    ACPI_OBJECT_TYPE        Type,
685    UINT8                   DisplayType,
686    UINT32                  MaxDepth,
687    UINT32                  OwnerId,
688    ACPI_HANDLE             StartHandle)
689{
690    ACPI_WALK_INFO          Info;
691
692
693    ACPI_FUNCTION_ENTRY ();
694
695
696    Info.DebugLevel = ACPI_LV_TABLES;
697    Info.OwnerId = OwnerId;
698    Info.DisplayType = DisplayType;
699
700
701    (void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
702                ACPI_NS_WALK_NO_UNLOCK, AcpiNsDumpOneObject,
703                (void *) &Info, NULL);
704}
705
706
707/*******************************************************************************
708 *
709 * FUNCTION:    AcpiNsDumpTables
710 *
711 * PARAMETERS:  SearchBase          - Root of subtree to be dumped, or
712 *                                    NS_ALL to dump the entire namespace
713 *              MaxDepth            - Maximum depth of dump.  Use INT_MAX
714 *                                    for an effectively unlimited depth.
715 *
716 * DESCRIPTION: Dump the name space, or a portion of it.
717 *
718 ******************************************************************************/
719
720void
721AcpiNsDumpTables (
722    ACPI_HANDLE             SearchBase,
723    UINT32                  MaxDepth)
724{
725    ACPI_HANDLE             SearchHandle = SearchBase;
726
727
728    ACPI_FUNCTION_TRACE ("NsDumpTables");
729
730
731    if (!AcpiGbl_RootNode)
732    {
733        /*
734         * If the name space has not been initialized,
735         * there is nothing to dump.
736         */
737        ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "namespace not initialized!\n"));
738        return_VOID;
739    }
740
741    if (ACPI_NS_ALL == SearchBase)
742    {
743        /*  entire namespace    */
744
745        SearchHandle = AcpiGbl_RootNode;
746        ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "\\\n"));
747    }
748
749
750    AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, MaxDepth,
751            ACPI_UINT32_MAX, SearchHandle);
752    return_VOID;
753}
754
755
756/*******************************************************************************
757 *
758 * FUNCTION:    AcpiNsDumpEntry
759 *
760 * PARAMETERS:  Handle              - Node to be dumped
761 *              DebugLevel          - Output level
762 *
763 * DESCRIPTION: Dump a single Node
764 *
765 ******************************************************************************/
766
767void
768AcpiNsDumpEntry (
769    ACPI_HANDLE             Handle,
770    UINT32                  DebugLevel)
771{
772    ACPI_WALK_INFO          Info;
773
774
775    ACPI_FUNCTION_ENTRY ();
776
777
778    Info.DebugLevel = DebugLevel;
779    Info.OwnerId = ACPI_UINT32_MAX;
780    Info.DisplayType = ACPI_DISPLAY_SUMMARY;
781
782    (void) AcpiNsDumpOneObject (Handle, 1, &Info, NULL);
783}
784
785#endif
786
787