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