nsdump.c revision 233250
116Salm/******************************************************************************
216Salm *
316Salm * Module Name: nsdump - table dumping routines for debug
416Salm *
516Salm *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 *    notice, this list of conditions, and the following disclaimer,
16 *    without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 *    substantially similar to the "NO WARRANTY" disclaimer below
19 *    ("Disclaimer") and any redistribution must be conditioned upon
20 *    including a substantially similar Disclaimer requirement for further
21 *    binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 *    of any contributors may be used to endorse or promote products derived
24 *    from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44#define __NSDUMP_C__
45
46#include <contrib/dev/acpica/include/acpi.h>
47#include <contrib/dev/acpica/include/accommon.h>
48#include <contrib/dev/acpica/include/acnamesp.h>
49
50
51#define _COMPONENT          ACPI_NAMESPACE
52        ACPI_MODULE_NAME    ("nsdump")
53
54/* Local prototypes */
55
56#ifdef ACPI_OBSOLETE_FUNCTIONS
57void
58AcpiNsDumpRootDevices (
59    void);
60
61static ACPI_STATUS
62AcpiNsDumpOneDevice (
63    ACPI_HANDLE             ObjHandle,
64    UINT32                  Level,
65    void                    *Context,
66    void                    **ReturnValue);
67#endif
68
69
70#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
71/*******************************************************************************
72 *
73 * FUNCTION:    AcpiNsPrintPathname
74 *
75 * PARAMETERS:  NumSegments         - Number of ACPI name segments
76 *              Pathname            - The compressed (internal) path
77 *
78 * RETURN:      None
79 *
80 * DESCRIPTION: Print an object's full namespace pathname
81 *
82 ******************************************************************************/
83
84void
85AcpiNsPrintPathname (
86    UINT32                  NumSegments,
87    char                    *Pathname)
88{
89    UINT32                  i;
90
91
92    ACPI_FUNCTION_NAME (NsPrintPathname);
93
94
95    if (!(AcpiDbgLevel & ACPI_LV_NAMES) || !(AcpiDbgLayer & ACPI_NAMESPACE))
96    {
97        return;
98    }
99
100    /* Print the entire name */
101
102    ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "["));
103
104    while (NumSegments)
105    {
106        for (i = 0; i < 4; i++)
107        {
108            ACPI_IS_PRINT (Pathname[i]) ?
109                AcpiOsPrintf ("%c", Pathname[i]) :
110                AcpiOsPrintf ("?");
111        }
112
113        Pathname += ACPI_NAME_SIZE;
114        NumSegments--;
115        if (NumSegments)
116        {
117            AcpiOsPrintf (".");
118        }
119    }
120
121    AcpiOsPrintf ("]\n");
122}
123
124
125/*******************************************************************************
126 *
127 * FUNCTION:    AcpiNsDumpPathname
128 *
129 * PARAMETERS:  Handle              - Object
130 *              Msg                 - Prefix message
131 *              Level               - Desired debug level
132 *              Component           - Caller's component ID
133 *
134 * RETURN:      None
135 *
136 * DESCRIPTION: Print an object's full namespace pathname
137 *              Manages allocation/freeing of a pathname buffer
138 *
139 ******************************************************************************/
140
141void
142AcpiNsDumpPathname (
143    ACPI_HANDLE             Handle,
144    char                    *Msg,
145    UINT32                  Level,
146    UINT32                  Component)
147{
148
149    ACPI_FUNCTION_TRACE (NsDumpPathname);
150
151
152    /* Do this only if the requested debug level and component are enabled */
153
154    if (!(AcpiDbgLevel & Level) || !(AcpiDbgLayer & Component))
155    {
156        return_VOID;
157    }
158
159    /* Convert handle to a full pathname and print it (with supplied message) */
160
161    AcpiNsPrintNodePathname (Handle, Msg);
162    AcpiOsPrintf ("\n");
163    return_VOID;
164}
165
166
167/*******************************************************************************
168 *
169 * FUNCTION:    AcpiNsDumpOneObject
170 *
171 * PARAMETERS:  ObjHandle           - Node to be dumped
172 *              Level               - Nesting level of the handle
173 *              Context             - Passed into WalkNamespace
174 *              ReturnValue         - Not used
175 *
176 * RETURN:      Status
177 *
178 * DESCRIPTION: Dump a single Node
179 *              This procedure is a UserFunction called by AcpiNsWalkNamespace.
180 *
181 ******************************************************************************/
182
183ACPI_STATUS
184AcpiNsDumpOneObject (
185    ACPI_HANDLE             ObjHandle,
186    UINT32                  Level,
187    void                    *Context,
188    void                    **ReturnValue)
189{
190    ACPI_WALK_INFO          *Info = (ACPI_WALK_INFO *) Context;
191    ACPI_NAMESPACE_NODE     *ThisNode;
192    ACPI_OPERAND_OBJECT     *ObjDesc = NULL;
193    ACPI_OBJECT_TYPE        ObjType;
194    ACPI_OBJECT_TYPE        Type;
195    UINT32                  BytesToDump;
196    UINT32                  DbgLevel;
197    UINT32                  i;
198
199
200    ACPI_FUNCTION_NAME (NsDumpOneObject);
201
202
203    /* Is output enabled? */
204
205    if (!(AcpiDbgLevel & Info->DebugLevel))
206    {
207        return (AE_OK);
208    }
209
210    if (!ObjHandle)
211    {
212        ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null object handle\n"));
213        return (AE_OK);
214    }
215
216    ThisNode = AcpiNsValidateHandle (ObjHandle);
217    if (!ThisNode)
218    {
219        ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p\n",
220            ObjHandle));
221        return (AE_OK);
222    }
223
224    Type = ThisNode->Type;
225
226    /* Check if the owner matches */
227
228    if ((Info->OwnerId != ACPI_OWNER_ID_MAX) &&
229        (Info->OwnerId != ThisNode->OwnerId))
230    {
231        return (AE_OK);
232    }
233
234    if (!(Info->DisplayType & ACPI_DISPLAY_SHORT))
235    {
236        /* Indent the object according to the level */
237
238        AcpiOsPrintf ("%2d%*s", (UINT32) Level - 1, (int) Level * 2, " ");
239
240        /* Check the node type and name */
241
242        if (Type > ACPI_TYPE_LOCAL_MAX)
243        {
244            ACPI_WARNING ((AE_INFO, "Invalid ACPI Object Type 0x%08X", Type));
245        }
246
247        AcpiOsPrintf ("%4.4s", AcpiUtGetNodeName (ThisNode));
248    }
249
250    /* Now we can print out the pertinent information */
251
252    AcpiOsPrintf (" %-12s %p %2.2X ",
253            AcpiUtGetTypeName (Type), ThisNode, ThisNode->OwnerId);
254
255    DbgLevel = AcpiDbgLevel;
256    AcpiDbgLevel = 0;
257    ObjDesc = AcpiNsGetAttachedObject (ThisNode);
258    AcpiDbgLevel = DbgLevel;
259
260    /* Temp nodes are those nodes created by a control method */
261
262    if (ThisNode->Flags & ANOBJ_TEMPORARY)
263    {
264        AcpiOsPrintf ("(T) ");
265    }
266
267    switch (Info->DisplayType & ACPI_DISPLAY_MASK)
268    {
269    case ACPI_DISPLAY_SUMMARY:
270
271        if (!ObjDesc)
272        {
273            /* No attached object. Some types should always have an object */
274
275            switch (Type)
276            {
277            case ACPI_TYPE_INTEGER:
278            case ACPI_TYPE_PACKAGE:
279            case ACPI_TYPE_BUFFER:
280            case ACPI_TYPE_STRING:
281            case ACPI_TYPE_METHOD:
282                AcpiOsPrintf ("<No attached object>");
283                break;
284
285            default:
286                break;
287            }
288
289            AcpiOsPrintf ("\n");
290            return (AE_OK);
291        }
292
293        switch (Type)
294        {
295        case ACPI_TYPE_PROCESSOR:
296
297            AcpiOsPrintf ("ID %X Len %.4X Addr %p\n",
298                ObjDesc->Processor.ProcId, ObjDesc->Processor.Length,
299                ACPI_CAST_PTR (void, ObjDesc->Processor.Address));
300            break;
301
302
303        case ACPI_TYPE_DEVICE:
304
305            AcpiOsPrintf ("Notify Object: %p\n", ObjDesc);
306            break;
307
308
309        case ACPI_TYPE_METHOD:
310
311            AcpiOsPrintf ("Args %X Len %.4X Aml %p\n",
312                (UINT32) ObjDesc->Method.ParamCount,
313                ObjDesc->Method.AmlLength, ObjDesc->Method.AmlStart);
314            break;
315
316
317        case ACPI_TYPE_INTEGER:
318
319            AcpiOsPrintf ("= %8.8X%8.8X\n",
320                ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
321            break;
322
323
324        case ACPI_TYPE_PACKAGE:
325
326            if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
327            {
328                AcpiOsPrintf ("Elements %.2X\n",
329                    ObjDesc->Package.Count);
330            }
331            else
332            {
333                AcpiOsPrintf ("[Length not yet evaluated]\n");
334            }
335            break;
336
337
338        case ACPI_TYPE_BUFFER:
339
340            if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
341            {
342                AcpiOsPrintf ("Len %.2X",
343                            ObjDesc->Buffer.Length);
344
345                /* Dump some of the buffer */
346
347                if (ObjDesc->Buffer.Length > 0)
348                {
349                    AcpiOsPrintf (" =");
350                    for (i = 0; (i < ObjDesc->Buffer.Length && i < 12); i++)
351                    {
352                        AcpiOsPrintf (" %.2hX", ObjDesc->Buffer.Pointer[i]);
353                    }
354                }
355                AcpiOsPrintf ("\n");
356            }
357            else
358            {
359                AcpiOsPrintf ("[Length not yet evaluated]\n");
360            }
361            break;
362
363
364        case ACPI_TYPE_STRING:
365
366            AcpiOsPrintf ("Len %.2X ", ObjDesc->String.Length);
367            AcpiUtPrintString (ObjDesc->String.Pointer, 32);
368            AcpiOsPrintf ("\n");
369            break;
370
371
372        case ACPI_TYPE_REGION:
373
374            AcpiOsPrintf ("[%s]",
375                AcpiUtGetRegionName (ObjDesc->Region.SpaceId));
376            if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
377            {
378                AcpiOsPrintf (" Addr %8.8X%8.8X Len %.4X\n",
379                    ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
380                    ObjDesc->Region.Length);
381            }
382            else
383            {
384                AcpiOsPrintf (" [Address/Length not yet evaluated]\n");
385            }
386            break;
387
388
389        case ACPI_TYPE_LOCAL_REFERENCE:
390
391            AcpiOsPrintf ("[%s]\n", AcpiUtGetReferenceName (ObjDesc));
392            break;
393
394
395        case ACPI_TYPE_BUFFER_FIELD:
396
397            if (ObjDesc->BufferField.BufferObj &&
398                ObjDesc->BufferField.BufferObj->Buffer.Node)
399            {
400                AcpiOsPrintf ("Buf [%4.4s]",
401                    AcpiUtGetNodeName (
402                        ObjDesc->BufferField.BufferObj->Buffer.Node));
403            }
404            break;
405
406
407        case ACPI_TYPE_LOCAL_REGION_FIELD:
408
409            AcpiOsPrintf ("Rgn [%4.4s]",
410                AcpiUtGetNodeName (
411                    ObjDesc->CommonField.RegionObj->Region.Node));
412            break;
413
414
415        case ACPI_TYPE_LOCAL_BANK_FIELD:
416
417            AcpiOsPrintf ("Rgn [%4.4s] Bnk [%4.4s]",
418                AcpiUtGetNodeName (
419                    ObjDesc->CommonField.RegionObj->Region.Node),
420                AcpiUtGetNodeName (
421                    ObjDesc->BankField.BankObj->CommonField.Node));
422            break;
423
424
425        case ACPI_TYPE_LOCAL_INDEX_FIELD:
426
427            AcpiOsPrintf ("Idx [%4.4s] Dat [%4.4s]",
428                AcpiUtGetNodeName (
429                    ObjDesc->IndexField.IndexObj->CommonField.Node),
430                AcpiUtGetNodeName (
431                    ObjDesc->IndexField.DataObj->CommonField.Node));
432            break;
433
434
435        case ACPI_TYPE_LOCAL_ALIAS:
436        case ACPI_TYPE_LOCAL_METHOD_ALIAS:
437
438            AcpiOsPrintf ("Target %4.4s (%p)\n",
439                AcpiUtGetNodeName (ObjDesc), ObjDesc);
440            break;
441
442        default:
443
444            AcpiOsPrintf ("Object %p\n", ObjDesc);
445            break;
446        }
447
448        /* Common field handling */
449
450        switch (Type)
451        {
452        case ACPI_TYPE_BUFFER_FIELD:
453        case ACPI_TYPE_LOCAL_REGION_FIELD:
454        case ACPI_TYPE_LOCAL_BANK_FIELD:
455        case ACPI_TYPE_LOCAL_INDEX_FIELD:
456
457            AcpiOsPrintf (" Off %.3X Len %.2X Acc %.2hd\n",
458                (ObjDesc->CommonField.BaseByteOffset * 8)
459                    + ObjDesc->CommonField.StartFieldBitOffset,
460                ObjDesc->CommonField.BitLength,
461                ObjDesc->CommonField.AccessByteWidth);
462            break;
463
464        default:
465            break;
466        }
467        break;
468
469
470    case ACPI_DISPLAY_OBJECTS:
471
472        AcpiOsPrintf ("O:%p", ObjDesc);
473        if (!ObjDesc)
474        {
475            /* No attached object, we are done */
476
477            AcpiOsPrintf ("\n");
478            return (AE_OK);
479        }
480
481        AcpiOsPrintf ("(R%u)", ObjDesc->Common.ReferenceCount);
482
483        switch (Type)
484        {
485        case ACPI_TYPE_METHOD:
486
487            /* Name is a Method and its AML offset/length are set */
488
489            AcpiOsPrintf (" M:%p-%X\n", ObjDesc->Method.AmlStart,
490                ObjDesc->Method.AmlLength);
491            break;
492
493        case ACPI_TYPE_INTEGER:
494
495            AcpiOsPrintf (" I:%8.8X8.8%X\n",
496                ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
497            break;
498
499        case ACPI_TYPE_STRING:
500
501            AcpiOsPrintf (" S:%p-%X\n", ObjDesc->String.Pointer,
502                ObjDesc->String.Length);
503            break;
504
505        case ACPI_TYPE_BUFFER:
506
507            AcpiOsPrintf (" B:%p-%X\n", ObjDesc->Buffer.Pointer,
508                ObjDesc->Buffer.Length);
509            break;
510
511        default:
512
513            AcpiOsPrintf ("\n");
514            break;
515        }
516        break;
517
518
519    default:
520        AcpiOsPrintf ("\n");
521        break;
522    }
523
524    /* If debug turned off, done */
525
526    if (!(AcpiDbgLevel & ACPI_LV_VALUES))
527    {
528        return (AE_OK);
529    }
530
531    /* If there is an attached object, display it */
532
533    DbgLevel     = AcpiDbgLevel;
534    AcpiDbgLevel = 0;
535    ObjDesc      = AcpiNsGetAttachedObject (ThisNode);
536    AcpiDbgLevel = DbgLevel;
537
538    /* Dump attached objects */
539
540    while (ObjDesc)
541    {
542        ObjType = ACPI_TYPE_INVALID;
543        AcpiOsPrintf ("Attached Object %p: ", ObjDesc);
544
545        /* Decode the type of attached object and dump the contents */
546
547        switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
548        {
549        case ACPI_DESC_TYPE_NAMED:
550
551            AcpiOsPrintf ("(Ptr to Node)\n");
552            BytesToDump = sizeof (ACPI_NAMESPACE_NODE);
553            ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
554            break;
555
556        case ACPI_DESC_TYPE_OPERAND:
557
558            ObjType = ObjDesc->Common.Type;
559
560            if (ObjType > ACPI_TYPE_LOCAL_MAX)
561            {
562                AcpiOsPrintf ("(Pointer to ACPI Object type %.2X [UNKNOWN])\n",
563                    ObjType);
564                BytesToDump = 32;
565            }
566            else
567            {
568                AcpiOsPrintf ("(Pointer to ACPI Object type %.2X [%s])\n",
569                    ObjType, AcpiUtGetTypeName (ObjType));
570                BytesToDump = sizeof (ACPI_OPERAND_OBJECT);
571            }
572
573            ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
574            break;
575
576        default:
577
578            break;
579        }
580
581        /* If value is NOT an internal object, we are done */
582
583        if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
584        {
585            goto Cleanup;
586        }
587
588        /* Valid object, get the pointer to next level, if any */
589
590        switch (ObjType)
591        {
592        case ACPI_TYPE_BUFFER:
593        case ACPI_TYPE_STRING:
594            /*
595             * NOTE: takes advantage of common fields between string/buffer
596             */
597            BytesToDump = ObjDesc->String.Length;
598            ObjDesc = (void *) ObjDesc->String.Pointer;
599            AcpiOsPrintf ( "(Buffer/String pointer %p length %X)\n",
600                ObjDesc, BytesToDump);
601            ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
602            goto Cleanup;
603
604        case ACPI_TYPE_BUFFER_FIELD:
605            ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->BufferField.BufferObj;
606            break;
607
608        case ACPI_TYPE_PACKAGE:
609            ObjDesc = (void *) ObjDesc->Package.Elements;
610            break;
611
612        case ACPI_TYPE_METHOD:
613            ObjDesc = (void *) ObjDesc->Method.AmlStart;
614            break;
615
616        case ACPI_TYPE_LOCAL_REGION_FIELD:
617            ObjDesc = (void *) ObjDesc->Field.RegionObj;
618            break;
619
620        case ACPI_TYPE_LOCAL_BANK_FIELD:
621            ObjDesc = (void *) ObjDesc->BankField.RegionObj;
622            break;
623
624        case ACPI_TYPE_LOCAL_INDEX_FIELD:
625            ObjDesc = (void *) ObjDesc->IndexField.IndexObj;
626            break;
627
628        default:
629            goto Cleanup;
630        }
631
632        ObjType = ACPI_TYPE_INVALID;   /* Terminate loop after next pass */
633    }
634
635Cleanup:
636    AcpiOsPrintf ("\n");
637    return (AE_OK);
638}
639
640
641/*******************************************************************************
642 *
643 * FUNCTION:    AcpiNsDumpObjects
644 *
645 * PARAMETERS:  Type                - Object type to be dumped
646 *              DisplayType         - 0 or ACPI_DISPLAY_SUMMARY
647 *              MaxDepth            - Maximum depth of dump. Use ACPI_UINT32_MAX
648 *                                    for an effectively unlimited depth.
649 *              OwnerId             - Dump only objects owned by this ID. Use
650 *                                    ACPI_UINT32_MAX to match all owners.
651 *              StartHandle         - Where in namespace to start/end search
652 *
653 * RETURN:      None
654 *
655 * DESCRIPTION: Dump typed objects within the loaded namespace. Uses
656 *              AcpiNsWalkNamespace in conjunction with AcpiNsDumpOneObject.
657 *
658 ******************************************************************************/
659
660void
661AcpiNsDumpObjects (
662    ACPI_OBJECT_TYPE        Type,
663    UINT8                   DisplayType,
664    UINT32                  MaxDepth,
665    ACPI_OWNER_ID           OwnerId,
666    ACPI_HANDLE             StartHandle)
667{
668    ACPI_WALK_INFO          Info;
669    ACPI_STATUS             Status;
670
671
672    ACPI_FUNCTION_ENTRY ();
673
674
675    /*
676     * Just lock the entire namespace for the duration of the dump.
677     * We don't want any changes to the namespace during this time,
678     * especially the temporary nodes since we are going to display
679     * them also.
680     */
681    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
682    if (ACPI_FAILURE (Status))
683    {
684        AcpiOsPrintf ("Could not acquire namespace mutex\n");
685        return;
686    }
687
688    Info.DebugLevel = ACPI_LV_TABLES;
689    Info.OwnerId = OwnerId;
690    Info.DisplayType = DisplayType;
691
692    (void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
693                ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
694                AcpiNsDumpOneObject, NULL, (void *) &Info, NULL);
695
696    (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
697}
698
699
700/*******************************************************************************
701 *
702 * FUNCTION:    AcpiNsDumpEntry
703 *
704 * PARAMETERS:  Handle              - Node to be dumped
705 *              DebugLevel          - Output level
706 *
707 * RETURN:      None
708 *
709 * DESCRIPTION: Dump a single Node
710 *
711 ******************************************************************************/
712
713void
714AcpiNsDumpEntry (
715    ACPI_HANDLE             Handle,
716    UINT32                  DebugLevel)
717{
718    ACPI_WALK_INFO          Info;
719
720
721    ACPI_FUNCTION_ENTRY ();
722
723
724    Info.DebugLevel = DebugLevel;
725    Info.OwnerId = ACPI_OWNER_ID_MAX;
726    Info.DisplayType = ACPI_DISPLAY_SUMMARY;
727
728    (void) AcpiNsDumpOneObject (Handle, 1, &Info, NULL);
729}
730
731
732#ifdef ACPI_ASL_COMPILER
733/*******************************************************************************
734 *
735 * FUNCTION:    AcpiNsDumpTables
736 *
737 * PARAMETERS:  SearchBase          - Root of subtree to be dumped, or
738 *                                    NS_ALL to dump the entire namespace
739 *              MaxDepth            - Maximum depth of dump.  Use INT_MAX
740 *                                    for an effectively unlimited depth.
741 *
742 * RETURN:      None
743 *
744 * DESCRIPTION: Dump the name space, or a portion of it.
745 *
746 ******************************************************************************/
747
748void
749AcpiNsDumpTables (
750    ACPI_HANDLE             SearchBase,
751    UINT32                  MaxDepth)
752{
753    ACPI_HANDLE             SearchHandle = SearchBase;
754
755
756    ACPI_FUNCTION_TRACE (NsDumpTables);
757
758
759    if (!AcpiGbl_RootNode)
760    {
761        /*
762         * If the name space has not been initialized,
763         * there is nothing to dump.
764         */
765        ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "namespace not initialized!\n"));
766        return_VOID;
767    }
768
769    if (ACPI_NS_ALL == SearchBase)
770    {
771        /* Entire namespace */
772
773        SearchHandle = AcpiGbl_RootNode;
774        ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "\\\n"));
775    }
776
777    AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, MaxDepth,
778            ACPI_OWNER_ID_MAX, SearchHandle);
779    return_VOID;
780}
781#endif
782#endif
783
784