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