1 /******************************************************************************
3 * Module Name: nsdump - table dumping routines for debug
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
12 * All rights reserved.
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
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
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
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
73 * 3.4. Intel retains all right, title, and interest in and to the Original
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
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
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 * Alternatively, you may choose to be licensed under the terms of the
120 * Redistribution and use in source and binary forms, with or without
121 * modification, are permitted provided that the following conditions
123 * 1. Redistributions of source code must retain the above copyright
124 * notice, this list of conditions, and the following disclaimer,
125 * without modification.
126 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
127 * substantially similar to the "NO WARRANTY" disclaimer below
128 * ("Disclaimer") and any redistribution must be conditioned upon
129 * including a substantially similar Disclaimer requirement for further
130 * binary redistribution.
131 * 3. Neither the names of the above-listed copyright holders nor the names
132 * of any contributors may be used to endorse or promote products derived
133 * from this software without specific prior written permission.
135 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
136 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
137 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
138 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
139 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
140 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
141 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
142 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
143 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
144 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
145 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
147 * Alternatively, you may choose to be licensed under the terms of the
148 * GNU General Public License ("GPL") version 2 as published by the Free
149 * Software Foundation.
151 *****************************************************************************/
154 #include "accommon.h"
155 #include "acnamesp.h"
156 #include "acoutput.h"
159 #define _COMPONENT ACPI_NAMESPACE
160 ACPI_MODULE_NAME ("nsdump")
162 /* Local prototypes */
164 #ifdef ACPI_OBSOLETE_FUNCTIONS
166 AcpiNsDumpRootDevices (
170 AcpiNsDumpOneDevice (
171 ACPI_HANDLE ObjHandle,
178 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
181 AcpiNsDumpOneObjectPath (
182 ACPI_HANDLE ObjHandle,
189 ACPI_HANDLE ObjHandle,
195 /*******************************************************************************
197 * FUNCTION: AcpiNsPrintPathname
199 * PARAMETERS: NumSegments - Number of ACPI name segments
200 * Pathname - The compressed (internal) path
204 * DESCRIPTION: Print an object's full namespace pathname
206 ******************************************************************************/
209 AcpiNsPrintPathname (
211 const char *Pathname)
216 ACPI_FUNCTION_NAME (NsPrintPathname);
219 /* Check if debug output enabled */
221 if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_NAMES, ACPI_NAMESPACE))
226 /* Print the entire name */
228 ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "["));
232 for (i = 0; i < 4; i++)
234 isprint ((int) Pathname[i]) ?
235 AcpiOsPrintf ("%c", Pathname[i]) :
239 Pathname += ACPI_NAME_SIZE;
247 AcpiOsPrintf ("]\n");
251 #ifdef ACPI_OBSOLETE_FUNCTIONS
252 /* Not used at this time, perhaps later */
254 /*******************************************************************************
256 * FUNCTION: AcpiNsDumpPathname
258 * PARAMETERS: Handle - Object
259 * Msg - Prefix message
260 * Level - Desired debug level
261 * Component - Caller's component ID
265 * DESCRIPTION: Print an object's full namespace pathname
266 * Manages allocation/freeing of a pathname buffer
268 ******************************************************************************/
278 ACPI_FUNCTION_TRACE (NsDumpPathname);
281 /* Do this only if the requested debug level and component are enabled */
283 if (!ACPI_IS_DEBUG_ENABLED (Level, Component))
288 /* Convert handle to a full pathname and print it (with supplied message) */
290 AcpiNsPrintNodePathname (Handle, Msg);
296 /*******************************************************************************
298 * FUNCTION: AcpiNsDumpOneObject
300 * PARAMETERS: ObjHandle - Node to be dumped
301 * Level - Nesting level of the handle
302 * Context - Passed into WalkNamespace
303 * ReturnValue - Not used
307 * DESCRIPTION: Dump a single Node
308 * This procedure is a UserFunction called by AcpiNsWalkNamespace.
310 ******************************************************************************/
313 AcpiNsDumpOneObject (
314 ACPI_HANDLE ObjHandle,
319 ACPI_WALK_INFO *Info = (ACPI_WALK_INFO *) Context;
320 ACPI_NAMESPACE_NODE *ThisNode;
321 ACPI_OPERAND_OBJECT *ObjDesc = NULL;
322 ACPI_OBJECT_TYPE ObjType;
323 ACPI_OBJECT_TYPE Type;
329 ACPI_FUNCTION_NAME (NsDumpOneObject);
332 /* Is output enabled? */
334 if (!(AcpiDbgLevel & Info->DebugLevel))
341 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null object handle\n"));
345 ThisNode = AcpiNsValidateHandle (ObjHandle);
348 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p\n",
353 Type = ThisNode->Type;
355 /* Check if the owner matches */
357 if ((Info->OwnerId != ACPI_OWNER_ID_MAX) &&
358 (Info->OwnerId != ThisNode->OwnerId))
363 if (!(Info->DisplayType & ACPI_DISPLAY_SHORT))
365 /* Indent the object according to the level */
367 AcpiOsPrintf ("%2d%*s", (UINT32) Level - 1, (int) Level * 2, " ");
369 /* Check the node type and name */
371 if (Type > ACPI_TYPE_LOCAL_MAX)
373 ACPI_WARNING ((AE_INFO,
374 "Invalid ACPI Object Type 0x%08X", Type));
377 AcpiOsPrintf ("%4.4s", AcpiUtGetNodeName (ThisNode));
380 /* Now we can print out the pertinent information */
382 AcpiOsPrintf (" %-12s %p %2.2X ",
383 AcpiUtGetTypeName (Type), ThisNode, ThisNode->OwnerId);
385 DbgLevel = AcpiDbgLevel;
387 ObjDesc = AcpiNsGetAttachedObject (ThisNode);
388 AcpiDbgLevel = DbgLevel;
390 /* Temp nodes are those nodes created by a control method */
392 if (ThisNode->Flags & ANOBJ_TEMPORARY)
394 AcpiOsPrintf ("(T) ");
397 switch (Info->DisplayType & ACPI_DISPLAY_MASK)
399 case ACPI_DISPLAY_SUMMARY:
403 /* No attached object. Some types should always have an object */
407 case ACPI_TYPE_INTEGER:
408 case ACPI_TYPE_PACKAGE:
409 case ACPI_TYPE_BUFFER:
410 case ACPI_TYPE_STRING:
411 case ACPI_TYPE_METHOD:
413 AcpiOsPrintf ("<No attached object>");
427 case ACPI_TYPE_PROCESSOR:
429 AcpiOsPrintf ("ID %02X Len %02X Addr %8.8X%8.8X\n",
430 ObjDesc->Processor.ProcId, ObjDesc->Processor.Length,
431 ACPI_FORMAT_UINT64 (ObjDesc->Processor.Address));
434 case ACPI_TYPE_DEVICE:
436 AcpiOsPrintf ("Notify Object: %p\n", ObjDesc);
439 case ACPI_TYPE_METHOD:
441 AcpiOsPrintf ("Args %X Len %.4X Aml %p\n",
442 (UINT32) ObjDesc->Method.ParamCount,
443 ObjDesc->Method.AmlLength, ObjDesc->Method.AmlStart);
446 case ACPI_TYPE_INTEGER:
448 AcpiOsPrintf ("= %8.8X%8.8X\n",
449 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
452 case ACPI_TYPE_PACKAGE:
454 if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
456 AcpiOsPrintf ("Elements %.2X\n",
457 ObjDesc->Package.Count);
461 AcpiOsPrintf ("[Length not yet evaluated]\n");
465 case ACPI_TYPE_BUFFER:
467 if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
469 AcpiOsPrintf ("Len %.2X",
470 ObjDesc->Buffer.Length);
472 /* Dump some of the buffer */
474 if (ObjDesc->Buffer.Length > 0)
477 for (i = 0; (i < ObjDesc->Buffer.Length && i < 12); i++)
479 AcpiOsPrintf (" %.2hX", ObjDesc->Buffer.Pointer[i]);
486 AcpiOsPrintf ("[Length not yet evaluated]\n");
490 case ACPI_TYPE_STRING:
492 AcpiOsPrintf ("Len %.2X ", ObjDesc->String.Length);
493 AcpiUtPrintString (ObjDesc->String.Pointer, 80);
497 case ACPI_TYPE_REGION:
499 AcpiOsPrintf ("[%s]",
500 AcpiUtGetRegionName (ObjDesc->Region.SpaceId));
501 if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
503 AcpiOsPrintf (" Addr %8.8X%8.8X Len %.4X\n",
504 ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
505 ObjDesc->Region.Length);
509 AcpiOsPrintf (" [Address/Length not yet evaluated]\n");
513 case ACPI_TYPE_LOCAL_REFERENCE:
515 AcpiOsPrintf ("[%s]\n", AcpiUtGetReferenceName (ObjDesc));
518 case ACPI_TYPE_BUFFER_FIELD:
520 if (ObjDesc->BufferField.BufferObj &&
521 ObjDesc->BufferField.BufferObj->Buffer.Node)
523 AcpiOsPrintf ("Buf [%4.4s]",
525 ObjDesc->BufferField.BufferObj->Buffer.Node));
529 case ACPI_TYPE_LOCAL_REGION_FIELD:
531 AcpiOsPrintf ("Rgn [%4.4s]",
533 ObjDesc->CommonField.RegionObj->Region.Node));
536 case ACPI_TYPE_LOCAL_BANK_FIELD:
538 AcpiOsPrintf ("Rgn [%4.4s] Bnk [%4.4s]",
540 ObjDesc->CommonField.RegionObj->Region.Node),
542 ObjDesc->BankField.BankObj->CommonField.Node));
545 case ACPI_TYPE_LOCAL_INDEX_FIELD:
547 AcpiOsPrintf ("Idx [%4.4s] Dat [%4.4s]",
549 ObjDesc->IndexField.IndexObj->CommonField.Node),
551 ObjDesc->IndexField.DataObj->CommonField.Node));
554 case ACPI_TYPE_LOCAL_ALIAS:
555 case ACPI_TYPE_LOCAL_METHOD_ALIAS:
557 AcpiOsPrintf ("Target %4.4s (%p)\n",
558 AcpiUtGetNodeName (ObjDesc), ObjDesc);
563 AcpiOsPrintf ("Object %p\n", ObjDesc);
567 /* Common field handling */
571 case ACPI_TYPE_BUFFER_FIELD:
572 case ACPI_TYPE_LOCAL_REGION_FIELD:
573 case ACPI_TYPE_LOCAL_BANK_FIELD:
574 case ACPI_TYPE_LOCAL_INDEX_FIELD:
576 AcpiOsPrintf (" Off %.3X Len %.2X Acc %.2hd\n",
577 (ObjDesc->CommonField.BaseByteOffset * 8)
578 + ObjDesc->CommonField.StartFieldBitOffset,
579 ObjDesc->CommonField.BitLength,
580 ObjDesc->CommonField.AccessByteWidth);
589 case ACPI_DISPLAY_OBJECTS:
591 AcpiOsPrintf ("O:%p", ObjDesc);
594 /* No attached object, we are done */
600 AcpiOsPrintf ("(R%u)", ObjDesc->Common.ReferenceCount);
604 case ACPI_TYPE_METHOD:
606 /* Name is a Method and its AML offset/length are set */
608 AcpiOsPrintf (" M:%p-%X\n", ObjDesc->Method.AmlStart,
609 ObjDesc->Method.AmlLength);
612 case ACPI_TYPE_INTEGER:
614 AcpiOsPrintf (" I:%8.8X8.8%X\n",
615 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
618 case ACPI_TYPE_STRING:
620 AcpiOsPrintf (" S:%p-%X\n", ObjDesc->String.Pointer,
621 ObjDesc->String.Length);
624 case ACPI_TYPE_BUFFER:
626 AcpiOsPrintf (" B:%p-%X\n", ObjDesc->Buffer.Pointer,
627 ObjDesc->Buffer.Length);
642 /* If debug turned off, done */
644 if (!(AcpiDbgLevel & ACPI_LV_VALUES))
649 /* If there is an attached object, display it */
651 DbgLevel = AcpiDbgLevel;
653 ObjDesc = AcpiNsGetAttachedObject (ThisNode);
654 AcpiDbgLevel = DbgLevel;
656 /* Dump attached objects */
660 ObjType = ACPI_TYPE_INVALID;
661 AcpiOsPrintf ("Attached Object %p: ", ObjDesc);
663 /* Decode the type of attached object and dump the contents */
665 switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
667 case ACPI_DESC_TYPE_NAMED:
669 AcpiOsPrintf ("(Ptr to Node)\n");
670 BytesToDump = sizeof (ACPI_NAMESPACE_NODE);
671 ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
674 case ACPI_DESC_TYPE_OPERAND:
676 ObjType = ObjDesc->Common.Type;
678 if (ObjType > ACPI_TYPE_LOCAL_MAX)
681 "(Pointer to ACPI Object type %.2X [UNKNOWN])\n",
689 "(Pointer to ACPI Object type %.2X [%s])\n",
690 ObjType, AcpiUtGetTypeName (ObjType));
692 BytesToDump = sizeof (ACPI_OPERAND_OBJECT);
695 ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
703 /* If value is NOT an internal object, we are done */
705 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
710 /* Valid object, get the pointer to next level, if any */
714 case ACPI_TYPE_BUFFER:
715 case ACPI_TYPE_STRING:
717 * NOTE: takes advantage of common fields between string/buffer
719 BytesToDump = ObjDesc->String.Length;
720 ObjDesc = (void *) ObjDesc->String.Pointer;
722 AcpiOsPrintf ("(Buffer/String pointer %p length %X)\n",
723 ObjDesc, BytesToDump);
724 ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
727 case ACPI_TYPE_BUFFER_FIELD:
729 ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->BufferField.BufferObj;
732 case ACPI_TYPE_PACKAGE:
734 ObjDesc = (void *) ObjDesc->Package.Elements;
737 case ACPI_TYPE_METHOD:
739 ObjDesc = (void *) ObjDesc->Method.AmlStart;
742 case ACPI_TYPE_LOCAL_REGION_FIELD:
744 ObjDesc = (void *) ObjDesc->Field.RegionObj;
747 case ACPI_TYPE_LOCAL_BANK_FIELD:
749 ObjDesc = (void *) ObjDesc->BankField.RegionObj;
752 case ACPI_TYPE_LOCAL_INDEX_FIELD:
754 ObjDesc = (void *) ObjDesc->IndexField.IndexObj;
762 ObjType = ACPI_TYPE_INVALID; /* Terminate loop after next pass */
771 /*******************************************************************************
773 * FUNCTION: AcpiNsDumpObjects
775 * PARAMETERS: Type - Object type to be dumped
776 * DisplayType - 0 or ACPI_DISPLAY_SUMMARY
777 * MaxDepth - Maximum depth of dump. Use ACPI_UINT32_MAX
778 * for an effectively unlimited depth.
779 * OwnerId - Dump only objects owned by this ID. Use
780 * ACPI_UINT32_MAX to match all owners.
781 * StartHandle - Where in namespace to start/end search
785 * DESCRIPTION: Dump typed objects within the loaded namespace. Uses
786 * AcpiNsWalkNamespace in conjunction with AcpiNsDumpOneObject.
788 ******************************************************************************/
792 ACPI_OBJECT_TYPE Type,
795 ACPI_OWNER_ID OwnerId,
796 ACPI_HANDLE StartHandle)
802 ACPI_FUNCTION_ENTRY ();
806 * Just lock the entire namespace for the duration of the dump.
807 * We don't want any changes to the namespace during this time,
808 * especially the temporary nodes since we are going to display
811 Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
812 if (ACPI_FAILURE (Status))
814 AcpiOsPrintf ("Could not acquire namespace mutex\n");
818 Info.DebugLevel = ACPI_LV_TABLES;
819 Info.OwnerId = OwnerId;
820 Info.DisplayType = DisplayType;
822 (void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
823 ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
824 AcpiNsDumpOneObject, NULL, (void *) &Info, NULL);
826 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
830 /*******************************************************************************
832 * FUNCTION: AcpiNsDumpOneObjectPath, AcpiNsGetMaxDepth
834 * PARAMETERS: ObjHandle - Node to be dumped
835 * Level - Nesting level of the handle
836 * Context - Passed into WalkNamespace
837 * ReturnValue - Not used
841 * DESCRIPTION: Dump the full pathname to a namespace object. AcpNsGetMaxDepth
842 * computes the maximum nesting depth in the namespace tree, in
843 * order to simplify formatting in AcpiNsDumpOneObjectPath.
844 * These procedures are UserFunctions called by AcpiNsWalkNamespace.
846 ******************************************************************************/
849 AcpiNsDumpOneObjectPath (
850 ACPI_HANDLE ObjHandle,
855 UINT32 MaxLevel = *((UINT32 *) Context);
857 ACPI_NAMESPACE_NODE *Node;
866 Node = AcpiNsValidateHandle (ObjHandle);
869 /* Ignore bad node during namespace walk */
874 Pathname = AcpiNsGetNormalizedPathname (Node, TRUE);
877 if (Level <= MaxLevel)
879 PathIndent = MaxLevel - Level + 1;
882 AcpiOsPrintf ("%2d%*s%-12s%*s",
883 Level, Level, " ", AcpiUtGetTypeName (Node->Type),
886 AcpiOsPrintf ("%s\n", &Pathname[1]);
887 ACPI_FREE (Pathname);
894 ACPI_HANDLE ObjHandle,
899 UINT32 *MaxLevel = (UINT32 *) Context;
902 if (Level > *MaxLevel)
910 /*******************************************************************************
912 * FUNCTION: AcpiNsDumpObjectPaths
914 * PARAMETERS: Type - Object type to be dumped
915 * DisplayType - 0 or ACPI_DISPLAY_SUMMARY
916 * MaxDepth - Maximum depth of dump. Use ACPI_UINT32_MAX
917 * for an effectively unlimited depth.
918 * OwnerId - Dump only objects owned by this ID. Use
919 * ACPI_UINT32_MAX to match all owners.
920 * StartHandle - Where in namespace to start/end search
924 * DESCRIPTION: Dump full object pathnames within the loaded namespace. Uses
925 * AcpiNsWalkNamespace in conjunction with AcpiNsDumpOneObjectPath.
927 ******************************************************************************/
930 AcpiNsDumpObjectPaths (
931 ACPI_OBJECT_TYPE Type,
934 ACPI_OWNER_ID OwnerId,
935 ACPI_HANDLE StartHandle)
941 ACPI_FUNCTION_ENTRY ();
945 * Just lock the entire namespace for the duration of the dump.
946 * We don't want any changes to the namespace during this time,
947 * especially the temporary nodes since we are going to display
950 Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
951 if (ACPI_FAILURE (Status))
953 AcpiOsPrintf ("Could not acquire namespace mutex\n");
957 /* Get the max depth of the namespace tree, for formatting later */
959 (void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
960 ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
961 AcpiNsGetMaxDepth, NULL, (void *) &MaxLevel, NULL);
963 /* Now dump the entire namespace */
965 (void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
966 ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
967 AcpiNsDumpOneObjectPath, NULL, (void *) &MaxLevel, NULL);
969 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
973 /*******************************************************************************
975 * FUNCTION: AcpiNsDumpEntry
977 * PARAMETERS: Handle - Node to be dumped
978 * DebugLevel - Output level
982 * DESCRIPTION: Dump a single Node
984 ******************************************************************************/
994 ACPI_FUNCTION_ENTRY ();
997 Info.DebugLevel = DebugLevel;
998 Info.OwnerId = ACPI_OWNER_ID_MAX;
999 Info.DisplayType = ACPI_DISPLAY_SUMMARY;
1001 (void) AcpiNsDumpOneObject (Handle, 1, &Info, NULL);
1005 #ifdef ACPI_ASL_COMPILER
1006 /*******************************************************************************
1008 * FUNCTION: AcpiNsDumpTables
1010 * PARAMETERS: SearchBase - Root of subtree to be dumped, or
1011 * NS_ALL to dump the entire namespace
1012 * MaxDepth - Maximum depth of dump. Use INT_MAX
1013 * for an effectively unlimited depth.
1017 * DESCRIPTION: Dump the name space, or a portion of it.
1019 ******************************************************************************/
1023 ACPI_HANDLE SearchBase,
1026 ACPI_HANDLE SearchHandle = SearchBase;
1029 ACPI_FUNCTION_TRACE (NsDumpTables);
1032 if (!AcpiGbl_RootNode)
1035 * If the name space has not been initialized,
1036 * there is nothing to dump.
1038 ACPI_DEBUG_PRINT ((ACPI_DB_TABLES,
1039 "namespace not initialized!\n"));
1043 if (ACPI_NS_ALL == SearchBase)
1045 /* Entire namespace */
1047 SearchHandle = AcpiGbl_RootNode;
1048 ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "\\\n"));
1051 AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, MaxDepth,
1052 ACPI_OWNER_ID_MAX, SearchHandle);