nsdump.c revision 138287
1/******************************************************************************
2 *
3 * Module Name: nsdump - table dumping routines for debug
4 *              $Revision: 160 $
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999 - 2004, 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
129#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
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
189void
190AcpiNsDumpPathname (
191    ACPI_HANDLE             Handle,
192    char                    *Msg,
193    UINT32                  Level,
194    UINT32                  Component)
195{
196
197    ACPI_FUNCTION_TRACE ("NsDumpPathname");
198
199
200    /* Do this only if the requested debug level and component are enabled */
201
202    if (!(AcpiDbgLevel & Level) || !(AcpiDbgLayer & Component))
203    {
204        return_VOID;
205    }
206
207    /* Convert handle to a full pathname and print it (with supplied message) */
208
209    AcpiNsPrintNodePathname (Handle, Msg);
210    AcpiOsPrintf ("\n");
211    return_VOID;
212}
213
214
215/*******************************************************************************
216 *
217 * FUNCTION:    AcpiNsDumpOneObject
218 *
219 * PARAMETERS:  Handle              - Node to be dumped
220 *              Level               - Nesting level of the handle
221 *              Context             - Passed into WalkNamespace
222 *
223 * DESCRIPTION: Dump a single Node
224 *              This procedure is a UserFunction called by AcpiNsWalkNamespace.
225 *
226 ******************************************************************************/
227
228ACPI_STATUS
229AcpiNsDumpOneObject (
230    ACPI_HANDLE             ObjHandle,
231    UINT32                  Level,
232    void                    *Context,
233    void                    **ReturnValue)
234{
235    ACPI_WALK_INFO          *Info = (ACPI_WALK_INFO *) Context;
236    ACPI_NAMESPACE_NODE     *ThisNode;
237    ACPI_OPERAND_OBJECT     *ObjDesc = NULL;
238    ACPI_OBJECT_TYPE        ObjType;
239    ACPI_OBJECT_TYPE        Type;
240    UINT32                  BytesToDump;
241    UINT32                  DbgLevel;
242    UINT32                  i;
243
244
245    ACPI_FUNCTION_NAME ("NsDumpOneObject");
246
247
248    /* Is output enabled? */
249
250    if (!(AcpiDbgLevel & Info->DebugLevel))
251    {
252        return (AE_OK);
253    }
254
255    if (!ObjHandle)
256    {
257        ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null object handle\n"));
258        return (AE_OK);
259    }
260
261    ThisNode = AcpiNsMapHandleToNode (ObjHandle);
262    Type = ThisNode->Type;
263
264    /* Check if the owner matches */
265
266    if ((Info->OwnerId != ACPI_UINT32_MAX) &&
267        (Info->OwnerId != ThisNode->OwnerId))
268    {
269        return (AE_OK);
270    }
271
272    /* Indent the object according to the level */
273
274    AcpiOsPrintf ("%2d%*s", (UINT32) Level - 1, (int) Level * 2, " ");
275
276    /* Check the node type and name */
277
278    if (Type > ACPI_TYPE_LOCAL_MAX)
279    {
280        ACPI_REPORT_WARNING (("Invalid ACPI Type %08X\n", Type));
281    }
282
283    if (!AcpiUtValidAcpiName (ThisNode->Name.Integer))
284    {
285        ACPI_REPORT_WARNING (("Invalid ACPI Name %08X\n",
286            ThisNode->Name.Integer));
287    }
288
289    /*
290     * Now we can print out the pertinent information
291     */
292    AcpiOsPrintf ("%4.4s %-12s %p ",
293            AcpiUtGetNodeName (ThisNode), AcpiUtGetTypeName (Type), ThisNode);
294
295    DbgLevel = AcpiDbgLevel;
296    AcpiDbgLevel = 0;
297    ObjDesc = AcpiNsGetAttachedObject (ThisNode);
298    AcpiDbgLevel = DbgLevel;
299
300    switch (Info->DisplayType)
301    {
302    case ACPI_DISPLAY_SUMMARY:
303
304        if (!ObjDesc)
305        {
306            /* No attached object, we are done */
307
308            AcpiOsPrintf ("\n");
309            return (AE_OK);
310        }
311
312        switch (Type)
313        {
314        case ACPI_TYPE_PROCESSOR:
315
316            AcpiOsPrintf ("ID %X Len %.4X Addr %p\n",
317                ObjDesc->Processor.ProcId, ObjDesc->Processor.Length,
318                (char *) ObjDesc->Processor.Address);
319            break;
320
321
322        case ACPI_TYPE_DEVICE:
323
324            AcpiOsPrintf ("Notify Object: %p\n", ObjDesc);
325            break;
326
327
328        case ACPI_TYPE_METHOD:
329
330            AcpiOsPrintf ("Args %X Len %.4X Aml %p\n",
331                (UINT32) ObjDesc->Method.ParamCount,
332                ObjDesc->Method.AmlLength, ObjDesc->Method.AmlStart);
333            break;
334
335
336        case ACPI_TYPE_INTEGER:
337
338            AcpiOsPrintf ("= %8.8X%8.8X\n",
339                ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
340            break;
341
342
343        case ACPI_TYPE_PACKAGE:
344
345            if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
346            {
347                AcpiOsPrintf ("Elements %.2X\n",
348                    ObjDesc->Package.Count);
349            }
350            else
351            {
352                AcpiOsPrintf ("[Length not yet evaluated]\n");
353            }
354            break;
355
356
357        case ACPI_TYPE_BUFFER:
358
359            if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
360            {
361                AcpiOsPrintf ("Len %.2X",
362                            ObjDesc->Buffer.Length);
363
364                /* Dump some of the buffer */
365
366                if (ObjDesc->Buffer.Length > 0)
367                {
368                    AcpiOsPrintf (" =");
369                    for (i = 0; (i < ObjDesc->Buffer.Length && i < 12); i++)
370                    {
371                        AcpiOsPrintf (" %.2hX", ObjDesc->Buffer.Pointer[i]);
372                    }
373                }
374                AcpiOsPrintf ("\n");
375            }
376            else
377            {
378                AcpiOsPrintf ("[Length not yet evaluated]\n");
379            }
380            break;
381
382
383        case ACPI_TYPE_STRING:
384
385            AcpiOsPrintf ("Len %.2X ", ObjDesc->String.Length);
386            AcpiUtPrintString (ObjDesc->String.Pointer, 32);
387            AcpiOsPrintf ("\n");
388            break;
389
390
391        case ACPI_TYPE_REGION:
392
393            AcpiOsPrintf ("[%s]",
394                AcpiUtGetRegionName (ObjDesc->Region.SpaceId));
395            if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
396            {
397                AcpiOsPrintf (" Addr %8.8X%8.8X Len %.4X\n",
398                    ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
399                    ObjDesc->Region.Length);
400            }
401            else
402            {
403                AcpiOsPrintf (" [Address/Length not yet evaluated]\n");
404            }
405            break;
406
407
408        case ACPI_TYPE_LOCAL_REFERENCE:
409
410            AcpiOsPrintf ("[%s]\n",
411                AcpiPsGetOpcodeName (ObjDesc->Reference.Opcode));
412            break;
413
414
415        case ACPI_TYPE_BUFFER_FIELD:
416
417            if (ObjDesc->BufferField.BufferObj &&
418                ObjDesc->BufferField.BufferObj->Buffer.Node)
419            {
420                AcpiOsPrintf ("Buf [%4.4s]",
421                    AcpiUtGetNodeName (ObjDesc->BufferField.BufferObj->Buffer.Node));
422            }
423            break;
424
425
426        case ACPI_TYPE_LOCAL_REGION_FIELD:
427
428            AcpiOsPrintf ("Rgn [%4.4s]",
429                AcpiUtGetNodeName (ObjDesc->CommonField.RegionObj->Region.Node));
430            break;
431
432
433        case ACPI_TYPE_LOCAL_BANK_FIELD:
434
435            AcpiOsPrintf ("Rgn [%4.4s] Bnk [%4.4s]",
436                AcpiUtGetNodeName (ObjDesc->CommonField.RegionObj->Region.Node),
437                AcpiUtGetNodeName (ObjDesc->BankField.BankObj->CommonField.Node));
438            break;
439
440
441        case ACPI_TYPE_LOCAL_INDEX_FIELD:
442
443            AcpiOsPrintf ("Idx [%4.4s] Dat [%4.4s]",
444                AcpiUtGetNodeName (ObjDesc->IndexField.IndexObj->CommonField.Node),
445                AcpiUtGetNodeName (ObjDesc->IndexField.DataObj->CommonField.Node));
446            break;
447
448
449        case ACPI_TYPE_LOCAL_ALIAS:
450        case ACPI_TYPE_LOCAL_METHOD_ALIAS:
451
452            AcpiOsPrintf ("Target %4.4s (%p)\n",
453                AcpiUtGetNodeName (ObjDesc), ObjDesc);
454            break;
455
456        default:
457
458            AcpiOsPrintf ("Object %p\n", ObjDesc);
459            break;
460        }
461
462        /* Common field handling */
463
464        switch (Type)
465        {
466        case ACPI_TYPE_BUFFER_FIELD:
467        case ACPI_TYPE_LOCAL_REGION_FIELD:
468        case ACPI_TYPE_LOCAL_BANK_FIELD:
469        case ACPI_TYPE_LOCAL_INDEX_FIELD:
470
471            AcpiOsPrintf (" Off %.3X Len %.2X Acc %.2hd\n",
472                (ObjDesc->CommonField.BaseByteOffset * 8)
473                    + ObjDesc->CommonField.StartFieldBitOffset,
474                ObjDesc->CommonField.BitLength,
475                ObjDesc->CommonField.AccessByteWidth);
476            break;
477
478        default:
479            break;
480        }
481        break;
482
483
484    case ACPI_DISPLAY_OBJECTS:
485
486        AcpiOsPrintf ("O:%p", ObjDesc);
487        if (!ObjDesc)
488        {
489            /* No attached object, we are done */
490
491            AcpiOsPrintf ("\n");
492            return (AE_OK);
493        }
494
495        AcpiOsPrintf ("(R%d)",
496                ObjDesc->Common.ReferenceCount);
497
498        switch (Type)
499        {
500        case ACPI_TYPE_METHOD:
501
502            /* Name is a Method and its AML offset/length are set */
503
504            AcpiOsPrintf (" M:%p-%X\n", ObjDesc->Method.AmlStart,
505                                        ObjDesc->Method.AmlLength);
506            break;
507
508        case ACPI_TYPE_INTEGER:
509
510            AcpiOsPrintf (" I:%8.8X8.8%X\n",
511                    ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
512            break;
513
514        case ACPI_TYPE_STRING:
515
516            AcpiOsPrintf (" S:%p-%X\n", ObjDesc->String.Pointer,
517                                        ObjDesc->String.Length);
518            break;
519
520        case ACPI_TYPE_BUFFER:
521
522            AcpiOsPrintf (" B:%p-%X\n", ObjDesc->Buffer.Pointer,
523                                        ObjDesc->Buffer.Length);
524            break;
525
526        default:
527
528            AcpiOsPrintf ("\n");
529            break;
530        }
531        break;
532
533
534    default:
535        AcpiOsPrintf ("\n");
536        break;
537    }
538
539    /* If debug turned off, done */
540
541    if (!(AcpiDbgLevel & ACPI_LV_VALUES))
542    {
543        return (AE_OK);
544    }
545
546
547    /* If there is an attached object, display it */
548
549    DbgLevel     = AcpiDbgLevel;
550    AcpiDbgLevel = 0;
551    ObjDesc      = AcpiNsGetAttachedObject (ThisNode);
552    AcpiDbgLevel = DbgLevel;
553
554    /* Dump attached objects */
555
556    while (ObjDesc)
557    {
558        ObjType = ACPI_TYPE_INVALID;
559        AcpiOsPrintf ("        Attached Object %p: ", ObjDesc);
560
561        /* Decode the type of attached object and dump the contents */
562
563        switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
564        {
565        case ACPI_DESC_TYPE_NAMED:
566
567            AcpiOsPrintf ("(Ptr to Node)\n");
568            BytesToDump = sizeof (ACPI_NAMESPACE_NODE);
569            break;
570
571
572        case ACPI_DESC_TYPE_OPERAND:
573
574            ObjType = ACPI_GET_OBJECT_TYPE (ObjDesc);
575
576            if (ObjType > ACPI_TYPE_LOCAL_MAX)
577            {
578                AcpiOsPrintf ("(Ptr to ACPI Object type %X [UNKNOWN])\n",
579                    ObjType);
580                BytesToDump = 32;
581            }
582            else
583            {
584                AcpiOsPrintf ("(Ptr to ACPI Object type %s, %X)\n",
585                    AcpiUtGetTypeName (ObjType), ObjType);
586                BytesToDump = sizeof (ACPI_OPERAND_OBJECT);
587            }
588            break;
589
590
591        default:
592
593            AcpiOsPrintf (
594                "(String or Buffer ptr - not an object descriptor) [%s]\n",
595                AcpiUtGetDescriptorName (ObjDesc));
596            BytesToDump = 16;
597            break;
598        }
599
600        ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
601
602        /* If value is NOT an internal object, we are done */
603
604        if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
605        {
606            goto Cleanup;
607        }
608
609        /*
610         * Valid object, get the pointer to next level, if any
611         */
612        switch (ObjType)
613        {
614        case ACPI_TYPE_STRING:
615            ObjDesc = (void *) ObjDesc->String.Pointer;
616            break;
617
618        case ACPI_TYPE_BUFFER:
619            ObjDesc = (void *) ObjDesc->Buffer.Pointer;
620            break;
621
622        case ACPI_TYPE_BUFFER_FIELD:
623            ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->BufferField.BufferObj;
624            break;
625
626        case ACPI_TYPE_PACKAGE:
627            ObjDesc = (void *) ObjDesc->Package.Elements;
628            break;
629
630        case ACPI_TYPE_METHOD:
631            ObjDesc = (void *) ObjDesc->Method.AmlStart;
632            break;
633
634        case ACPI_TYPE_LOCAL_REGION_FIELD:
635            ObjDesc = (void *) ObjDesc->Field.RegionObj;
636            break;
637
638        case ACPI_TYPE_LOCAL_BANK_FIELD:
639            ObjDesc = (void *) ObjDesc->BankField.RegionObj;
640            break;
641
642        case ACPI_TYPE_LOCAL_INDEX_FIELD:
643            ObjDesc = (void *) ObjDesc->IndexField.IndexObj;
644            break;
645
646        default:
647            goto Cleanup;
648        }
649
650        ObjType = ACPI_TYPE_INVALID;   /* Terminate loop after next pass */
651    }
652
653Cleanup:
654    AcpiOsPrintf ("\n");
655    return (AE_OK);
656}
657
658
659/*******************************************************************************
660 *
661 * FUNCTION:    AcpiNsDumpObjects
662 *
663 * PARAMETERS:  Type                - Object type to be dumped
664 *              MaxDepth            - Maximum depth of dump. Use ACPI_UINT32_MAX
665 *                                    for an effectively unlimited depth.
666 *              OwnerId             - Dump only objects owned by this ID.  Use
667 *                                    ACPI_UINT32_MAX to match all owners.
668 *              StartHandle         - Where in namespace to start/end search
669 *
670 * DESCRIPTION: Dump typed objects within the loaded namespace.
671 *              Uses AcpiNsWalkNamespace in conjunction with AcpiNsDumpOneObject.
672 *
673 ******************************************************************************/
674
675void
676AcpiNsDumpObjects (
677    ACPI_OBJECT_TYPE        Type,
678    UINT8                   DisplayType,
679    UINT32                  MaxDepth,
680    UINT32                  OwnerId,
681    ACPI_HANDLE             StartHandle)
682{
683    ACPI_WALK_INFO          Info;
684
685
686    ACPI_FUNCTION_ENTRY ();
687
688
689    Info.DebugLevel = ACPI_LV_TABLES;
690    Info.OwnerId = OwnerId;
691    Info.DisplayType = DisplayType;
692
693    (void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
694                ACPI_NS_WALK_NO_UNLOCK, AcpiNsDumpOneObject,
695                (void *) &Info, NULL);
696}
697
698
699/*******************************************************************************
700 *
701 * FUNCTION:    AcpiNsDumpTables
702 *
703 * PARAMETERS:  SearchBase          - Root of subtree to be dumped, or
704 *                                    NS_ALL to dump the entire namespace
705 *              MaxDepth            - Maximum depth of dump.  Use INT_MAX
706 *                                    for an effectively unlimited depth.
707 *
708 * DESCRIPTION: Dump the name space, or a portion of it.
709 *
710 ******************************************************************************/
711
712void
713AcpiNsDumpTables (
714    ACPI_HANDLE             SearchBase,
715    UINT32                  MaxDepth)
716{
717    ACPI_HANDLE             SearchHandle = SearchBase;
718
719
720    ACPI_FUNCTION_TRACE ("NsDumpTables");
721
722
723    if (!AcpiGbl_RootNode)
724    {
725        /*
726         * If the name space has not been initialized,
727         * there is nothing to dump.
728         */
729        ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "namespace not initialized!\n"));
730        return_VOID;
731    }
732
733    if (ACPI_NS_ALL == SearchBase)
734    {
735        /*  entire namespace    */
736
737        SearchHandle = AcpiGbl_RootNode;
738        ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "\\\n"));
739    }
740
741    AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, MaxDepth,
742            ACPI_UINT32_MAX, SearchHandle);
743    return_VOID;
744}
745
746
747/*******************************************************************************
748 *
749 * FUNCTION:    AcpiNsDumpEntry
750 *
751 * PARAMETERS:  Handle              - Node to be dumped
752 *              DebugLevel          - Output level
753 *
754 * DESCRIPTION: Dump a single Node
755 *
756 ******************************************************************************/
757
758void
759AcpiNsDumpEntry (
760    ACPI_HANDLE             Handle,
761    UINT32                  DebugLevel)
762{
763    ACPI_WALK_INFO          Info;
764
765
766    ACPI_FUNCTION_ENTRY ();
767
768
769    Info.DebugLevel = DebugLevel;
770    Info.OwnerId = ACPI_UINT32_MAX;
771    Info.DisplayType = ACPI_DISPLAY_SUMMARY;
772
773    (void) AcpiNsDumpOneObject (Handle, 1, &Info, NULL);
774}
775
776#endif
777
778