Update to ACPICA 20121018.
[haiku.git] / src / add-ons / kernel / bus_managers / acpi / acpica / components / namespace / nsdump.c
blobc59b159549cd3b3ce524283f2dedbc3ba50b3c2d
1 /******************************************************************************
3 * Module Name: nsdump - table dumping routines for debug
5 *****************************************************************************/
7 /******************************************************************************
9 * 1. Copyright Notice
11 * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
12 * All rights reserved.
14 * 2. License
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
19 * property rights.
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
26 * make derivatives, distribute, use and display any portion of the Covered
27 * Code in any form, with the right to sublicense such rights; and
29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30 * license (with the right to sublicense), under only those claims of Intel
31 * patents that are infringed by the Original Intel Code, to make, use, sell,
32 * offer to sell, and import the Covered Code and derivative works thereof
33 * solely to the minimum extent necessary to exercise the above copyright
34 * license, and in no event shall the patent license extend to any additions
35 * to or modifications of the Original Intel Code. No other license or right
36 * is granted directly or by implication, estoppel or otherwise;
38 * The above copyright and patent license is granted only if the following
39 * conditions are met:
41 * 3. Conditions
43 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44 * Redistribution of source code of any substantial portion of the Covered
45 * Code or modification with rights to further distribute source must include
46 * the above Copyright Notice, the above License, this list of Conditions,
47 * and the following Disclaimer and Export Compliance provision. In addition,
48 * Licensee must cause all Covered Code to which Licensee contributes to
49 * contain a file documenting the changes Licensee made to create that Covered
50 * Code and the date of any change. Licensee must include in that file the
51 * documentation of any changes made by any predecessor Licensee. Licensee
52 * must include a prominent statement that the modification is derived,
53 * directly or indirectly, from Original Intel Code.
55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56 * Redistribution of source code of any substantial portion of the Covered
57 * Code or modification without rights to further distribute source must
58 * include the following Disclaimer and Export Compliance provision in the
59 * documentation and/or other materials provided with distribution. In
60 * addition, Licensee may not authorize further sublicense of source of any
61 * portion of the Covered Code, and must include terms to the effect that the
62 * license from Licensee to its licensee is limited to the intellectual
63 * property embodied in the software Licensee provides to its licensee, and
64 * not to intellectual property embodied in modifications its licensee may
65 * make.
67 * 3.3. Redistribution of Executable. Redistribution in executable form of any
68 * substantial portion of the Covered Code or modification must reproduce the
69 * above Copyright Notice, and the following Disclaimer and Export Compliance
70 * provision in the documentation and/or other materials provided with the
71 * distribution.
73 * 3.4. Intel retains all right, title, and interest in and to the Original
74 * Intel Code.
76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77 * Intel shall be used in advertising or otherwise to promote the sale, use or
78 * other dealings in products derived from or relating to the Covered Code
79 * without prior written authorization from Intel.
81 * 4. Disclaimer and Export Compliance
83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89 * PARTICULAR PURPOSE.
91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98 * LIMITED REMEDY.
100 * 4.3. Licensee shall not export, either directly or indirectly, any of this
101 * software or system incorporating such software without first obtaining any
102 * required license or other approval from the U. S. Department of Commerce or
103 * any other agency or department of the United States Government. In the
104 * event Licensee exports any such software from the United States or
105 * re-exports any such software from a foreign destination, Licensee shall
106 * ensure that the distribution and export/re-export of the software is in
107 * compliance with all laws, regulations, orders, or other restrictions of the
108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109 * any of its subsidiaries will export/re-export any technical data, process,
110 * software, or service, directly or indirectly, to any country for which the
111 * United States government or any agency thereof requires an export license,
112 * other governmental approval, or letter of assurance, without first obtaining
113 * such license, approval or letter.
115 *****************************************************************************/
117 #define __NSDUMP_C__
119 #include "acpi.h"
120 #include "accommon.h"
121 #include "acnamesp.h"
124 #define _COMPONENT ACPI_NAMESPACE
125 ACPI_MODULE_NAME ("nsdump")
127 /* Local prototypes */
129 #ifdef ACPI_OBSOLETE_FUNCTIONS
130 void
131 AcpiNsDumpRootDevices (
132 void);
134 static ACPI_STATUS
135 AcpiNsDumpOneDevice (
136 ACPI_HANDLE ObjHandle,
137 UINT32 Level,
138 void *Context,
139 void **ReturnValue);
140 #endif
143 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
144 /*******************************************************************************
146 * FUNCTION: AcpiNsPrintPathname
148 * PARAMETERS: NumSegments - Number of ACPI name segments
149 * Pathname - The compressed (internal) path
151 * RETURN: None
153 * DESCRIPTION: Print an object's full namespace pathname
155 ******************************************************************************/
157 void
158 AcpiNsPrintPathname (
159 UINT32 NumSegments,
160 char *Pathname)
162 UINT32 i;
165 ACPI_FUNCTION_NAME (NsPrintPathname);
168 if (!(AcpiDbgLevel & ACPI_LV_NAMES) || !(AcpiDbgLayer & ACPI_NAMESPACE))
170 return;
173 /* Print the entire name */
175 ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "["));
177 while (NumSegments)
179 for (i = 0; i < 4; i++)
181 ACPI_IS_PRINT (Pathname[i]) ?
182 AcpiOsPrintf ("%c", Pathname[i]) :
183 AcpiOsPrintf ("?");
186 Pathname += ACPI_NAME_SIZE;
187 NumSegments--;
188 if (NumSegments)
190 AcpiOsPrintf (".");
194 AcpiOsPrintf ("]\n");
198 /*******************************************************************************
200 * FUNCTION: AcpiNsDumpPathname
202 * PARAMETERS: Handle - Object
203 * Msg - Prefix message
204 * Level - Desired debug level
205 * Component - Caller's component ID
207 * RETURN: None
209 * DESCRIPTION: Print an object's full namespace pathname
210 * Manages allocation/freeing of a pathname buffer
212 ******************************************************************************/
214 void
215 AcpiNsDumpPathname (
216 ACPI_HANDLE Handle,
217 char *Msg,
218 UINT32 Level,
219 UINT32 Component)
222 ACPI_FUNCTION_TRACE (NsDumpPathname);
225 /* Do this only if the requested debug level and component are enabled */
227 if (!(AcpiDbgLevel & Level) || !(AcpiDbgLayer & Component))
229 return_VOID;
232 /* Convert handle to a full pathname and print it (with supplied message) */
234 AcpiNsPrintNodePathname (Handle, Msg);
235 AcpiOsPrintf ("\n");
236 return_VOID;
240 /*******************************************************************************
242 * FUNCTION: AcpiNsDumpOneObject
244 * PARAMETERS: ObjHandle - Node to be dumped
245 * Level - Nesting level of the handle
246 * Context - Passed into WalkNamespace
247 * ReturnValue - Not used
249 * RETURN: Status
251 * DESCRIPTION: Dump a single Node
252 * This procedure is a UserFunction called by AcpiNsWalkNamespace.
254 ******************************************************************************/
256 ACPI_STATUS
257 AcpiNsDumpOneObject (
258 ACPI_HANDLE ObjHandle,
259 UINT32 Level,
260 void *Context,
261 void **ReturnValue)
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;
273 ACPI_FUNCTION_NAME (NsDumpOneObject);
276 /* Is output enabled? */
278 if (!(AcpiDbgLevel & Info->DebugLevel))
280 return (AE_OK);
283 if (!ObjHandle)
285 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null object handle\n"));
286 return (AE_OK);
289 ThisNode = AcpiNsValidateHandle (ObjHandle);
290 if (!ThisNode)
292 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p\n",
293 ObjHandle));
294 return (AE_OK);
297 Type = ThisNode->Type;
299 /* Check if the owner matches */
301 if ((Info->OwnerId != ACPI_OWNER_ID_MAX) &&
302 (Info->OwnerId != ThisNode->OwnerId))
304 return (AE_OK);
307 if (!(Info->DisplayType & ACPI_DISPLAY_SHORT))
309 /* Indent the object according to the level */
311 AcpiOsPrintf ("%2d%*s", (UINT32) Level - 1, (int) Level * 2, " ");
313 /* Check the node type and name */
315 if (Type > ACPI_TYPE_LOCAL_MAX)
317 ACPI_WARNING ((AE_INFO, "Invalid ACPI Object Type 0x%08X", Type));
320 AcpiOsPrintf ("%4.4s", AcpiUtGetNodeName (ThisNode));
323 /* Now we can print out the pertinent information */
325 AcpiOsPrintf (" %-12s %p %2.2X ",
326 AcpiUtGetTypeName (Type), ThisNode, ThisNode->OwnerId);
328 DbgLevel = AcpiDbgLevel;
329 AcpiDbgLevel = 0;
330 ObjDesc = AcpiNsGetAttachedObject (ThisNode);
331 AcpiDbgLevel = DbgLevel;
333 /* Temp nodes are those nodes created by a control method */
335 if (ThisNode->Flags & ANOBJ_TEMPORARY)
337 AcpiOsPrintf ("(T) ");
340 switch (Info->DisplayType & ACPI_DISPLAY_MASK)
342 case ACPI_DISPLAY_SUMMARY:
344 if (!ObjDesc)
346 /* No attached object. Some types should always have an object */
348 switch (Type)
350 case ACPI_TYPE_INTEGER:
351 case ACPI_TYPE_PACKAGE:
352 case ACPI_TYPE_BUFFER:
353 case ACPI_TYPE_STRING:
354 case ACPI_TYPE_METHOD:
355 AcpiOsPrintf ("<No attached object>");
356 break;
358 default:
359 break;
362 AcpiOsPrintf ("\n");
363 return (AE_OK);
366 switch (Type)
368 case ACPI_TYPE_PROCESSOR:
370 AcpiOsPrintf ("ID %02X Len %02X Addr %p\n",
371 ObjDesc->Processor.ProcId, ObjDesc->Processor.Length,
372 ACPI_CAST_PTR (void, ObjDesc->Processor.Address));
373 break;
376 case ACPI_TYPE_DEVICE:
378 AcpiOsPrintf ("Notify Object: %p\n", ObjDesc);
379 break;
382 case ACPI_TYPE_METHOD:
384 AcpiOsPrintf ("Args %X Len %.4X Aml %p\n",
385 (UINT32) ObjDesc->Method.ParamCount,
386 ObjDesc->Method.AmlLength, ObjDesc->Method.AmlStart);
387 break;
390 case ACPI_TYPE_INTEGER:
392 AcpiOsPrintf ("= %8.8X%8.8X\n",
393 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
394 break;
397 case ACPI_TYPE_PACKAGE:
399 if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
401 AcpiOsPrintf ("Elements %.2X\n",
402 ObjDesc->Package.Count);
404 else
406 AcpiOsPrintf ("[Length not yet evaluated]\n");
408 break;
411 case ACPI_TYPE_BUFFER:
413 if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
415 AcpiOsPrintf ("Len %.2X",
416 ObjDesc->Buffer.Length);
418 /* Dump some of the buffer */
420 if (ObjDesc->Buffer.Length > 0)
422 AcpiOsPrintf (" =");
423 for (i = 0; (i < ObjDesc->Buffer.Length && i < 12); i++)
425 AcpiOsPrintf (" %.2hX", ObjDesc->Buffer.Pointer[i]);
428 AcpiOsPrintf ("\n");
430 else
432 AcpiOsPrintf ("[Length not yet evaluated]\n");
434 break;
437 case ACPI_TYPE_STRING:
439 AcpiOsPrintf ("Len %.2X ", ObjDesc->String.Length);
440 AcpiUtPrintString (ObjDesc->String.Pointer, 32);
441 AcpiOsPrintf ("\n");
442 break;
445 case ACPI_TYPE_REGION:
447 AcpiOsPrintf ("[%s]",
448 AcpiUtGetRegionName (ObjDesc->Region.SpaceId));
449 if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
451 AcpiOsPrintf (" Addr %8.8X%8.8X Len %.4X\n",
452 ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
453 ObjDesc->Region.Length);
455 else
457 AcpiOsPrintf (" [Address/Length not yet evaluated]\n");
459 break;
462 case ACPI_TYPE_LOCAL_REFERENCE:
464 AcpiOsPrintf ("[%s]\n", AcpiUtGetReferenceName (ObjDesc));
465 break;
468 case ACPI_TYPE_BUFFER_FIELD:
470 if (ObjDesc->BufferField.BufferObj &&
471 ObjDesc->BufferField.BufferObj->Buffer.Node)
473 AcpiOsPrintf ("Buf [%4.4s]",
474 AcpiUtGetNodeName (
475 ObjDesc->BufferField.BufferObj->Buffer.Node));
477 break;
480 case ACPI_TYPE_LOCAL_REGION_FIELD:
482 AcpiOsPrintf ("Rgn [%4.4s]",
483 AcpiUtGetNodeName (
484 ObjDesc->CommonField.RegionObj->Region.Node));
485 break;
488 case ACPI_TYPE_LOCAL_BANK_FIELD:
490 AcpiOsPrintf ("Rgn [%4.4s] Bnk [%4.4s]",
491 AcpiUtGetNodeName (
492 ObjDesc->CommonField.RegionObj->Region.Node),
493 AcpiUtGetNodeName (
494 ObjDesc->BankField.BankObj->CommonField.Node));
495 break;
498 case ACPI_TYPE_LOCAL_INDEX_FIELD:
500 AcpiOsPrintf ("Idx [%4.4s] Dat [%4.4s]",
501 AcpiUtGetNodeName (
502 ObjDesc->IndexField.IndexObj->CommonField.Node),
503 AcpiUtGetNodeName (
504 ObjDesc->IndexField.DataObj->CommonField.Node));
505 break;
508 case ACPI_TYPE_LOCAL_ALIAS:
509 case ACPI_TYPE_LOCAL_METHOD_ALIAS:
511 AcpiOsPrintf ("Target %4.4s (%p)\n",
512 AcpiUtGetNodeName (ObjDesc), ObjDesc);
513 break;
515 default:
517 AcpiOsPrintf ("Object %p\n", ObjDesc);
518 break;
521 /* Common field handling */
523 switch (Type)
525 case ACPI_TYPE_BUFFER_FIELD:
526 case ACPI_TYPE_LOCAL_REGION_FIELD:
527 case ACPI_TYPE_LOCAL_BANK_FIELD:
528 case ACPI_TYPE_LOCAL_INDEX_FIELD:
530 AcpiOsPrintf (" Off %.3X Len %.2X Acc %.2hd\n",
531 (ObjDesc->CommonField.BaseByteOffset * 8)
532 + ObjDesc->CommonField.StartFieldBitOffset,
533 ObjDesc->CommonField.BitLength,
534 ObjDesc->CommonField.AccessByteWidth);
535 break;
537 default:
538 break;
540 break;
543 case ACPI_DISPLAY_OBJECTS:
545 AcpiOsPrintf ("O:%p", ObjDesc);
546 if (!ObjDesc)
548 /* No attached object, we are done */
550 AcpiOsPrintf ("\n");
551 return (AE_OK);
554 AcpiOsPrintf ("(R%u)", ObjDesc->Common.ReferenceCount);
556 switch (Type)
558 case ACPI_TYPE_METHOD:
560 /* Name is a Method and its AML offset/length are set */
562 AcpiOsPrintf (" M:%p-%X\n", ObjDesc->Method.AmlStart,
563 ObjDesc->Method.AmlLength);
564 break;
566 case ACPI_TYPE_INTEGER:
568 AcpiOsPrintf (" I:%8.8X8.8%X\n",
569 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
570 break;
572 case ACPI_TYPE_STRING:
574 AcpiOsPrintf (" S:%p-%X\n", ObjDesc->String.Pointer,
575 ObjDesc->String.Length);
576 break;
578 case ACPI_TYPE_BUFFER:
580 AcpiOsPrintf (" B:%p-%X\n", ObjDesc->Buffer.Pointer,
581 ObjDesc->Buffer.Length);
582 break;
584 default:
586 AcpiOsPrintf ("\n");
587 break;
589 break;
592 default:
593 AcpiOsPrintf ("\n");
594 break;
597 /* If debug turned off, done */
599 if (!(AcpiDbgLevel & ACPI_LV_VALUES))
601 return (AE_OK);
604 /* If there is an attached object, display it */
606 DbgLevel = AcpiDbgLevel;
607 AcpiDbgLevel = 0;
608 ObjDesc = AcpiNsGetAttachedObject (ThisNode);
609 AcpiDbgLevel = DbgLevel;
611 /* Dump attached objects */
613 while (ObjDesc)
615 ObjType = ACPI_TYPE_INVALID;
616 AcpiOsPrintf ("Attached Object %p: ", ObjDesc);
618 /* Decode the type of attached object and dump the contents */
620 switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
622 case ACPI_DESC_TYPE_NAMED:
624 AcpiOsPrintf ("(Ptr to Node)\n");
625 BytesToDump = sizeof (ACPI_NAMESPACE_NODE);
626 ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
627 break;
629 case ACPI_DESC_TYPE_OPERAND:
631 ObjType = ObjDesc->Common.Type;
633 if (ObjType > ACPI_TYPE_LOCAL_MAX)
635 AcpiOsPrintf ("(Pointer to ACPI Object type %.2X [UNKNOWN])\n",
636 ObjType);
637 BytesToDump = 32;
639 else
641 AcpiOsPrintf ("(Pointer to ACPI Object type %.2X [%s])\n",
642 ObjType, AcpiUtGetTypeName (ObjType));
643 BytesToDump = sizeof (ACPI_OPERAND_OBJECT);
646 ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
647 break;
649 default:
651 break;
654 /* If value is NOT an internal object, we are done */
656 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
658 goto Cleanup;
661 /* Valid object, get the pointer to next level, if any */
663 switch (ObjType)
665 case ACPI_TYPE_BUFFER:
666 case ACPI_TYPE_STRING:
668 * NOTE: takes advantage of common fields between string/buffer
670 BytesToDump = ObjDesc->String.Length;
671 ObjDesc = (void *) ObjDesc->String.Pointer;
672 AcpiOsPrintf ( "(Buffer/String pointer %p length %X)\n",
673 ObjDesc, BytesToDump);
674 ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
675 goto Cleanup;
677 case ACPI_TYPE_BUFFER_FIELD:
678 ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->BufferField.BufferObj;
679 break;
681 case ACPI_TYPE_PACKAGE:
682 ObjDesc = (void *) ObjDesc->Package.Elements;
683 break;
685 case ACPI_TYPE_METHOD:
686 ObjDesc = (void *) ObjDesc->Method.AmlStart;
687 break;
689 case ACPI_TYPE_LOCAL_REGION_FIELD:
690 ObjDesc = (void *) ObjDesc->Field.RegionObj;
691 break;
693 case ACPI_TYPE_LOCAL_BANK_FIELD:
694 ObjDesc = (void *) ObjDesc->BankField.RegionObj;
695 break;
697 case ACPI_TYPE_LOCAL_INDEX_FIELD:
698 ObjDesc = (void *) ObjDesc->IndexField.IndexObj;
699 break;
701 default:
702 goto Cleanup;
705 ObjType = ACPI_TYPE_INVALID; /* Terminate loop after next pass */
708 Cleanup:
709 AcpiOsPrintf ("\n");
710 return (AE_OK);
714 /*******************************************************************************
716 * FUNCTION: AcpiNsDumpObjects
718 * PARAMETERS: Type - Object type to be dumped
719 * DisplayType - 0 or ACPI_DISPLAY_SUMMARY
720 * MaxDepth - Maximum depth of dump. Use ACPI_UINT32_MAX
721 * for an effectively unlimited depth.
722 * OwnerId - Dump only objects owned by this ID. Use
723 * ACPI_UINT32_MAX to match all owners.
724 * StartHandle - Where in namespace to start/end search
726 * RETURN: None
728 * DESCRIPTION: Dump typed objects within the loaded namespace. Uses
729 * AcpiNsWalkNamespace in conjunction with AcpiNsDumpOneObject.
731 ******************************************************************************/
733 void
734 AcpiNsDumpObjects (
735 ACPI_OBJECT_TYPE Type,
736 UINT8 DisplayType,
737 UINT32 MaxDepth,
738 ACPI_OWNER_ID OwnerId,
739 ACPI_HANDLE StartHandle)
741 ACPI_WALK_INFO Info;
742 ACPI_STATUS Status;
745 ACPI_FUNCTION_ENTRY ();
749 * Just lock the entire namespace for the duration of the dump.
750 * We don't want any changes to the namespace during this time,
751 * especially the temporary nodes since we are going to display
752 * them also.
754 Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
755 if (ACPI_FAILURE (Status))
757 AcpiOsPrintf ("Could not acquire namespace mutex\n");
758 return;
761 Info.DebugLevel = ACPI_LV_TABLES;
762 Info.OwnerId = OwnerId;
763 Info.DisplayType = DisplayType;
765 (void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
766 ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
767 AcpiNsDumpOneObject, NULL, (void *) &Info, NULL);
769 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
773 /*******************************************************************************
775 * FUNCTION: AcpiNsDumpEntry
777 * PARAMETERS: Handle - Node to be dumped
778 * DebugLevel - Output level
780 * RETURN: None
782 * DESCRIPTION: Dump a single Node
784 ******************************************************************************/
786 void
787 AcpiNsDumpEntry (
788 ACPI_HANDLE Handle,
789 UINT32 DebugLevel)
791 ACPI_WALK_INFO Info;
794 ACPI_FUNCTION_ENTRY ();
797 Info.DebugLevel = DebugLevel;
798 Info.OwnerId = ACPI_OWNER_ID_MAX;
799 Info.DisplayType = ACPI_DISPLAY_SUMMARY;
801 (void) AcpiNsDumpOneObject (Handle, 1, &Info, NULL);
805 #ifdef ACPI_ASL_COMPILER
806 /*******************************************************************************
808 * FUNCTION: AcpiNsDumpTables
810 * PARAMETERS: SearchBase - Root of subtree to be dumped, or
811 * NS_ALL to dump the entire namespace
812 * MaxDepth - Maximum depth of dump. Use INT_MAX
813 * for an effectively unlimited depth.
815 * RETURN: None
817 * DESCRIPTION: Dump the name space, or a portion of it.
819 ******************************************************************************/
821 void
822 AcpiNsDumpTables (
823 ACPI_HANDLE SearchBase,
824 UINT32 MaxDepth)
826 ACPI_HANDLE SearchHandle = SearchBase;
829 ACPI_FUNCTION_TRACE (NsDumpTables);
832 if (!AcpiGbl_RootNode)
835 * If the name space has not been initialized,
836 * there is nothing to dump.
838 ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "namespace not initialized!\n"));
839 return_VOID;
842 if (ACPI_NS_ALL == SearchBase)
844 /* Entire namespace */
846 SearchHandle = AcpiGbl_RootNode;
847 ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "\\\n"));
850 AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, MaxDepth,
851 ACPI_OWNER_ID_MAX, SearchHandle);
852 return_VOID;
854 #endif
855 #endif