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