1 /*******************************************************************************
3 * Module Name: dbcmds - debug commands and output routines
5 ******************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2009, 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,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
37 * The above copyright and patent license is granted only if the following
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
72 * 3.4. Intel retains all right, title, and interest in and to the Original
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
80 * 4. Disclaimer and Export Compliance
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
114 *****************************************************************************/
117 #include <contrib/dev/acpica/include/acpi.h>
118 #include <contrib/dev/acpica/include/accommon.h>
119 #include <contrib/dev/acpica/include/acdispat.h>
120 #include <contrib/dev/acpica/include/acnamesp.h>
121 #include <contrib/dev/acpica/include/acevents.h>
122 #include <contrib/dev/acpica/include/acdebug.h>
123 #include <contrib/dev/acpica/include/acresrc.h>
124 #include <contrib/dev/acpica/include/acdisasm.h>
125 #include <contrib/dev/acpica/include/actables.h>
126 #include <contrib/dev/acpica/include/acparser.h>
130 #define _COMPONENT ACPI_CA_DEBUGGER
131 ACPI_MODULE_NAME ("dbcmds")
133 /* Local prototypes */
136 AcpiDbIntegrityWalk (
137 ACPI_HANDLE ObjHandle,
143 AcpiDbWalkAndMatchName (
144 ACPI_HANDLE ObjHandle,
150 AcpiDbWalkForReferences (
151 ACPI_HANDLE ObjHandle,
157 AcpiDbWalkForSpecificObjects (
158 ACPI_HANDLE ObjHandle,
163 static ACPI_NAMESPACE_NODE *
164 AcpiDbConvertToNode (
168 AcpiDmCompareAmlResources (
170 ACPI_RSDESC_SIZE Aml1BufferLength,
172 ACPI_RSDESC_SIZE Aml2BufferLength);
175 AcpiDmTestResourceConversion (
176 ACPI_NAMESPACE_NODE *Node,
181 * Arguments for the Objects command
182 * These object types map directly to the ACPI_TYPES
184 static ARGUMENT_INFO AcpiDbObjectTypes [] =
208 {NULL} /* Must be null terminated */
212 /*******************************************************************************
214 * FUNCTION: AcpiDbConvertToNode
216 * PARAMETERS: InString - String to convert
218 * RETURN: Pointer to a NS node
220 * DESCRIPTION: Convert a string to a valid NS pointer. Handles numeric or
223 ******************************************************************************/
225 static ACPI_NAMESPACE_NODE *
226 AcpiDbConvertToNode (
229 ACPI_NAMESPACE_NODE *Node;
232 if ((*InString >= 0x30) && (*InString <= 0x39))
234 /* Numeric argument, convert */
236 Node = ACPI_TO_POINTER (ACPI_STRTOUL (InString, NULL, 16));
237 if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
239 AcpiOsPrintf ("Address %p is invalid in this address space\n",
244 /* Make sure pointer is valid NS node */
246 if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
248 AcpiOsPrintf ("Address %p is not a valid NS node [%s]\n",
249 Node, AcpiUtGetDescriptorName (Node));
256 /* The parameter is a name string that must be resolved to a
259 Node = AcpiDbLocalNsLookup (InString);
262 Node = AcpiGbl_RootNode;
270 /*******************************************************************************
272 * FUNCTION: AcpiDbSleep
274 * PARAMETERS: ObjectArg - Desired sleep state (0-5)
278 * DESCRIPTION: Simulate a sleep/wake sequence
280 ******************************************************************************/
290 SleepState = (UINT8) ACPI_STRTOUL (ObjectArg, NULL, 0);
292 AcpiOsPrintf ("**** Prepare to sleep ****\n");
293 Status = AcpiEnterSleepStatePrep (SleepState);
294 if (ACPI_FAILURE (Status))
299 AcpiOsPrintf ("**** Going to sleep ****\n");
300 Status = AcpiEnterSleepState (SleepState);
301 if (ACPI_FAILURE (Status))
306 AcpiOsPrintf ("**** returning from sleep ****\n");
307 Status = AcpiLeaveSleepState (SleepState);
313 /*******************************************************************************
315 * FUNCTION: AcpiDbWalkForReferences
317 * PARAMETERS: Callback from WalkNamespace
321 * DESCRIPTION: Check if this namespace object refers to the target object
322 * that is passed in as the context value.
324 * Note: Currently doesn't check subobjects within the Node's object
326 ******************************************************************************/
329 AcpiDbWalkForReferences (
330 ACPI_HANDLE ObjHandle,
335 ACPI_OPERAND_OBJECT *ObjDesc = (ACPI_OPERAND_OBJECT *) Context;
336 ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
339 /* Check for match against the namespace node itself */
341 if (Node == (void *) ObjDesc)
343 AcpiOsPrintf ("Object is a Node [%4.4s]\n",
344 AcpiUtGetNodeName (Node));
347 /* Check for match against the object attached to the node */
349 if (AcpiNsGetAttachedObject (Node) == ObjDesc)
351 AcpiOsPrintf ("Reference at Node->Object %p [%4.4s]\n",
352 Node, AcpiUtGetNodeName (Node));
359 /*******************************************************************************
361 * FUNCTION: AcpiDbFindReferences
363 * PARAMETERS: ObjectArg - String with hex value of the object
367 * DESCRIPTION: Search namespace for all references to the input object
369 ******************************************************************************/
372 AcpiDbFindReferences (
375 ACPI_OPERAND_OBJECT *ObjDesc;
378 /* Convert string to object pointer */
380 ObjDesc = ACPI_TO_POINTER (ACPI_STRTOUL (ObjectArg, NULL, 16));
382 /* Search all nodes in namespace */
384 (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
385 AcpiDbWalkForReferences, (void *) ObjDesc, NULL);
389 /*******************************************************************************
391 * FUNCTION: AcpiDbWalkForPredefinedNames
393 * PARAMETERS: Callback from WalkNamespace
397 * DESCRIPTION: Detect and display predefined ACPI names (names that start with
400 ******************************************************************************/
403 AcpiDbWalkForPredefinedNames (
404 ACPI_HANDLE ObjHandle,
409 ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
410 UINT32 *Count = (UINT32 *) Context;
411 const ACPI_PREDEFINED_INFO *Predefined;
412 const ACPI_PREDEFINED_INFO *Package = NULL;
416 Predefined = AcpiNsCheckForPredefinedName (Node);
422 Pathname = AcpiNsGetExternalPathname (Node);
428 /* If method returns a package, the info is in the next table entry */
430 if (Predefined->Info.ExpectedBtypes & ACPI_BTYPE_PACKAGE)
432 Package = Predefined + 1;
435 AcpiOsPrintf ("%-32s arg %X ret %2.2X", Pathname,
436 Predefined->Info.ParamCount, Predefined->Info.ExpectedBtypes);
440 AcpiOsPrintf (" PkgType %2.2X ObjType %2.2X Count %2.2X",
441 Package->RetInfo.Type, Package->RetInfo.ObjectType1,
442 Package->RetInfo.Count1);
447 AcpiNsCheckParameterCount (Pathname, Node, ACPI_UINT32_MAX, Predefined);
448 ACPI_FREE (Pathname);
455 /*******************************************************************************
457 * FUNCTION: AcpiDbCheckPredefinedNames
463 * DESCRIPTION: Validate all predefined names in the namespace
465 ******************************************************************************/
468 AcpiDbCheckPredefinedNames (
474 /* Search all nodes in namespace */
476 (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
477 AcpiDbWalkForPredefinedNames, (void *) &Count, NULL);
479 AcpiOsPrintf ("Found %d predefined names in the namespace\n", Count);
483 /*******************************************************************************
485 * FUNCTION: AcpiDbWalkForExecute
487 * PARAMETERS: Callback from WalkNamespace
491 * DESCRIPTION: Batch execution module. Currently only executes predefined
494 ******************************************************************************/
497 AcpiDbWalkForExecute (
498 ACPI_HANDLE ObjHandle,
503 ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
504 UINT32 *Count = (UINT32 *) Context;
505 const ACPI_PREDEFINED_INFO *Predefined;
506 ACPI_BUFFER ReturnObj;
511 ACPI_DEVICE_INFO *ObjInfo;
512 ACPI_OBJECT_LIST ParamObjects;
513 ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS];
516 Predefined = AcpiNsCheckForPredefinedName (Node);
522 if (Node->Type == ACPI_TYPE_LOCAL_SCOPE)
527 Pathname = AcpiNsGetExternalPathname (Node);
533 /* Get the object info for number of method parameters */
535 Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
536 Status = AcpiGetObjectInfo (ObjHandle, &Buffer);
537 if (ACPI_FAILURE (Status))
542 ParamObjects.Pointer = NULL;
543 ParamObjects.Count = 0;
545 ObjInfo = Buffer.Pointer;
546 if (ObjInfo->Type == ACPI_TYPE_METHOD)
549 /* Setup default parameters */
551 for (i = 0; i < ObjInfo->ParamCount; i++)
553 Params[i].Type = ACPI_TYPE_INTEGER;
554 Params[i].Integer.Value = 1;
557 ParamObjects.Pointer = Params;
558 ParamObjects.Count = ObjInfo->ParamCount;
561 ACPI_FREE (Buffer.Pointer);
563 ReturnObj.Pointer = NULL;
564 ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
567 /* Do the actual method execution */
569 AcpiGbl_MethodExecuting = TRUE;
571 Status = AcpiEvaluateObject (Node, NULL, &ParamObjects, &ReturnObj);
573 AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status));
574 AcpiGbl_MethodExecuting = FALSE;
576 ACPI_FREE (Pathname);
583 /*******************************************************************************
585 * FUNCTION: AcpiDbBatchExecute
591 * DESCRIPTION: Namespace batch execution.
593 ******************************************************************************/
602 /* Search all nodes in namespace */
604 (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
605 AcpiDbWalkForExecute, (void *) &Count, NULL);
607 AcpiOsPrintf ("Executed %d predefined names in the namespace\n", Count);
611 /*******************************************************************************
613 * FUNCTION: AcpiDbDisplayLocks
619 * DESCRIPTION: Display information about internal mutexes.
621 ******************************************************************************/
630 for (i = 0; i < ACPI_MAX_MUTEX; i++)
632 AcpiOsPrintf ("%26s : %s\n", AcpiUtGetMutexName (i),
633 AcpiGbl_MutexInfo[i].ThreadId == ACPI_MUTEX_NOT_ACQUIRED
634 ? "Locked" : "Unlocked");
639 /*******************************************************************************
641 * FUNCTION: AcpiDbDisplayTableInfo
643 * PARAMETERS: TableArg - String with name of table to be displayed
647 * DESCRIPTION: Display information about loaded tables. Current
648 * implementation displays all loaded tables.
650 ******************************************************************************/
653 AcpiDbDisplayTableInfo (
657 ACPI_TABLE_DESC *TableDesc;
661 /* Walk the entire root table list */
663 for (i = 0; i < AcpiGbl_RootTableList.Count; i++)
665 TableDesc = &AcpiGbl_RootTableList.Tables[i];
666 AcpiOsPrintf ("%d ", i);
668 /* Make sure that the table is mapped */
670 Status = AcpiTbVerifyTable (TableDesc);
671 if (ACPI_FAILURE (Status))
676 /* Dump the table header */
678 if (TableDesc->Pointer)
680 AcpiTbPrintTableHeader (TableDesc->Address, TableDesc->Pointer);
684 /* If the pointer is null, the table has been unloaded */
686 ACPI_INFO ((AE_INFO, "%4.4s - Table has been unloaded",
687 TableDesc->Signature.Ascii));
693 /*******************************************************************************
695 * FUNCTION: AcpiDbUnloadAcpiTable
697 * PARAMETERS: TableArg - Name of the table to be unloaded
698 * InstanceArg - Which instance of the table to unload (if
699 * there are multiple tables of the same type)
703 * DESCRIPTION: Unload an ACPI table.
704 * Instance is not implemented
706 ******************************************************************************/
709 AcpiDbUnloadAcpiTable (
713 /* TBD: Need to reimplement for new data structures */
720 /* Search all tables for the target type */
722 for (i = 0; i < (ACPI_TABLE_ID_MAX+1); i++)
724 if (!ACPI_STRNCMP (TableArg, AcpiGbl_TableData[i].Signature,
725 AcpiGbl_TableData[i].SigLength))
727 /* Found the table, unload it */
729 Status = AcpiUnloadTable (i);
730 if (ACPI_SUCCESS (Status))
732 AcpiOsPrintf ("[%s] unloaded and uninstalled\n", TableArg);
736 AcpiOsPrintf ("%s, while unloading [%s]\n",
737 AcpiFormatException (Status), TableArg);
744 AcpiOsPrintf ("Unknown table type [%s]\n", TableArg);
749 /*******************************************************************************
751 * FUNCTION: AcpiDbSetMethodBreakpoint
753 * PARAMETERS: Location - AML offset of breakpoint
754 * WalkState - Current walk info
755 * Op - Current Op (from parse walk)
759 * DESCRIPTION: Set a breakpoint in a control method at the specified
762 ******************************************************************************/
765 AcpiDbSetMethodBreakpoint (
767 ACPI_WALK_STATE *WalkState,
768 ACPI_PARSE_OBJECT *Op)
775 AcpiOsPrintf ("There is no method currently executing\n");
779 /* Get and verify the breakpoint address */
781 Address = ACPI_STRTOUL (Location, NULL, 16);
782 if (Address <= Op->Common.AmlOffset)
784 AcpiOsPrintf ("Breakpoint %X is beyond current address %X\n",
785 Address, Op->Common.AmlOffset);
788 /* Save breakpoint in current walk */
790 WalkState->UserBreakpoint = Address;
791 AcpiOsPrintf ("Breakpoint set at AML offset %X\n", Address);
795 /*******************************************************************************
797 * FUNCTION: AcpiDbSetMethodCallBreakpoint
799 * PARAMETERS: Op - Current Op (from parse walk)
803 * DESCRIPTION: Set a breakpoint in a control method at the specified
806 ******************************************************************************/
809 AcpiDbSetMethodCallBreakpoint (
810 ACPI_PARSE_OBJECT *Op)
816 AcpiOsPrintf ("There is no method currently executing\n");
820 AcpiGbl_StepToNextCall = TRUE;
824 /*******************************************************************************
826 * FUNCTION: AcpiDbDisassembleAml
828 * PARAMETERS: Statements - Number of statements to disassemble
829 * Op - Current Op (from parse walk)
833 * DESCRIPTION: Display disassembled AML (ASL) starting from Op for the number
834 * of statements specified.
836 ******************************************************************************/
839 AcpiDbDisassembleAml (
841 ACPI_PARSE_OBJECT *Op)
843 UINT32 NumStatements = 8;
848 AcpiOsPrintf ("There is no method currently executing\n");
854 NumStatements = ACPI_STRTOUL (Statements, NULL, 0);
857 #ifdef ACPI_DISASSEMBLER
858 AcpiDmDisassemble (NULL, Op, NumStatements);
863 /*******************************************************************************
865 * FUNCTION: AcpiDbDisassembleMethod
867 * PARAMETERS: Name - Name of control method
871 * DESCRIPTION: Display disassembled AML (ASL) starting from Op for the number
872 * of statements specified.
874 ******************************************************************************/
877 AcpiDbDisassembleMethod (
881 ACPI_PARSE_OBJECT *Op;
882 ACPI_WALK_STATE *WalkState;
883 ACPI_OPERAND_OBJECT *ObjDesc;
884 ACPI_NAMESPACE_NODE *Method;
887 Method = AcpiDbConvertToNode (Name);
890 return (AE_BAD_PARAMETER);
893 ObjDesc = Method->Object;
895 Op = AcpiPsCreateScopeOp ();
898 return (AE_NO_MEMORY);
901 /* Create and initialize a new walk state */
903 WalkState = AcpiDsCreateWalkState (0, Op, NULL, NULL);
906 return (AE_NO_MEMORY);
909 Status = AcpiDsInitAmlWalk (WalkState, Op, NULL,
910 ObjDesc->Method.AmlStart,
911 ObjDesc->Method.AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
912 if (ACPI_FAILURE (Status))
919 WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE;
920 WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE;
921 Status = AcpiPsParseAml (WalkState);
923 #ifdef ACPI_DISASSEMBLER
924 AcpiDmDisassemble (NULL, Op, 0);
926 AcpiPsDeleteParseTree (Op);
931 /*******************************************************************************
933 * FUNCTION: AcpiDbDumpNamespace
935 * PARAMETERS: StartArg - Node to begin namespace dump
936 * DepthArg - Maximum tree depth to be dumped
940 * DESCRIPTION: Dump entire namespace or a subtree. Each node is displayed
941 * with type and other information.
943 ******************************************************************************/
946 AcpiDbDumpNamespace (
950 ACPI_HANDLE SubtreeEntry = AcpiGbl_RootNode;
951 UINT32 MaxDepth = ACPI_UINT32_MAX;
954 /* No argument given, just start at the root and dump entire namespace */
958 SubtreeEntry = AcpiDbConvertToNode (StartArg);
964 /* Now we can check for the depth argument */
968 MaxDepth = ACPI_STRTOUL (DepthArg, NULL, 0);
972 AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
973 AcpiOsPrintf ("ACPI Namespace (from %4.4s (%p) subtree):\n",
974 ((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Name.Ascii, SubtreeEntry);
976 /* Display the subtree */
978 AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
979 AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth,
980 ACPI_OWNER_ID_MAX, SubtreeEntry);
981 AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
985 /*******************************************************************************
987 * FUNCTION: AcpiDbDumpNamespaceByOwner
989 * PARAMETERS: OwnerArg - Owner ID whose nodes will be displayed
990 * DepthArg - Maximum tree depth to be dumped
994 * DESCRIPTION: Dump elements of the namespace that are owned by the OwnerId.
996 ******************************************************************************/
999 AcpiDbDumpNamespaceByOwner (
1003 ACPI_HANDLE SubtreeEntry = AcpiGbl_RootNode;
1004 UINT32 MaxDepth = ACPI_UINT32_MAX;
1005 ACPI_OWNER_ID OwnerId;
1008 OwnerId = (ACPI_OWNER_ID) ACPI_STRTOUL (OwnerArg, NULL, 0);
1010 /* Now we can check for the depth argument */
1014 MaxDepth = ACPI_STRTOUL (DepthArg, NULL, 0);
1017 AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
1018 AcpiOsPrintf ("ACPI Namespace by owner %X:\n", OwnerId);
1020 /* Display the subtree */
1022 AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
1023 AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth, OwnerId,
1025 AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
1029 /*******************************************************************************
1031 * FUNCTION: AcpiDbSendNotify
1033 * PARAMETERS: Name - Name of ACPI object to send the notify to
1034 * Value - Value of the notify to send.
1038 * DESCRIPTION: Send an ACPI notification. The value specified is sent to the
1039 * named object as an ACPI notify.
1041 ******************************************************************************/
1048 ACPI_NAMESPACE_NODE *Node;
1052 /* Translate name to an Named object */
1054 Node = AcpiDbConvertToNode (Name);
1060 /* Decode Named object type */
1064 case ACPI_TYPE_DEVICE:
1065 case ACPI_TYPE_THERMAL:
1067 /* Send the notify */
1069 Status = AcpiEvQueueNotifyRequest (Node, Value);
1070 if (ACPI_FAILURE (Status))
1072 AcpiOsPrintf ("Could not queue notify\n");
1077 AcpiOsPrintf ("Named object is not a device or a thermal object\n");
1083 /*******************************************************************************
1085 * FUNCTION: AcpiDbSetMethodData
1087 * PARAMETERS: TypeArg - L for local, A for argument
1088 * IndexArg - which one
1089 * ValueArg - Value to set.
1093 * DESCRIPTION: Set a local or argument for the running control method.
1094 * NOTE: only object supported is Number.
1096 ******************************************************************************/
1099 AcpiDbSetMethodData (
1107 ACPI_WALK_STATE *WalkState;
1108 ACPI_OPERAND_OBJECT *ObjDesc;
1110 ACPI_NAMESPACE_NODE *Node;
1113 /* Validate TypeArg */
1115 AcpiUtStrupr (TypeArg);
1117 if ((Type != 'L') &&
1121 AcpiOsPrintf ("Invalid SET operand: %s\n", TypeArg);
1125 Value = ACPI_STRTOUL (ValueArg, NULL, 16);
1129 Node = AcpiDbConvertToNode (IndexArg);
1130 if (Node->Type != ACPI_TYPE_INTEGER)
1132 AcpiOsPrintf ("Can only set Integer nodes\n");
1135 ObjDesc = Node->Object;
1136 ObjDesc->Integer.Value = Value;
1140 /* Get the index and value */
1142 Index = ACPI_STRTOUL (IndexArg, NULL, 16);
1144 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
1147 AcpiOsPrintf ("There is no method currently executing\n");
1151 /* Create and initialize the new object */
1153 ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
1156 AcpiOsPrintf ("Could not create an internal object\n");
1160 ObjDesc->Integer.Value = Value;
1162 /* Store the new object into the target */
1168 /* Set a method argument */
1170 if (Index > ACPI_METHOD_MAX_ARG)
1172 AcpiOsPrintf ("Arg%d - Invalid argument name\n", Index);
1176 Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_ARG, Index, ObjDesc,
1178 if (ACPI_FAILURE (Status))
1183 ObjDesc = WalkState->Arguments[Index].Object;
1185 AcpiOsPrintf ("Arg%d: ", Index);
1186 AcpiDmDisplayInternalObject (ObjDesc, WalkState);
1191 /* Set a method local */
1193 if (Index > ACPI_METHOD_MAX_LOCAL)
1195 AcpiOsPrintf ("Local%d - Invalid local variable name\n", Index);
1199 Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_LOCAL, Index, ObjDesc,
1201 if (ACPI_FAILURE (Status))
1206 ObjDesc = WalkState->LocalVariables[Index].Object;
1208 AcpiOsPrintf ("Local%d: ", Index);
1209 AcpiDmDisplayInternalObject (ObjDesc, WalkState);
1217 AcpiUtRemoveReference (ObjDesc);
1221 /*******************************************************************************
1223 * FUNCTION: AcpiDbWalkForSpecificObjects
1225 * PARAMETERS: Callback from WalkNamespace
1229 * DESCRIPTION: Display short info about objects in the namespace
1231 ******************************************************************************/
1234 AcpiDbWalkForSpecificObjects (
1235 ACPI_HANDLE ObjHandle,
1236 UINT32 NestingLevel,
1240 ACPI_WALK_INFO *Info = (ACPI_WALK_INFO *) Context;
1247 /* Get and display the full pathname to this object */
1249 Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
1250 Status = AcpiNsHandleToPathname (ObjHandle, &Buffer);
1251 if (ACPI_FAILURE (Status))
1253 AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
1257 AcpiOsPrintf ("%32s", (char *) Buffer.Pointer);
1258 ACPI_FREE (Buffer.Pointer);
1260 /* Dump short info about the object */
1262 (void) AcpiNsDumpOneObject (ObjHandle, NestingLevel, Info, NULL);
1267 /*******************************************************************************
1269 * FUNCTION: AcpiDbDisplayObjects
1271 * PARAMETERS: ObjTypeArg - Type of object to display
1272 * DisplayCountArg - Max depth to display
1276 * DESCRIPTION: Display objects in the namespace of the requested type
1278 ******************************************************************************/
1281 AcpiDbDisplayObjects (
1283 char *DisplayCountArg)
1285 ACPI_WALK_INFO Info;
1286 ACPI_OBJECT_TYPE Type;
1289 /* Get the object type */
1291 Type = AcpiDbMatchArgument (ObjTypeArg, AcpiDbObjectTypes);
1292 if (Type == ACPI_TYPE_NOT_FOUND)
1294 AcpiOsPrintf ("Invalid or unsupported argument\n");
1298 AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
1300 "Objects of type [%s] defined in the current ACPI Namespace:\n",
1301 AcpiUtGetTypeName (Type));
1303 AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
1306 Info.OwnerId = ACPI_OWNER_ID_MAX;
1307 Info.DebugLevel = ACPI_UINT32_MAX;
1308 Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
1310 /* Walk the namespace from the root */
1312 (void) AcpiWalkNamespace (Type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
1313 AcpiDbWalkForSpecificObjects, (void *) &Info, NULL);
1316 "\nFound %u objects of type [%s] in the current ACPI Namespace\n",
1317 Info.Count, AcpiUtGetTypeName (Type));
1319 AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
1324 /*******************************************************************************
1326 * FUNCTION: AcpiDbWalkAndMatchName
1328 * PARAMETERS: Callback from WalkNamespace
1332 * DESCRIPTION: Find a particular name/names within the namespace. Wildcards
1333 * are supported -- '?' matches any character.
1335 ******************************************************************************/
1338 AcpiDbWalkAndMatchName (
1339 ACPI_HANDLE ObjHandle,
1340 UINT32 NestingLevel,
1345 char *RequestedName = (char *) Context;
1348 ACPI_WALK_INFO Info;
1351 /* Check for a name match */
1353 for (i = 0; i < 4; i++)
1355 /* Wildcard support */
1357 if ((RequestedName[i] != '?') &&
1358 (RequestedName[i] != ((ACPI_NAMESPACE_NODE *) ObjHandle)->Name.Ascii[i]))
1360 /* No match, just exit */
1366 /* Get the full pathname to this object */
1368 Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
1369 Status = AcpiNsHandleToPathname (ObjHandle, &Buffer);
1370 if (ACPI_FAILURE (Status))
1372 AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
1376 Info.OwnerId = ACPI_OWNER_ID_MAX;
1377 Info.DebugLevel = ACPI_UINT32_MAX;
1378 Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
1380 AcpiOsPrintf ("%32s", (char *) Buffer.Pointer);
1381 (void) AcpiNsDumpOneObject (ObjHandle, NestingLevel, &Info, NULL);
1382 ACPI_FREE (Buffer.Pointer);
1389 /*******************************************************************************
1391 * FUNCTION: AcpiDbFindNameInNamespace
1393 * PARAMETERS: NameArg - The 4-character ACPI name to find.
1394 * wildcards are supported.
1398 * DESCRIPTION: Search the namespace for a given name (with wildcards)
1400 ******************************************************************************/
1403 AcpiDbFindNameInNamespace (
1406 char AcpiName[5] = "____";
1407 char *AcpiNamePtr = AcpiName;
1410 if (ACPI_STRLEN (NameArg) > 4)
1412 AcpiOsPrintf ("Name must be no longer than 4 characters\n");
1416 /* Pad out name with underscores as necessary to create a 4-char name */
1418 AcpiUtStrupr (NameArg);
1421 *AcpiNamePtr = *NameArg;
1426 /* Walk the namespace from the root */
1428 (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
1429 AcpiDbWalkAndMatchName, AcpiName, NULL);
1431 AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
1436 /*******************************************************************************
1438 * FUNCTION: AcpiDbSetScope
1440 * PARAMETERS: Name - New scope path
1444 * DESCRIPTION: Set the "current scope" as maintained by this utility.
1445 * The scope is used as a prefix to ACPI paths.
1447 ******************************************************************************/
1454 ACPI_NAMESPACE_NODE *Node;
1457 if (!Name || Name[0] == 0)
1459 AcpiOsPrintf ("Current scope: %s\n", AcpiGbl_DbScopeBuf);
1463 AcpiDbPrepNamestring (Name);
1465 if (Name[0] == '\\')
1467 /* Validate new scope from the root */
1469 Status = AcpiNsGetNode (AcpiGbl_RootNode, Name, ACPI_NS_NO_UPSEARCH,
1471 if (ACPI_FAILURE (Status))
1476 ACPI_STRCPY (AcpiGbl_DbScopeBuf, Name);
1477 ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
1481 /* Validate new scope relative to old scope */
1483 Status = AcpiNsGetNode (AcpiGbl_DbScopeNode, Name, ACPI_NS_NO_UPSEARCH,
1485 if (ACPI_FAILURE (Status))
1490 ACPI_STRCAT (AcpiGbl_DbScopeBuf, Name);
1491 ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
1494 AcpiGbl_DbScopeNode = Node;
1495 AcpiOsPrintf ("New scope: %s\n", AcpiGbl_DbScopeBuf);
1500 AcpiOsPrintf ("Could not attach scope: %s, %s\n",
1501 Name, AcpiFormatException (Status));
1505 /*******************************************************************************
1507 * FUNCTION: AcpiDmCompareAmlResources
1509 * PARAMETERS: Aml1Buffer - Contains first resource list
1510 * Aml1BufferLength - Length of first resource list
1511 * Aml2Buffer - Contains second resource list
1512 * Aml2BufferLength - Length of second resource list
1516 * DESCRIPTION: Compare two AML resource lists, descriptor by descriptor (in
1517 * order to isolate a miscompare to an individual resource)
1519 ******************************************************************************/
1522 AcpiDmCompareAmlResources (
1524 ACPI_RSDESC_SIZE Aml1BufferLength,
1526 ACPI_RSDESC_SIZE Aml2BufferLength)
1530 ACPI_RSDESC_SIZE Aml1Length;
1531 ACPI_RSDESC_SIZE Aml2Length;
1532 ACPI_RSDESC_SIZE Offset = 0;
1537 /* Compare overall buffer sizes (may be different due to size rounding) */
1539 if (Aml1BufferLength != Aml2BufferLength)
1542 "**** Buffer length mismatch in converted AML: original %X new %X ****\n",
1543 Aml1BufferLength, Aml2BufferLength);
1549 /* Walk the descriptor lists, comparing each descriptor */
1551 while (Aml1 < (Aml1Buffer + Aml1BufferLength))
1553 /* Get the lengths of each descriptor */
1555 Aml1Length = AcpiUtGetDescriptorLength (Aml1);
1556 Aml2Length = AcpiUtGetDescriptorLength (Aml2);
1557 ResourceType = AcpiUtGetResourceType (Aml1);
1559 /* Check for descriptor length match */
1561 if (Aml1Length != Aml2Length)
1564 "**** Length mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X L1 %X L2 %X ****\n",
1565 Count, ResourceType, Offset, Aml1Length, Aml2Length);
1568 /* Check for descriptor byte match */
1570 else if (ACPI_MEMCMP (Aml1, Aml2, Aml1Length))
1573 "**** Data mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X ****\n",
1574 Count, ResourceType, Offset);
1577 /* Exit on EndTag descriptor */
1579 if (ResourceType == ACPI_RESOURCE_NAME_END_TAG)
1584 /* Point to next descriptor in each buffer */
1587 Offset += Aml1Length;
1594 /*******************************************************************************
1596 * FUNCTION: AcpiDmTestResourceConversion
1598 * PARAMETERS: Node - Parent device node
1599 * Name - resource method name (_CRS)
1603 * DESCRIPTION: Compare the original AML with a conversion of the AML to
1604 * internal resource list, then back to AML.
1606 ******************************************************************************/
1609 AcpiDmTestResourceConversion (
1610 ACPI_NAMESPACE_NODE *Node,
1614 ACPI_BUFFER ReturnObj;
1615 ACPI_BUFFER ResourceObj;
1617 ACPI_OBJECT *OriginalAml;
1620 AcpiOsPrintf ("Resource Conversion Comparison:\n");
1622 NewAml.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
1623 ReturnObj.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
1624 ResourceObj.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
1626 /* Get the original _CRS AML resource template */
1628 Status = AcpiEvaluateObject (Node, Name, NULL, &ReturnObj);
1629 if (ACPI_FAILURE (Status))
1631 AcpiOsPrintf ("Could not obtain %s: %s\n",
1632 Name, AcpiFormatException (Status));
1636 /* Get the AML resource template, converted to internal resource structs */
1638 Status = AcpiGetCurrentResources (Node, &ResourceObj);
1639 if (ACPI_FAILURE (Status))
1641 AcpiOsPrintf ("AcpiGetCurrentResources failed: %s\n",
1642 AcpiFormatException (Status));
1646 /* Convert internal resource list to external AML resource template */
1648 Status = AcpiRsCreateAmlResources (ResourceObj.Pointer, &NewAml);
1649 if (ACPI_FAILURE (Status))
1651 AcpiOsPrintf ("AcpiRsCreateAmlResources failed: %s\n",
1652 AcpiFormatException (Status));
1656 /* Compare original AML to the newly created AML resource list */
1658 OriginalAml = ReturnObj.Pointer;
1660 AcpiDmCompareAmlResources (
1661 OriginalAml->Buffer.Pointer, (ACPI_RSDESC_SIZE) OriginalAml->Buffer.Length,
1662 NewAml.Pointer, (ACPI_RSDESC_SIZE) NewAml.Length);
1664 /* Cleanup and exit */
1666 ACPI_FREE (NewAml.Pointer);
1668 ACPI_FREE (ResourceObj.Pointer);
1670 ACPI_FREE (ReturnObj.Pointer);
1675 /*******************************************************************************
1677 * FUNCTION: AcpiDbDisplayResources
1679 * PARAMETERS: ObjectArg - String with hex value of the object
1683 * DESCRIPTION: Display the resource objects associated with a device.
1685 ******************************************************************************/
1688 AcpiDbDisplayResources (
1691 ACPI_NAMESPACE_NODE *Node;
1693 ACPI_BUFFER ReturnObj;
1696 AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
1697 AcpiDbgLevel |= ACPI_LV_RESOURCES;
1699 /* Convert string to object pointer */
1701 Node = AcpiDbConvertToNode (ObjectArg);
1707 /* Prepare for a return object of arbitrary size */
1709 ReturnObj.Pointer = AcpiGbl_DbBuffer;
1710 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
1714 AcpiOsPrintf ("Evaluating _PRT\n");
1716 /* Check if _PRT exists */
1718 Status = AcpiEvaluateObject (Node, METHOD_NAME__PRT, NULL, &ReturnObj);
1719 if (ACPI_FAILURE (Status))
1721 AcpiOsPrintf ("Could not obtain _PRT: %s\n",
1722 AcpiFormatException (Status));
1726 ReturnObj.Pointer = AcpiGbl_DbBuffer;
1727 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
1729 Status = AcpiGetIrqRoutingTable (Node, &ReturnObj);
1730 if (ACPI_FAILURE (Status))
1732 AcpiOsPrintf ("GetIrqRoutingTable failed: %s\n",
1733 AcpiFormatException (Status));
1737 AcpiRsDumpIrqList (ACPI_CAST_PTR (UINT8, AcpiGbl_DbBuffer));
1743 AcpiOsPrintf ("Evaluating _CRS\n");
1745 ReturnObj.Pointer = AcpiGbl_DbBuffer;
1746 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
1748 /* Check if _CRS exists */
1750 Status = AcpiEvaluateObject (Node, METHOD_NAME__CRS, NULL, &ReturnObj);
1751 if (ACPI_FAILURE (Status))
1753 AcpiOsPrintf ("Could not obtain _CRS: %s\n",
1754 AcpiFormatException (Status));
1758 /* Get the _CRS resource list */
1760 ReturnObj.Pointer = AcpiGbl_DbBuffer;
1761 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
1763 Status = AcpiGetCurrentResources (Node, &ReturnObj);
1764 if (ACPI_FAILURE (Status))
1766 AcpiOsPrintf ("AcpiGetCurrentResources failed: %s\n",
1767 AcpiFormatException (Status));
1771 /* Dump the _CRS resource list */
1773 AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE,
1774 ReturnObj.Pointer));
1777 * Perform comparison of original AML to newly created AML. This tests both
1778 * the AML->Resource conversion and the Resource->Aml conversion.
1780 Status = AcpiDmTestResourceConversion (Node, METHOD_NAME__CRS);
1782 /* Execute _SRS with the resource list */
1784 Status = AcpiSetCurrentResources (Node, &ReturnObj);
1785 if (ACPI_FAILURE (Status))
1787 AcpiOsPrintf ("AcpiSetCurrentResources failed: %s\n",
1788 AcpiFormatException (Status));
1796 AcpiOsPrintf ("Evaluating _PRS\n");
1798 ReturnObj.Pointer = AcpiGbl_DbBuffer;
1799 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
1801 /* Check if _PRS exists */
1803 Status = AcpiEvaluateObject (Node, METHOD_NAME__PRS, NULL, &ReturnObj);
1804 if (ACPI_FAILURE (Status))
1806 AcpiOsPrintf ("Could not obtain _PRS: %s\n",
1807 AcpiFormatException (Status));
1811 ReturnObj.Pointer = AcpiGbl_DbBuffer;
1812 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
1814 Status = AcpiGetPossibleResources (Node, &ReturnObj);
1815 if (ACPI_FAILURE (Status))
1817 AcpiOsPrintf ("AcpiGetPossibleResources failed: %s\n",
1818 AcpiFormatException (Status));
1822 AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer));
1826 AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
1831 /*******************************************************************************
1833 * FUNCTION: AcpiDbIntegrityWalk
1835 * PARAMETERS: Callback from WalkNamespace
1839 * DESCRIPTION: Examine one NS node for valid values.
1841 ******************************************************************************/
1844 AcpiDbIntegrityWalk (
1845 ACPI_HANDLE ObjHandle,
1846 UINT32 NestingLevel,
1850 ACPI_INTEGRITY_INFO *Info = (ACPI_INTEGRITY_INFO *) Context;
1851 ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
1852 ACPI_OPERAND_OBJECT *Object;
1853 BOOLEAN Alias = TRUE;
1858 /* Verify the NS node, and dereference aliases */
1862 if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
1864 AcpiOsPrintf ("Invalid Descriptor Type for Node %p [%s] - is %2.2X should be %2.2X\n",
1865 Node, AcpiUtGetDescriptorName (Node), ACPI_GET_DESCRIPTOR_TYPE (Node),
1866 ACPI_DESC_TYPE_NAMED);
1870 if ((Node->Type == ACPI_TYPE_LOCAL_ALIAS) ||
1871 (Node->Type == ACPI_TYPE_LOCAL_METHOD_ALIAS))
1873 Node = (ACPI_NAMESPACE_NODE *) Node->Object;
1881 if (Node->Type > ACPI_TYPE_LOCAL_MAX)
1883 AcpiOsPrintf ("Invalid Object Type for Node %p, Type = %X\n",
1888 if (!AcpiUtValidAcpiName (Node->Name.Integer))
1890 AcpiOsPrintf ("Invalid AcpiName for Node %p\n", Node);
1894 Object = AcpiNsGetAttachedObject (Node);
1898 if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND)
1900 AcpiOsPrintf ("Invalid Descriptor Type for Object %p [%s]\n",
1901 Object, AcpiUtGetDescriptorName (Object));
1909 /*******************************************************************************
1911 * FUNCTION: AcpiDbCheckIntegrity
1917 * DESCRIPTION: Check entire namespace for data structure integrity
1919 ******************************************************************************/
1922 AcpiDbCheckIntegrity (
1925 ACPI_INTEGRITY_INFO Info = {0,0};
1927 /* Search all nodes in namespace */
1929 (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
1930 AcpiDbIntegrityWalk, (void *) &Info, NULL);
1932 AcpiOsPrintf ("Verified %d namespace nodes with %d Objects\n",
1933 Info.Nodes, Info.Objects);
1937 /*******************************************************************************
1939 * FUNCTION: AcpiDbGenerateGpe
1941 * PARAMETERS: GpeArg - Raw GPE number, ascii string
1942 * BlockArg - GPE block number, ascii string
1943 * 0 or 1 for FADT GPE blocks
1947 * DESCRIPTION: Generate a GPE
1949 ******************************************************************************/
1958 ACPI_GPE_EVENT_INFO *GpeEventInfo;
1961 GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0);
1962 BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0);
1965 GpeEventInfo = AcpiEvGetGpeEventInfo (ACPI_TO_POINTER (BlockNumber),
1969 AcpiOsPrintf ("Invalid GPE\n");
1973 (void) AcpiEvGpeDispatch (GpeEventInfo, GpeNumber);
1977 /*******************************************************************************
1979 * FUNCTION: AcpiDbBusWalk
1981 * PARAMETERS: Callback from WalkNamespace
1985 * DESCRIPTION: Display info about device objects that have a corresponding
1988 ******************************************************************************/
1992 ACPI_HANDLE ObjHandle,
1993 UINT32 NestingLevel,
1997 ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
2002 ACPI_COMPATIBLE_ID_LIST *Cid;
2003 ACPI_NAMESPACE_NODE *TempNode;
2006 /* Exit if there is no _PRT under this device */
2008 Status = AcpiGetHandle (Node, METHOD_NAME__PRT,
2009 ACPI_CAST_PTR (ACPI_HANDLE, &TempNode));
2010 if (ACPI_FAILURE (Status))
2015 /* Get the full path to this device object */
2017 Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
2018 Status = AcpiNsHandleToPathname (ObjHandle, &Buffer);
2019 if (ACPI_FAILURE (Status))
2021 AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
2025 /* Display the full path */
2027 AcpiOsPrintf ("%-32s", (char *) Buffer.Pointer);
2028 ACPI_FREE (Buffer.Pointer);
2032 AcpiOsPrintf ("_PRT=%p", TempNode);
2034 /* Get the _ADR value */
2036 Status = AcpiUtEvaluateNumericObject (METHOD_NAME__ADR, Node, &ADR);
2037 if (ACPI_FAILURE (Status))
2039 AcpiOsPrintf (" No _ADR ");
2043 AcpiOsPrintf (" _ADR=%8.8X", (UINT32) ADR);
2046 /* Get the _HID if present */
2048 Status = AcpiUtExecute_HID (Node, &Id);
2049 if (ACPI_SUCCESS (Status))
2051 AcpiOsPrintf (" _HID=%s", Id.Value);
2058 /* Get the _UID if present */
2060 Status = AcpiUtExecute_UID (Node, &Id);
2061 if (ACPI_SUCCESS (Status))
2063 AcpiOsPrintf (" _UID=%s", Id.Value);
2066 /* Get the _CID if present */
2068 Status = AcpiUtExecute_CID (Node, &Cid);
2069 if (ACPI_SUCCESS (Status))
2071 AcpiOsPrintf (" _CID=%s", Cid->Id[0].Value);
2075 AcpiOsPrintf ("\n");
2080 /*******************************************************************************
2082 * FUNCTION: AcpiDbGetBusInfo
2088 * DESCRIPTION: Display info about system busses.
2090 ******************************************************************************/
2096 /* Search all nodes in namespace */
2098 (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
2099 AcpiDbBusWalk, NULL, NULL);
2102 #endif /* ACPI_DEBUGGER */