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 *****************************************************************************/
118 #include "accommon.h"
119 #include "acdispat.h"
120 #include "acnamesp.h"
121 #include "acevents.h"
124 #include "acdisasm.h"
125 #include "actables.h"
126 #include "acparser.h"
130 #define _COMPONENT ACPI_CA_DEBUGGER
131 ACPI_MODULE_NAME ("dbcmds")
134 /* Local prototypes */
137 AcpiDbIntegrityWalk (
138 ACPI_HANDLE ObjHandle,
144 AcpiDbWalkAndMatchName (
145 ACPI_HANDLE ObjHandle,
151 AcpiDbWalkForReferences (
152 ACPI_HANDLE ObjHandle,
158 AcpiDbWalkForSpecificObjects (
159 ACPI_HANDLE ObjHandle,
164 static ACPI_NAMESPACE_NODE *
165 AcpiDbConvertToNode (
169 AcpiDmCompareAmlResources (
171 ACPI_RSDESC_SIZE Aml1BufferLength,
173 ACPI_RSDESC_SIZE Aml2BufferLength);
176 AcpiDmTestResourceConversion (
177 ACPI_NAMESPACE_NODE *Node,
182 * Arguments for the Objects command
183 * These object types map directly to the ACPI_TYPES
185 static ARGUMENT_INFO AcpiDbObjectTypes [] =
209 {NULL} /* Must be null terminated */
213 /*******************************************************************************
215 * FUNCTION: AcpiDbConvertToNode
217 * PARAMETERS: InString - String to convert
219 * RETURN: Pointer to a NS node
221 * DESCRIPTION: Convert a string to a valid NS pointer. Handles numeric or
224 ******************************************************************************/
226 static ACPI_NAMESPACE_NODE *
227 AcpiDbConvertToNode (
230 ACPI_NAMESPACE_NODE *Node;
233 if ((*InString >= 0x30) && (*InString <= 0x39))
235 /* Numeric argument, convert */
237 Node = ACPI_TO_POINTER (ACPI_STRTOUL (InString, NULL, 16));
238 if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
240 AcpiOsPrintf ("Address %p is invalid in this address space\n",
245 /* Make sure pointer is valid NS node */
247 if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
249 AcpiOsPrintf ("Address %p is not a valid NS node [%s]\n",
250 Node, AcpiUtGetDescriptorName (Node));
257 /* The parameter is a name string that must be resolved to a
260 Node = AcpiDbLocalNsLookup (InString);
263 Node = AcpiGbl_RootNode;
271 /*******************************************************************************
273 * FUNCTION: AcpiDbSleep
275 * PARAMETERS: ObjectArg - Desired sleep state (0-5)
279 * DESCRIPTION: Simulate a sleep/wake sequence
281 ******************************************************************************/
291 SleepState = (UINT8) ACPI_STRTOUL (ObjectArg, NULL, 0);
293 AcpiOsPrintf ("**** Prepare to sleep ****\n");
294 Status = AcpiEnterSleepStatePrep (SleepState);
295 if (ACPI_FAILURE (Status))
300 AcpiOsPrintf ("**** Going to sleep ****\n");
301 Status = AcpiEnterSleepState (SleepState);
302 if (ACPI_FAILURE (Status))
307 AcpiOsPrintf ("**** returning from sleep ****\n");
308 Status = AcpiLeaveSleepState (SleepState);
314 /*******************************************************************************
316 * FUNCTION: AcpiDbWalkForReferences
318 * PARAMETERS: Callback from WalkNamespace
322 * DESCRIPTION: Check if this namespace object refers to the target object
323 * that is passed in as the context value.
325 * Note: Currently doesn't check subobjects within the Node's object
327 ******************************************************************************/
330 AcpiDbWalkForReferences (
331 ACPI_HANDLE ObjHandle,
336 ACPI_OPERAND_OBJECT *ObjDesc = (ACPI_OPERAND_OBJECT *) Context;
337 ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
340 /* Check for match against the namespace node itself */
342 if (Node == (void *) ObjDesc)
344 AcpiOsPrintf ("Object is a Node [%4.4s]\n",
345 AcpiUtGetNodeName (Node));
348 /* Check for match against the object attached to the node */
350 if (AcpiNsGetAttachedObject (Node) == ObjDesc)
352 AcpiOsPrintf ("Reference at Node->Object %p [%4.4s]\n",
353 Node, AcpiUtGetNodeName (Node));
360 /*******************************************************************************
362 * FUNCTION: AcpiDbFindReferences
364 * PARAMETERS: ObjectArg - String with hex value of the object
368 * DESCRIPTION: Search namespace for all references to the input object
370 ******************************************************************************/
373 AcpiDbFindReferences (
376 ACPI_OPERAND_OBJECT *ObjDesc;
379 /* Convert string to object pointer */
381 ObjDesc = ACPI_TO_POINTER (ACPI_STRTOUL (ObjectArg, NULL, 16));
383 /* Search all nodes in namespace */
385 (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
386 AcpiDbWalkForReferences, NULL, (void *) ObjDesc, NULL);
390 /*******************************************************************************
392 * FUNCTION: AcpiDbWalkForPredefinedNames
394 * PARAMETERS: Callback from WalkNamespace
398 * DESCRIPTION: Detect and display predefined ACPI names (names that start with
401 ******************************************************************************/
404 AcpiDbWalkForPredefinedNames (
405 ACPI_HANDLE ObjHandle,
410 ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
411 UINT32 *Count = (UINT32 *) Context;
412 const ACPI_PREDEFINED_INFO *Predefined;
413 const ACPI_PREDEFINED_INFO *Package = NULL;
417 Predefined = AcpiNsCheckForPredefinedName (Node);
423 Pathname = AcpiNsGetExternalPathname (Node);
429 /* If method returns a package, the info is in the next table entry */
431 if (Predefined->Info.ExpectedBtypes & ACPI_BTYPE_PACKAGE)
433 Package = Predefined + 1;
436 AcpiOsPrintf ("%-32s arg %X ret %2.2X", Pathname,
437 Predefined->Info.ParamCount, Predefined->Info.ExpectedBtypes);
441 AcpiOsPrintf (" PkgType %2.2X ObjType %2.2X Count %2.2X",
442 Package->RetInfo.Type, Package->RetInfo.ObjectType1,
443 Package->RetInfo.Count1);
448 AcpiNsCheckParameterCount (Pathname, Node, ACPI_UINT32_MAX, Predefined);
449 ACPI_FREE (Pathname);
456 /*******************************************************************************
458 * FUNCTION: AcpiDbCheckPredefinedNames
464 * DESCRIPTION: Validate all predefined names in the namespace
466 ******************************************************************************/
469 AcpiDbCheckPredefinedNames (
475 /* Search all nodes in namespace */
477 (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
478 AcpiDbWalkForPredefinedNames, NULL, (void *) &Count, NULL);
480 AcpiOsPrintf ("Found %d predefined names in the namespace\n", Count);
484 /*******************************************************************************
486 * FUNCTION: AcpiDbWalkForExecute
488 * PARAMETERS: Callback from WalkNamespace
492 * DESCRIPTION: Batch execution module. Currently only executes predefined
495 ******************************************************************************/
498 AcpiDbWalkForExecute (
499 ACPI_HANDLE ObjHandle,
504 ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
505 ACPI_EXECUTE_WALK *Info = (ACPI_EXECUTE_WALK *) Context;
506 ACPI_BUFFER ReturnObj;
510 ACPI_DEVICE_INFO *ObjInfo;
511 ACPI_OBJECT_LIST ParamObjects;
512 ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS];
513 const ACPI_PREDEFINED_INFO *Predefined;
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 Status = AcpiGetObjectInfo (ObjHandle, &ObjInfo);
536 if (ACPI_FAILURE (Status))
541 ParamObjects.Pointer = NULL;
542 ParamObjects.Count = 0;
544 if (ObjInfo->Type == ACPI_TYPE_METHOD)
546 /* Setup default parameters */
548 for (i = 0; i < ObjInfo->ParamCount; i++)
550 Params[i].Type = ACPI_TYPE_INTEGER;
551 Params[i].Integer.Value = 1;
554 ParamObjects.Pointer = Params;
555 ParamObjects.Count = ObjInfo->ParamCount;
559 ReturnObj.Pointer = NULL;
560 ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
562 /* Do the actual method execution */
564 AcpiGbl_MethodExecuting = TRUE;
566 Status = AcpiEvaluateObject (Node, NULL, &ParamObjects, &ReturnObj);
568 AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status));
569 AcpiGbl_MethodExecuting = FALSE;
570 ACPI_FREE (Pathname);
572 /* Ignore status from method execution */
576 /* Update count, check if we have executed enough methods */
579 if (Info->Count >= Info->MaxCount)
581 Status = AE_CTRL_TERMINATE;
588 /*******************************************************************************
590 * FUNCTION: AcpiDbBatchExecute
592 * PARAMETERS: CountArg - Max number of methods to execute
596 * DESCRIPTION: Namespace batch execution. Execute predefined names in the
597 * namespace, up to the max count, if specified.
599 ******************************************************************************/
605 ACPI_EXECUTE_WALK Info;
609 Info.MaxCount = ACPI_UINT32_MAX;
613 Info.MaxCount = ACPI_STRTOUL (CountArg, NULL, 0);
617 /* Search all nodes in namespace */
619 (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
620 AcpiDbWalkForExecute, NULL, (void *) &Info, NULL);
622 AcpiOsPrintf ("Executed %d predefined names in the namespace\n", Info.Count);
626 /*******************************************************************************
628 * FUNCTION: AcpiDbDisplayLocks
634 * DESCRIPTION: Display information about internal mutexes.
636 ******************************************************************************/
645 for (i = 0; i < ACPI_MAX_MUTEX; i++)
647 AcpiOsPrintf ("%26s : %s\n", AcpiUtGetMutexName (i),
648 AcpiGbl_MutexInfo[i].ThreadId == ACPI_MUTEX_NOT_ACQUIRED
649 ? "Locked" : "Unlocked");
654 /*******************************************************************************
656 * FUNCTION: AcpiDbDisplayTableInfo
658 * PARAMETERS: TableArg - String with name of table to be displayed
662 * DESCRIPTION: Display information about loaded tables. Current
663 * implementation displays all loaded tables.
665 ******************************************************************************/
668 AcpiDbDisplayTableInfo (
672 ACPI_TABLE_DESC *TableDesc;
676 /* Walk the entire root table list */
678 for (i = 0; i < AcpiGbl_RootTableList.Count; i++)
680 TableDesc = &AcpiGbl_RootTableList.Tables[i];
681 AcpiOsPrintf ("%d ", i);
683 /* Make sure that the table is mapped */
685 Status = AcpiTbVerifyTable (TableDesc);
686 if (ACPI_FAILURE (Status))
691 /* Dump the table header */
693 if (TableDesc->Pointer)
695 AcpiTbPrintTableHeader (TableDesc->Address, TableDesc->Pointer);
699 /* If the pointer is null, the table has been unloaded */
701 ACPI_INFO ((AE_INFO, "%4.4s - Table has been unloaded",
702 TableDesc->Signature.Ascii));
708 /*******************************************************************************
710 * FUNCTION: AcpiDbUnloadAcpiTable
712 * PARAMETERS: TableArg - Name of the table to be unloaded
713 * InstanceArg - Which instance of the table to unload (if
714 * there are multiple tables of the same type)
718 * DESCRIPTION: Unload an ACPI table.
719 * Instance is not implemented
721 ******************************************************************************/
724 AcpiDbUnloadAcpiTable (
728 /* TBD: Need to reimplement for new data structures */
735 /* Search all tables for the target type */
737 for (i = 0; i < (ACPI_TABLE_ID_MAX+1); i++)
739 if (!ACPI_STRNCMP (TableArg, AcpiGbl_TableData[i].Signature,
740 AcpiGbl_TableData[i].SigLength))
742 /* Found the table, unload it */
744 Status = AcpiUnloadTable (i);
745 if (ACPI_SUCCESS (Status))
747 AcpiOsPrintf ("[%s] unloaded and uninstalled\n", TableArg);
751 AcpiOsPrintf ("%s, while unloading [%s]\n",
752 AcpiFormatException (Status), TableArg);
759 AcpiOsPrintf ("Unknown table type [%s]\n", TableArg);
764 /*******************************************************************************
766 * FUNCTION: AcpiDbSetMethodBreakpoint
768 * PARAMETERS: Location - AML offset of breakpoint
769 * WalkState - Current walk info
770 * Op - Current Op (from parse walk)
774 * DESCRIPTION: Set a breakpoint in a control method at the specified
777 ******************************************************************************/
780 AcpiDbSetMethodBreakpoint (
782 ACPI_WALK_STATE *WalkState,
783 ACPI_PARSE_OBJECT *Op)
790 AcpiOsPrintf ("There is no method currently executing\n");
794 /* Get and verify the breakpoint address */
796 Address = ACPI_STRTOUL (Location, NULL, 16);
797 if (Address <= Op->Common.AmlOffset)
799 AcpiOsPrintf ("Breakpoint %X is beyond current address %X\n",
800 Address, Op->Common.AmlOffset);
803 /* Save breakpoint in current walk */
805 WalkState->UserBreakpoint = Address;
806 AcpiOsPrintf ("Breakpoint set at AML offset %X\n", Address);
810 /*******************************************************************************
812 * FUNCTION: AcpiDbSetMethodCallBreakpoint
814 * PARAMETERS: Op - Current Op (from parse walk)
818 * DESCRIPTION: Set a breakpoint in a control method at the specified
821 ******************************************************************************/
824 AcpiDbSetMethodCallBreakpoint (
825 ACPI_PARSE_OBJECT *Op)
831 AcpiOsPrintf ("There is no method currently executing\n");
835 AcpiGbl_StepToNextCall = TRUE;
839 /*******************************************************************************
841 * FUNCTION: AcpiDbDisassembleAml
843 * PARAMETERS: Statements - Number of statements to disassemble
844 * Op - Current Op (from parse walk)
848 * DESCRIPTION: Display disassembled AML (ASL) starting from Op for the number
849 * of statements specified.
851 ******************************************************************************/
854 AcpiDbDisassembleAml (
856 ACPI_PARSE_OBJECT *Op)
858 UINT32 NumStatements = 8;
863 AcpiOsPrintf ("There is no method currently executing\n");
869 NumStatements = ACPI_STRTOUL (Statements, NULL, 0);
872 AcpiDmDisassemble (NULL, Op, NumStatements);
876 /*******************************************************************************
878 * FUNCTION: AcpiDbDisassembleMethod
880 * PARAMETERS: Name - Name of control method
884 * DESCRIPTION: Display disassembled AML (ASL) starting from Op for the number
885 * of statements specified.
887 ******************************************************************************/
890 AcpiDbDisassembleMethod (
894 ACPI_PARSE_OBJECT *Op;
895 ACPI_WALK_STATE *WalkState;
896 ACPI_OPERAND_OBJECT *ObjDesc;
897 ACPI_NAMESPACE_NODE *Method;
900 Method = AcpiDbConvertToNode (Name);
903 return (AE_BAD_PARAMETER);
906 ObjDesc = Method->Object;
908 Op = AcpiPsCreateScopeOp ();
911 return (AE_NO_MEMORY);
914 /* Create and initialize a new walk state */
916 WalkState = AcpiDsCreateWalkState (0, Op, NULL, NULL);
919 return (AE_NO_MEMORY);
922 Status = AcpiDsInitAmlWalk (WalkState, Op, NULL,
923 ObjDesc->Method.AmlStart,
924 ObjDesc->Method.AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
925 if (ACPI_FAILURE (Status))
932 WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE;
933 WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE;
934 Status = AcpiPsParseAml (WalkState);
936 AcpiDmDisassemble (NULL, Op, 0);
937 AcpiPsDeleteParseTree (Op);
942 /*******************************************************************************
944 * FUNCTION: AcpiDbDumpNamespace
946 * PARAMETERS: StartArg - Node to begin namespace dump
947 * DepthArg - Maximum tree depth to be dumped
951 * DESCRIPTION: Dump entire namespace or a subtree. Each node is displayed
952 * with type and other information.
954 ******************************************************************************/
957 AcpiDbDumpNamespace (
961 ACPI_HANDLE SubtreeEntry = AcpiGbl_RootNode;
962 UINT32 MaxDepth = ACPI_UINT32_MAX;
965 /* No argument given, just start at the root and dump entire namespace */
969 SubtreeEntry = AcpiDbConvertToNode (StartArg);
975 /* Now we can check for the depth argument */
979 MaxDepth = ACPI_STRTOUL (DepthArg, NULL, 0);
983 AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
984 AcpiOsPrintf ("ACPI Namespace (from %4.4s (%p) subtree):\n",
985 ((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Name.Ascii, SubtreeEntry);
987 /* Display the subtree */
989 AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
990 AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth,
991 ACPI_OWNER_ID_MAX, SubtreeEntry);
992 AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
996 /*******************************************************************************
998 * FUNCTION: AcpiDbDumpNamespaceByOwner
1000 * PARAMETERS: OwnerArg - Owner ID whose nodes will be displayed
1001 * DepthArg - Maximum tree depth to be dumped
1005 * DESCRIPTION: Dump elements of the namespace that are owned by the OwnerId.
1007 ******************************************************************************/
1010 AcpiDbDumpNamespaceByOwner (
1014 ACPI_HANDLE SubtreeEntry = AcpiGbl_RootNode;
1015 UINT32 MaxDepth = ACPI_UINT32_MAX;
1016 ACPI_OWNER_ID OwnerId;
1019 OwnerId = (ACPI_OWNER_ID) ACPI_STRTOUL (OwnerArg, NULL, 0);
1021 /* Now we can check for the depth argument */
1025 MaxDepth = ACPI_STRTOUL (DepthArg, NULL, 0);
1028 AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
1029 AcpiOsPrintf ("ACPI Namespace by owner %X:\n", OwnerId);
1031 /* Display the subtree */
1033 AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
1034 AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth, OwnerId,
1036 AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
1040 /*******************************************************************************
1042 * FUNCTION: AcpiDbSendNotify
1044 * PARAMETERS: Name - Name of ACPI object to send the notify to
1045 * Value - Value of the notify to send.
1049 * DESCRIPTION: Send an ACPI notification. The value specified is sent to the
1050 * named object as an ACPI notify.
1052 ******************************************************************************/
1059 ACPI_NAMESPACE_NODE *Node;
1063 /* Translate name to an Named object */
1065 Node = AcpiDbConvertToNode (Name);
1071 /* Decode Named object type */
1075 case ACPI_TYPE_DEVICE:
1076 case ACPI_TYPE_THERMAL:
1078 /* Send the notify */
1080 Status = AcpiEvQueueNotifyRequest (Node, Value);
1081 if (ACPI_FAILURE (Status))
1083 AcpiOsPrintf ("Could not queue notify\n");
1088 AcpiOsPrintf ("Named object is not a device or a thermal object\n");
1094 /*******************************************************************************
1096 * FUNCTION: AcpiDbSetMethodData
1098 * PARAMETERS: TypeArg - L for local, A for argument
1099 * IndexArg - which one
1100 * ValueArg - Value to set.
1104 * DESCRIPTION: Set a local or argument for the running control method.
1105 * NOTE: only object supported is Number.
1107 ******************************************************************************/
1110 AcpiDbSetMethodData (
1118 ACPI_WALK_STATE *WalkState;
1119 ACPI_OPERAND_OBJECT *ObjDesc;
1121 ACPI_NAMESPACE_NODE *Node;
1124 /* Validate TypeArg */
1126 AcpiUtStrupr (TypeArg);
1128 if ((Type != 'L') &&
1132 AcpiOsPrintf ("Invalid SET operand: %s\n", TypeArg);
1136 Value = ACPI_STRTOUL (ValueArg, NULL, 16);
1140 Node = AcpiDbConvertToNode (IndexArg);
1141 if (Node->Type != ACPI_TYPE_INTEGER)
1143 AcpiOsPrintf ("Can only set Integer nodes\n");
1146 ObjDesc = Node->Object;
1147 ObjDesc->Integer.Value = Value;
1151 /* Get the index and value */
1153 Index = ACPI_STRTOUL (IndexArg, NULL, 16);
1155 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
1158 AcpiOsPrintf ("There is no method currently executing\n");
1162 /* Create and initialize the new object */
1164 ObjDesc = AcpiUtCreateIntegerObject ((UINT64) Value);
1167 AcpiOsPrintf ("Could not create an internal object\n");
1171 /* Store the new object into the target */
1177 /* Set a method argument */
1179 if (Index > ACPI_METHOD_MAX_ARG)
1181 AcpiOsPrintf ("Arg%d - Invalid argument name\n", Index);
1185 Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_ARG, Index, ObjDesc,
1187 if (ACPI_FAILURE (Status))
1192 ObjDesc = WalkState->Arguments[Index].Object;
1194 AcpiOsPrintf ("Arg%d: ", Index);
1195 AcpiDmDisplayInternalObject (ObjDesc, WalkState);
1200 /* Set a method local */
1202 if (Index > ACPI_METHOD_MAX_LOCAL)
1204 AcpiOsPrintf ("Local%d - Invalid local variable name\n", Index);
1208 Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_LOCAL, Index, ObjDesc,
1210 if (ACPI_FAILURE (Status))
1215 ObjDesc = WalkState->LocalVariables[Index].Object;
1217 AcpiOsPrintf ("Local%d: ", Index);
1218 AcpiDmDisplayInternalObject (ObjDesc, WalkState);
1226 AcpiUtRemoveReference (ObjDesc);
1230 /*******************************************************************************
1232 * FUNCTION: AcpiDbWalkForSpecificObjects
1234 * PARAMETERS: Callback from WalkNamespace
1238 * DESCRIPTION: Display short info about objects in the namespace
1240 ******************************************************************************/
1243 AcpiDbWalkForSpecificObjects (
1244 ACPI_HANDLE ObjHandle,
1245 UINT32 NestingLevel,
1249 ACPI_WALK_INFO *Info = (ACPI_WALK_INFO *) Context;
1256 /* Get and display the full pathname to this object */
1258 Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
1259 Status = AcpiNsHandleToPathname (ObjHandle, &Buffer);
1260 if (ACPI_FAILURE (Status))
1262 AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
1266 AcpiOsPrintf ("%32s", (char *) Buffer.Pointer);
1267 ACPI_FREE (Buffer.Pointer);
1269 /* Dump short info about the object */
1271 (void) AcpiNsDumpOneObject (ObjHandle, NestingLevel, Info, NULL);
1276 /*******************************************************************************
1278 * FUNCTION: AcpiDbDisplayObjects
1280 * PARAMETERS: ObjTypeArg - Type of object to display
1281 * DisplayCountArg - Max depth to display
1285 * DESCRIPTION: Display objects in the namespace of the requested type
1287 ******************************************************************************/
1290 AcpiDbDisplayObjects (
1292 char *DisplayCountArg)
1294 ACPI_WALK_INFO Info;
1295 ACPI_OBJECT_TYPE Type;
1298 /* Get the object type */
1300 Type = AcpiDbMatchArgument (ObjTypeArg, AcpiDbObjectTypes);
1301 if (Type == ACPI_TYPE_NOT_FOUND)
1303 AcpiOsPrintf ("Invalid or unsupported argument\n");
1307 AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
1309 "Objects of type [%s] defined in the current ACPI Namespace:\n",
1310 AcpiUtGetTypeName (Type));
1312 AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
1315 Info.OwnerId = ACPI_OWNER_ID_MAX;
1316 Info.DebugLevel = ACPI_UINT32_MAX;
1317 Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
1319 /* Walk the namespace from the root */
1321 (void) AcpiWalkNamespace (Type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
1322 AcpiDbWalkForSpecificObjects, NULL, (void *) &Info, NULL);
1325 "\nFound %u objects of type [%s] in the current ACPI Namespace\n",
1326 Info.Count, AcpiUtGetTypeName (Type));
1328 AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
1333 /*******************************************************************************
1335 * FUNCTION: AcpiDbWalkAndMatchName
1337 * PARAMETERS: Callback from WalkNamespace
1341 * DESCRIPTION: Find a particular name/names within the namespace. Wildcards
1342 * are supported -- '?' matches any character.
1344 ******************************************************************************/
1347 AcpiDbWalkAndMatchName (
1348 ACPI_HANDLE ObjHandle,
1349 UINT32 NestingLevel,
1354 char *RequestedName = (char *) Context;
1357 ACPI_WALK_INFO Info;
1360 /* Check for a name match */
1362 for (i = 0; i < 4; i++)
1364 /* Wildcard support */
1366 if ((RequestedName[i] != '?') &&
1367 (RequestedName[i] != ((ACPI_NAMESPACE_NODE *) ObjHandle)->Name.Ascii[i]))
1369 /* No match, just exit */
1375 /* Get the full pathname to this object */
1377 Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
1378 Status = AcpiNsHandleToPathname (ObjHandle, &Buffer);
1379 if (ACPI_FAILURE (Status))
1381 AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
1385 Info.OwnerId = ACPI_OWNER_ID_MAX;
1386 Info.DebugLevel = ACPI_UINT32_MAX;
1387 Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
1389 AcpiOsPrintf ("%32s", (char *) Buffer.Pointer);
1390 (void) AcpiNsDumpOneObject (ObjHandle, NestingLevel, &Info, NULL);
1391 ACPI_FREE (Buffer.Pointer);
1398 /*******************************************************************************
1400 * FUNCTION: AcpiDbFindNameInNamespace
1402 * PARAMETERS: NameArg - The 4-character ACPI name to find.
1403 * wildcards are supported.
1407 * DESCRIPTION: Search the namespace for a given name (with wildcards)
1409 ******************************************************************************/
1412 AcpiDbFindNameInNamespace (
1415 char AcpiName[5] = "____";
1416 char *AcpiNamePtr = AcpiName;
1419 if (ACPI_STRLEN (NameArg) > 4)
1421 AcpiOsPrintf ("Name must be no longer than 4 characters\n");
1425 /* Pad out name with underscores as necessary to create a 4-char name */
1427 AcpiUtStrupr (NameArg);
1430 *AcpiNamePtr = *NameArg;
1435 /* Walk the namespace from the root */
1437 (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
1438 AcpiDbWalkAndMatchName, NULL, AcpiName, NULL);
1440 AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
1445 /*******************************************************************************
1447 * FUNCTION: AcpiDbSetScope
1449 * PARAMETERS: Name - New scope path
1453 * DESCRIPTION: Set the "current scope" as maintained by this utility.
1454 * The scope is used as a prefix to ACPI paths.
1456 ******************************************************************************/
1463 ACPI_NAMESPACE_NODE *Node;
1466 if (!Name || Name[0] == 0)
1468 AcpiOsPrintf ("Current scope: %s\n", AcpiGbl_DbScopeBuf);
1472 AcpiDbPrepNamestring (Name);
1474 if (Name[0] == '\\')
1476 /* Validate new scope from the root */
1478 Status = AcpiNsGetNode (AcpiGbl_RootNode, Name, ACPI_NS_NO_UPSEARCH,
1480 if (ACPI_FAILURE (Status))
1485 ACPI_STRCPY (AcpiGbl_DbScopeBuf, Name);
1486 ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
1490 /* Validate new scope relative to old scope */
1492 Status = AcpiNsGetNode (AcpiGbl_DbScopeNode, Name, ACPI_NS_NO_UPSEARCH,
1494 if (ACPI_FAILURE (Status))
1499 ACPI_STRCAT (AcpiGbl_DbScopeBuf, Name);
1500 ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
1503 AcpiGbl_DbScopeNode = Node;
1504 AcpiOsPrintf ("New scope: %s\n", AcpiGbl_DbScopeBuf);
1509 AcpiOsPrintf ("Could not attach scope: %s, %s\n",
1510 Name, AcpiFormatException (Status));
1514 /*******************************************************************************
1516 * FUNCTION: AcpiDmCompareAmlResources
1518 * PARAMETERS: Aml1Buffer - Contains first resource list
1519 * Aml1BufferLength - Length of first resource list
1520 * Aml2Buffer - Contains second resource list
1521 * Aml2BufferLength - Length of second resource list
1525 * DESCRIPTION: Compare two AML resource lists, descriptor by descriptor (in
1526 * order to isolate a miscompare to an individual resource)
1528 ******************************************************************************/
1531 AcpiDmCompareAmlResources (
1533 ACPI_RSDESC_SIZE Aml1BufferLength,
1535 ACPI_RSDESC_SIZE Aml2BufferLength)
1539 ACPI_RSDESC_SIZE Aml1Length;
1540 ACPI_RSDESC_SIZE Aml2Length;
1541 ACPI_RSDESC_SIZE Offset = 0;
1546 /* Compare overall buffer sizes (may be different due to size rounding) */
1548 if (Aml1BufferLength != Aml2BufferLength)
1551 "**** Buffer length mismatch in converted AML: original %X new %X ****\n",
1552 Aml1BufferLength, Aml2BufferLength);
1558 /* Walk the descriptor lists, comparing each descriptor */
1560 while (Aml1 < (Aml1Buffer + Aml1BufferLength))
1562 /* Get the lengths of each descriptor */
1564 Aml1Length = AcpiUtGetDescriptorLength (Aml1);
1565 Aml2Length = AcpiUtGetDescriptorLength (Aml2);
1566 ResourceType = AcpiUtGetResourceType (Aml1);
1568 /* Check for descriptor length match */
1570 if (Aml1Length != Aml2Length)
1573 "**** Length mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X L1 %X L2 %X ****\n",
1574 Count, ResourceType, Offset, Aml1Length, Aml2Length);
1577 /* Check for descriptor byte match */
1579 else if (ACPI_MEMCMP (Aml1, Aml2, Aml1Length))
1582 "**** Data mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X ****\n",
1583 Count, ResourceType, Offset);
1586 /* Exit on EndTag descriptor */
1588 if (ResourceType == ACPI_RESOURCE_NAME_END_TAG)
1593 /* Point to next descriptor in each buffer */
1596 Offset += Aml1Length;
1603 /*******************************************************************************
1605 * FUNCTION: AcpiDmTestResourceConversion
1607 * PARAMETERS: Node - Parent device node
1608 * Name - resource method name (_CRS)
1612 * DESCRIPTION: Compare the original AML with a conversion of the AML to
1613 * internal resource list, then back to AML.
1615 ******************************************************************************/
1618 AcpiDmTestResourceConversion (
1619 ACPI_NAMESPACE_NODE *Node,
1623 ACPI_BUFFER ReturnObj;
1624 ACPI_BUFFER ResourceObj;
1626 ACPI_OBJECT *OriginalAml;
1629 AcpiOsPrintf ("Resource Conversion Comparison:\n");
1631 NewAml.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
1632 ReturnObj.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
1633 ResourceObj.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
1635 /* Get the original _CRS AML resource template */
1637 Status = AcpiEvaluateObject (Node, Name, NULL, &ReturnObj);
1638 if (ACPI_FAILURE (Status))
1640 AcpiOsPrintf ("Could not obtain %s: %s\n",
1641 Name, AcpiFormatException (Status));
1645 /* Get the AML resource template, converted to internal resource structs */
1647 Status = AcpiGetCurrentResources (Node, &ResourceObj);
1648 if (ACPI_FAILURE (Status))
1650 AcpiOsPrintf ("AcpiGetCurrentResources failed: %s\n",
1651 AcpiFormatException (Status));
1655 /* Convert internal resource list to external AML resource template */
1657 Status = AcpiRsCreateAmlResources (ResourceObj.Pointer, &NewAml);
1658 if (ACPI_FAILURE (Status))
1660 AcpiOsPrintf ("AcpiRsCreateAmlResources failed: %s\n",
1661 AcpiFormatException (Status));
1665 /* Compare original AML to the newly created AML resource list */
1667 OriginalAml = ReturnObj.Pointer;
1669 AcpiDmCompareAmlResources (
1670 OriginalAml->Buffer.Pointer, (ACPI_RSDESC_SIZE) OriginalAml->Buffer.Length,
1671 NewAml.Pointer, (ACPI_RSDESC_SIZE) NewAml.Length);
1673 /* Cleanup and exit */
1675 ACPI_FREE (NewAml.Pointer);
1677 ACPI_FREE (ResourceObj.Pointer);
1679 ACPI_FREE (ReturnObj.Pointer);
1684 /*******************************************************************************
1686 * FUNCTION: AcpiDbDisplayResources
1688 * PARAMETERS: ObjectArg - String with hex value of the object
1692 * DESCRIPTION: Display the resource objects associated with a device.
1694 ******************************************************************************/
1697 AcpiDbDisplayResources (
1700 ACPI_NAMESPACE_NODE *Node;
1702 ACPI_BUFFER ReturnObj;
1705 AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
1706 AcpiDbgLevel |= ACPI_LV_RESOURCES;
1708 /* Convert string to object pointer */
1710 Node = AcpiDbConvertToNode (ObjectArg);
1716 /* Prepare for a return object of arbitrary size */
1718 ReturnObj.Pointer = AcpiGbl_DbBuffer;
1719 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
1723 AcpiOsPrintf ("Evaluating _PRT\n");
1725 /* Check if _PRT exists */
1727 Status = AcpiEvaluateObject (Node, METHOD_NAME__PRT, NULL, &ReturnObj);
1728 if (ACPI_FAILURE (Status))
1730 AcpiOsPrintf ("Could not obtain _PRT: %s\n",
1731 AcpiFormatException (Status));
1735 ReturnObj.Pointer = AcpiGbl_DbBuffer;
1736 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
1738 Status = AcpiGetIrqRoutingTable (Node, &ReturnObj);
1739 if (ACPI_FAILURE (Status))
1741 AcpiOsPrintf ("GetIrqRoutingTable failed: %s\n",
1742 AcpiFormatException (Status));
1746 AcpiRsDumpIrqList (ACPI_CAST_PTR (UINT8, AcpiGbl_DbBuffer));
1752 AcpiOsPrintf ("Evaluating _CRS\n");
1754 ReturnObj.Pointer = AcpiGbl_DbBuffer;
1755 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
1757 /* Check if _CRS exists */
1759 Status = AcpiEvaluateObject (Node, METHOD_NAME__CRS, NULL, &ReturnObj);
1760 if (ACPI_FAILURE (Status))
1762 AcpiOsPrintf ("Could not obtain _CRS: %s\n",
1763 AcpiFormatException (Status));
1767 /* Get the _CRS resource list */
1769 ReturnObj.Pointer = AcpiGbl_DbBuffer;
1770 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
1772 Status = AcpiGetCurrentResources (Node, &ReturnObj);
1773 if (ACPI_FAILURE (Status))
1775 AcpiOsPrintf ("AcpiGetCurrentResources failed: %s\n",
1776 AcpiFormatException (Status));
1780 /* Dump the _CRS resource list */
1782 AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE,
1783 ReturnObj.Pointer));
1786 * Perform comparison of original AML to newly created AML. This tests both
1787 * the AML->Resource conversion and the Resource->Aml conversion.
1789 Status = AcpiDmTestResourceConversion (Node, METHOD_NAME__CRS);
1791 /* Execute _SRS with the resource list */
1793 Status = AcpiSetCurrentResources (Node, &ReturnObj);
1794 if (ACPI_FAILURE (Status))
1796 AcpiOsPrintf ("AcpiSetCurrentResources failed: %s\n",
1797 AcpiFormatException (Status));
1805 AcpiOsPrintf ("Evaluating _PRS\n");
1807 ReturnObj.Pointer = AcpiGbl_DbBuffer;
1808 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
1810 /* Check if _PRS exists */
1812 Status = AcpiEvaluateObject (Node, METHOD_NAME__PRS, NULL, &ReturnObj);
1813 if (ACPI_FAILURE (Status))
1815 AcpiOsPrintf ("Could not obtain _PRS: %s\n",
1816 AcpiFormatException (Status));
1820 ReturnObj.Pointer = AcpiGbl_DbBuffer;
1821 ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
1823 Status = AcpiGetPossibleResources (Node, &ReturnObj);
1824 if (ACPI_FAILURE (Status))
1826 AcpiOsPrintf ("AcpiGetPossibleResources failed: %s\n",
1827 AcpiFormatException (Status));
1831 AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer));
1835 AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
1840 /*******************************************************************************
1842 * FUNCTION: AcpiDbIntegrityWalk
1844 * PARAMETERS: Callback from WalkNamespace
1848 * DESCRIPTION: Examine one NS node for valid values.
1850 ******************************************************************************/
1853 AcpiDbIntegrityWalk (
1854 ACPI_HANDLE ObjHandle,
1855 UINT32 NestingLevel,
1859 ACPI_INTEGRITY_INFO *Info = (ACPI_INTEGRITY_INFO *) Context;
1860 ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
1861 ACPI_OPERAND_OBJECT *Object;
1862 BOOLEAN Alias = TRUE;
1867 /* Verify the NS node, and dereference aliases */
1871 if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
1873 AcpiOsPrintf ("Invalid Descriptor Type for Node %p [%s] - is %2.2X should be %2.2X\n",
1874 Node, AcpiUtGetDescriptorName (Node), ACPI_GET_DESCRIPTOR_TYPE (Node),
1875 ACPI_DESC_TYPE_NAMED);
1879 if ((Node->Type == ACPI_TYPE_LOCAL_ALIAS) ||
1880 (Node->Type == ACPI_TYPE_LOCAL_METHOD_ALIAS))
1882 Node = (ACPI_NAMESPACE_NODE *) Node->Object;
1890 if (Node->Type > ACPI_TYPE_LOCAL_MAX)
1892 AcpiOsPrintf ("Invalid Object Type for Node %p, Type = %X\n",
1897 if (!AcpiUtValidAcpiName (Node->Name.Integer))
1899 AcpiOsPrintf ("Invalid AcpiName for Node %p\n", Node);
1903 Object = AcpiNsGetAttachedObject (Node);
1907 if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND)
1909 AcpiOsPrintf ("Invalid Descriptor Type for Object %p [%s]\n",
1910 Object, AcpiUtGetDescriptorName (Object));
1918 /*******************************************************************************
1920 * FUNCTION: AcpiDbCheckIntegrity
1926 * DESCRIPTION: Check entire namespace for data structure integrity
1928 ******************************************************************************/
1931 AcpiDbCheckIntegrity (
1934 ACPI_INTEGRITY_INFO Info = {0,0};
1936 /* Search all nodes in namespace */
1938 (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
1939 AcpiDbIntegrityWalk, NULL, (void *) &Info, NULL);
1941 AcpiOsPrintf ("Verified %d namespace nodes with %d Objects\n",
1942 Info.Nodes, Info.Objects);
1946 /*******************************************************************************
1948 * FUNCTION: AcpiDbGenerateGpe
1950 * PARAMETERS: GpeArg - Raw GPE number, ascii string
1951 * BlockArg - GPE block number, ascii string
1952 * 0 or 1 for FADT GPE blocks
1956 * DESCRIPTION: Generate a GPE
1958 ******************************************************************************/
1967 ACPI_GPE_EVENT_INFO *GpeEventInfo;
1970 GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0);
1971 BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0);
1974 GpeEventInfo = AcpiEvGetGpeEventInfo (ACPI_TO_POINTER (BlockNumber),
1978 AcpiOsPrintf ("Invalid GPE\n");
1982 (void) AcpiEvGpeDispatch (GpeEventInfo, GpeNumber);
1986 /*******************************************************************************
1988 * FUNCTION: AcpiDbBusWalk
1990 * PARAMETERS: Callback from WalkNamespace
1994 * DESCRIPTION: Display info about device objects that have a corresponding
1997 ******************************************************************************/
2001 ACPI_HANDLE ObjHandle,
2002 UINT32 NestingLevel,
2006 ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
2009 ACPI_NAMESPACE_NODE *TempNode;
2010 ACPI_DEVICE_INFO *Info;
2014 if ((Node->Type != ACPI_TYPE_DEVICE) &&
2015 (Node->Type != ACPI_TYPE_PROCESSOR))
2020 /* Exit if there is no _PRT under this device */
2022 Status = AcpiGetHandle (Node, METHOD_NAME__PRT,
2023 ACPI_CAST_PTR (ACPI_HANDLE, &TempNode));
2024 if (ACPI_FAILURE (Status))
2029 /* Get the full path to this device object */
2031 Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
2032 Status = AcpiNsHandleToPathname (ObjHandle, &Buffer);
2033 if (ACPI_FAILURE (Status))
2035 AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
2039 Status = AcpiGetObjectInfo (ObjHandle, &Info);
2040 if (ACPI_FAILURE (Status))
2045 /* Display the full path */
2047 AcpiOsPrintf ("%-32s Type %X", (char *) Buffer.Pointer, Node->Type);
2048 ACPI_FREE (Buffer.Pointer);
2050 if (Info->Flags & ACPI_PCI_ROOT_BRIDGE)
2052 AcpiOsPrintf (" - Is PCI Root Bridge");
2054 AcpiOsPrintf ("\n");
2058 AcpiOsPrintf ("_PRT: %p\n", TempNode);
2060 /* Dump _ADR, _HID, _UID, _CID */
2062 if (Info->Valid & ACPI_VALID_ADR)
2064 AcpiOsPrintf ("_ADR: %8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Info->Address));
2068 AcpiOsPrintf ("_ADR: <Not Present>\n");
2071 if (Info->Valid & ACPI_VALID_HID)
2073 AcpiOsPrintf ("_HID: %s\n", Info->HardwareId.String);
2077 AcpiOsPrintf ("_HID: <Not Present>\n");
2080 if (Info->Valid & ACPI_VALID_UID)
2082 AcpiOsPrintf ("_UID: %s\n", Info->UniqueId.String);
2086 AcpiOsPrintf ("_UID: <Not Present>\n");
2089 if (Info->Valid & ACPI_VALID_CID)
2091 for (i = 0; i < Info->CompatibleIdList.Count; i++)
2093 AcpiOsPrintf ("_CID: %s\n",
2094 Info->CompatibleIdList.Ids[i].String);
2099 AcpiOsPrintf ("_CID: <Not Present>\n");
2107 /*******************************************************************************
2109 * FUNCTION: AcpiDbGetBusInfo
2115 * DESCRIPTION: Display info about system busses.
2117 ******************************************************************************/
2123 /* Search all nodes in namespace */
2125 (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
2126 AcpiDbBusWalk, NULL, NULL, NULL);
2129 #endif /* ACPI_DEBUGGER */