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