1 /*******************************************************************************
3 * Module Name: dbcmds - debug commands and output routines
6 ******************************************************************************/
8 /******************************************************************************
12 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.
13 * All rights reserved.
17 * 2.1. This is your license from Intel Corp. under its intellectual property
18 * rights. You may have additional license terms from the party that provided
19 * you this software, covering your right to use that party's intellectual
22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23 * copy of the source code appearing in this file ("Covered Code") an
24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25 * base code distributed originally by Intel ("Original Intel Code") to copy,
26 * 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 *****************************************************************************/
119 #include "acparser.h"
120 #include "acdispat.h"
122 #include "acnamesp.h"
123 #include "acparser.h"
124 #include "acevents.h"
125 #include "acinterp.h"
127 #include "actables.h"
129 #ifdef ENABLE_DEBUGGER
131 #define _COMPONENT DEBUGGER
132 MODULE_NAME ("dbcmds")
136 * Arguments for the Objects command
137 * These object types map directly to the ACPI_TYPES
140 ARGUMENT_INFO AcpiDbObjectTypes [] =
158 {NULL} /* Must be null terminated */
162 /*******************************************************************************
164 * FUNCTION: AcpiDbWalkForReferences
166 * PARAMETERS: Callback from WalkNamespace
170 * DESCRIPTION: Check if this namespace object refers to the target object
171 * that is passed in as the context value.
173 ******************************************************************************/
176 AcpiDbWalkForReferences (
177 ACPI_HANDLE ObjHandle,
182 ACPI_OPERAND_OBJECT *ObjDesc = (ACPI_OPERAND_OBJECT *) Context;
183 ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
186 /* Check for match against the namespace node itself */
188 if (Node == (void *) ObjDesc)
190 AcpiOsPrintf ("Object is a Node [%4.4s]\n", &Node->Name);
193 /* Check for match against the object attached to the node */
195 if (Node->Object == ObjDesc)
197 AcpiOsPrintf ("Reference at Node->Object %p [%4.4s]\n", Node, &Node->Name);
200 /* Check first child for a match */
201 /* TBD: [Investigate] probably now obsolete with new datastructure */
203 if (Node->Child == (void *) ObjDesc)
205 AcpiOsPrintf ("Reference at Node->Child %p [%4.4s]\n", Node, &Node->Name);
212 /*******************************************************************************
214 * FUNCTION: AcpiDbFindReferences
216 * PARAMETERS: ObjectArg - String with hex value of the object
220 * DESCRIPTION: Search namespace for all references to the input object
222 ******************************************************************************/
225 AcpiDbFindReferences (
226 NATIVE_CHAR *ObjectArg)
228 ACPI_OPERAND_OBJECT *ObjDesc;
231 /* Convert string to object pointer */
233 ObjDesc = (ACPI_OPERAND_OBJECT *) STRTOUL (ObjectArg, NULL, 16);
235 /* Search all nodes in namespace */
237 AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
238 AcpiDbWalkForReferences, (void *) ObjDesc, NULL);
242 /*******************************************************************************
244 * FUNCTION: AcpiDbDisplayTableInfo
246 * PARAMETERS: TableArg - String with name of table to be displayed
250 * DESCRIPTION: Display information about loaded tables. Current
251 * implementation displays all loaded tables.
253 ******************************************************************************/
256 AcpiDbDisplayTableInfo (
257 NATIVE_CHAR *TableArg)
262 for (i = 0; i < NUM_ACPI_TABLES; i++)
264 if (AcpiGbl_AcpiTables[i].Pointer)
266 AcpiOsPrintf ("%s at %p length %X\n", AcpiGbl_AcpiTableData[i].Name,
267 AcpiGbl_AcpiTables[i].Pointer, AcpiGbl_AcpiTables[i].Length);
273 /*******************************************************************************
275 * FUNCTION: AcpiDbUnloadAcpiTable
277 * PARAMETERS: TableArg - Name of the table to be unloaded
278 * InstanceArg - Which instance of the table to unload (if
279 * there are multiple tables of the same type)
283 * DESCRIPTION: Unload an ACPI table.
284 * Instance is not implemented
286 ******************************************************************************/
289 AcpiDbUnloadAcpiTable (
290 NATIVE_CHAR *TableArg,
291 NATIVE_CHAR *InstanceArg)
297 /* Search all tables for the target type */
299 for (i = 0; i < NUM_ACPI_TABLES; i++)
301 if (!STRNCMP (TableArg, AcpiGbl_AcpiTableData[i].Signature, AcpiGbl_AcpiTableData[i].SigLength))
303 /* Found the table, unload it */
305 Status = AcpiUnloadTable (i);
306 if (ACPI_SUCCESS (Status))
308 AcpiOsPrintf ("[%s] unloaded and uninstalled\n", TableArg);
312 AcpiOsPrintf ("%s, while unloading [%s]\n", AcpiCmFormatException (Status), TableArg);
319 AcpiOsPrintf ("Unknown table type [%s]\n", TableArg);
323 /*******************************************************************************
325 * FUNCTION: AcpiDbSetMethodBreakpoint
327 * PARAMETERS: Location - AML offset of breakpoint
328 * WalkState - Current walk info
329 * Op - Current Op (from parse walk)
333 * DESCRIPTION: Set a breakpoint in a control method at the specified
336 ******************************************************************************/
339 AcpiDbSetMethodBreakpoint (
340 NATIVE_CHAR *Location,
341 ACPI_WALK_STATE *WalkState,
342 ACPI_PARSE_OBJECT *Op)
349 AcpiOsPrintf ("There is no method currently executing\n");
353 /* Get and verify the breakpoint address */
355 Address = STRTOUL (Location, NULL, 16);
356 if (Address <= Op->AmlOffset)
358 AcpiOsPrintf ("Breakpoint %X is beyond current address %X\n", Address, Op->AmlOffset);
361 /* Save breakpoint in current walk */
363 WalkState->MethodBreakpoint = Address;
364 AcpiOsPrintf ("Breakpoint set at AML offset %X\n", Address);
368 /*******************************************************************************
370 * FUNCTION: AcpiDbSetMethodCallBreakpoint
372 * PARAMETERS: Op - Current Op (from parse walk)
376 * DESCRIPTION: Set a breakpoint in a control method at the specified
379 ******************************************************************************/
382 AcpiDbSetMethodCallBreakpoint (
383 ACPI_PARSE_OBJECT *Op)
389 AcpiOsPrintf ("There is no method currently executing\n");
394 AcpiGbl_StepToNextCall = TRUE;
398 /*******************************************************************************
400 * FUNCTION: AcpiDbDisassembleAml
402 * PARAMETERS: Statements - Number of statements to disassemble
403 * Op - Current Op (from parse walk)
407 * DESCRIPTION: Display disassembled AML (ASL) starting from Op for the number
408 * of statements specified.
410 ******************************************************************************/
413 AcpiDbDisassembleAml (
414 NATIVE_CHAR *Statements,
415 ACPI_PARSE_OBJECT *Op)
417 UINT32 NumStatements = 8;
422 AcpiOsPrintf ("There is no method currently executing\n");
428 NumStatements = STRTOUL (Statements, NULL, 0);
432 AcpiDbDisplayOp (NULL, Op, NumStatements);
436 /*******************************************************************************
438 * FUNCTION: AcpiDbDumpNamespace
440 * PARAMETERS: StartArg - Node to begin namespace dump
441 * DepthArg - Maximum tree depth to be dumped
445 * DESCRIPTION: Dump entire namespace or a subtree. Each node is displayed
446 * with type and other information.
448 ******************************************************************************/
451 AcpiDbDumpNamespace (
452 NATIVE_CHAR *StartArg,
453 NATIVE_CHAR *DepthArg)
455 ACPI_HANDLE SubtreeEntry = AcpiGbl_RootNode;
456 UINT32 MaxDepth = ACPI_UINT32_MAX;
459 /* No argument given, just start at the root and dump entire namespace */
463 /* Check if numeric argument, must be a Node */
465 if ((StartArg[0] >= 0x30) && (StartArg[0] <= 0x39))
467 SubtreeEntry = (ACPI_HANDLE) STRTOUL (StartArg, NULL, 16);
468 if (!AcpiOsReadable (SubtreeEntry, sizeof (ACPI_NAMESPACE_NODE)))
470 AcpiOsPrintf ("Address %p is invalid in this address space\n", SubtreeEntry);
474 if (!VALID_DESCRIPTOR_TYPE ((SubtreeEntry), ACPI_DESC_TYPE_NAMED))
476 AcpiOsPrintf ("Address %p is not a valid Named object\n", SubtreeEntry);
485 /* The parameter is a name string that must be resolved to a Named obj*/
487 SubtreeEntry = AcpiDbLocalNsLookup (StartArg);
490 SubtreeEntry = AcpiGbl_RootNode;
494 /* Now we can check for the depth argument */
498 MaxDepth = STRTOUL (DepthArg, NULL, 0);
503 AcpiDbSetOutputDestination (DB_DUPLICATE_OUTPUT);
504 AcpiOsPrintf ("ACPI Namespace (from %p subtree):\n", SubtreeEntry);
506 /* Display the subtree */
508 AcpiDbSetOutputDestination (DB_REDIRECTABLE_OUTPUT);
509 AcpiNsDumpObjects (ACPI_TYPE_ANY, MaxDepth, ACPI_UINT32_MAX, SubtreeEntry);
510 AcpiDbSetOutputDestination (DB_CONSOLE_OUTPUT);
514 /*******************************************************************************
516 * FUNCTION: AcpiDbDumpNamespaceByOwner
518 * PARAMETERS: OwnerArg - Owner ID whose nodes will be displayed
519 * DepthArg - Maximum tree depth to be dumped
523 * DESCRIPTION: Dump elements of the namespace that are owned by the OwnerId.
525 ******************************************************************************/
528 AcpiDbDumpNamespaceByOwner (
529 NATIVE_CHAR *OwnerArg,
530 NATIVE_CHAR *DepthArg)
532 ACPI_HANDLE SubtreeEntry = AcpiGbl_RootNode;
533 UINT32 MaxDepth = ACPI_UINT32_MAX;
537 OwnerId = (UINT16) STRTOUL (OwnerArg, NULL, 0);
540 /* Now we can check for the depth argument */
544 MaxDepth = STRTOUL (DepthArg, NULL, 0);
548 AcpiDbSetOutputDestination (DB_DUPLICATE_OUTPUT);
549 AcpiOsPrintf ("ACPI Namespace by owner %X:\n", OwnerId);
551 /* Display the subtree */
553 AcpiDbSetOutputDestination (DB_REDIRECTABLE_OUTPUT);
554 AcpiNsDumpObjects (ACPI_TYPE_ANY, MaxDepth, OwnerId, SubtreeEntry);
555 AcpiDbSetOutputDestination (DB_CONSOLE_OUTPUT);
559 /*******************************************************************************
561 * FUNCTION: AcpiDbSendNotify
563 * PARAMETERS: Name - Name of ACPI object to send the notify to
564 * Value - Value of the notify to send.
568 * DESCRIPTION: Send an ACPI notification. The value specified is sent to the
569 * named object as an ACPI notify.
571 ******************************************************************************/
578 ACPI_NAMESPACE_NODE *Node;
581 /* Translate name to an Named object */
583 Node = AcpiDbLocalNsLookup (Name);
589 /* Decode Named object type */
593 case ACPI_TYPE_DEVICE:
594 case ACPI_TYPE_THERMAL:
596 /* Send the notify */
598 AcpiEvNotifyDispatch (Node, Value);
602 AcpiOsPrintf ("Named object is not a device or a thermal object\n");
609 /*******************************************************************************
611 * FUNCTION: AcpiDbSetMethodData
613 * PARAMETERS: TypeArg - L for local, A for argument
614 * IndexArg - which one
615 * ValueArg - Value to set.
619 * DESCRIPTION: Set a local or argument for the running control method.
620 * NOTE: only object supported is Number.
622 ******************************************************************************/
625 AcpiDbSetMethodData (
626 NATIVE_CHAR *TypeArg,
627 NATIVE_CHAR *IndexArg,
628 NATIVE_CHAR *ValueArg)
633 ACPI_WALK_STATE *WalkState;
634 ACPI_OPERAND_OBJECT *ObjDesc;
637 /* Validate TypeArg */
644 AcpiOsPrintf ("Invalid SET operand: %s\n", TypeArg);
648 /* Get the index and value */
650 Index = STRTOUL (IndexArg, NULL, 16);
651 Value = STRTOUL (ValueArg, NULL, 16);
653 WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
656 AcpiOsPrintf ("There is no method currently executing\n");
661 /* Create and initialize the new object */
663 ObjDesc = AcpiCmCreateInternalObject (ACPI_TYPE_INTEGER);
666 AcpiOsPrintf ("Could not create an internal object\n");
670 ObjDesc->Integer.Value = Value;
673 /* Store the new object into the target */
679 /* Set a method argument */
681 if (Index > MTH_NUM_ARGS)
683 AcpiOsPrintf ("Arg%d - Invalid argument name\n", Index);
687 AcpiDsMethodDataSetValue (MTH_TYPE_ARG, Index, ObjDesc, WalkState);
688 ObjDesc = WalkState->Arguments[Index].Object;
690 AcpiOsPrintf ("Arg%d: ", Index);
691 AcpiDbDisplayInternalObject (ObjDesc, WalkState);
696 /* Set a method local */
698 if (Index > MTH_NUM_LOCALS)
700 AcpiOsPrintf ("Local%d - Invalid local variable name\n", Index);
704 AcpiDsMethodDataSetValue (MTH_TYPE_LOCAL, Index, ObjDesc, WalkState);
705 ObjDesc = WalkState->LocalVariables[Index].Object;
707 AcpiOsPrintf ("Local%d: ", Index);
708 AcpiDbDisplayInternalObject (ObjDesc, WalkState);
717 /*******************************************************************************
719 * FUNCTION: AcpiDbWalkForSpecificObjects
721 * PARAMETERS: Callback from WalkNamespace
725 * DESCRIPTION: Display short info about objects in the namespace
727 ******************************************************************************/
730 AcpiDbWalkForSpecificObjects (
731 ACPI_HANDLE ObjHandle,
736 ACPI_OPERAND_OBJECT *ObjDesc;
739 NATIVE_CHAR Buffer[64];
742 ObjDesc = ((ACPI_NAMESPACE_NODE *)ObjHandle)->Object;
743 BufSize = sizeof (Buffer) / sizeof (*Buffer);
745 /* Get and display the full pathname to this object */
747 Status = AcpiNsHandleToPathname (ObjHandle, &BufSize, Buffer);
749 if (ACPI_FAILURE (Status))
751 AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
755 AcpiOsPrintf ("%32s", Buffer);
758 /* Display short information about the object */
762 switch (ObjDesc->Common.Type)
764 case ACPI_TYPE_METHOD:
765 AcpiOsPrintf (" #Args %d Concurrency %X", ObjDesc->Method.ParamCount, ObjDesc->Method.Concurrency);
768 case ACPI_TYPE_INTEGER:
769 AcpiOsPrintf (" Value %X", ObjDesc->Integer.Value);
772 case ACPI_TYPE_STRING:
773 AcpiOsPrintf (" \"%s\"", ObjDesc->String.Pointer);
776 case ACPI_TYPE_REGION:
777 AcpiOsPrintf (" SpaceId %X Address %X Length %X", ObjDesc->Region.SpaceId, ObjDesc->Region.Address, ObjDesc->Region.Length);
780 case ACPI_TYPE_PACKAGE:
781 AcpiOsPrintf (" #Elements %X", ObjDesc->Package.Count);
784 case ACPI_TYPE_BUFFER:
785 AcpiOsPrintf (" Length %X", ObjDesc->Buffer.Length);
795 /*******************************************************************************
797 * FUNCTION: AcpiDbDisplayObjects
799 * PARAMETERS: ObjTypeArg - Type of object to display
800 * DisplayCountArg - Max depth to display
804 * DESCRIPTION: Display objects in the namespace of the requested type
806 ******************************************************************************/
809 AcpiDbDisplayObjects (
810 NATIVE_CHAR *ObjTypeArg,
811 NATIVE_CHAR *DisplayCountArg)
814 OBJECT_TYPE_INTERNAL Type;
817 /* Get the object type */
820 Type = AcpiDbMatchArgument (ObjTypeArg, AcpiDbObjectTypes);
821 if (Type == ACPI_TYPE_NOT_FOUND)
823 AcpiOsPrintf ("Invalid or unsupported argument\n");
827 /* Get the display depth */
831 DisplayCount = STRTOUL (DisplayCountArg, NULL, 0);
836 DisplayCount = ACPI_UINT32_MAX;
839 AcpiDbSetOutputDestination (DB_DUPLICATE_OUTPUT);
840 AcpiOsPrintf ("Objects of type [%s] defined in the current ACPI Namespace: \n", AcpiCmGetTypeName (Type));
842 AcpiDbSetOutputDestination (DB_REDIRECTABLE_OUTPUT);
844 /* Walk the namespace from the root */
846 AcpiWalkNamespace (Type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
847 AcpiDbWalkForSpecificObjects, (void *) &Type, NULL);
849 AcpiDbSetOutputDestination (DB_CONSOLE_OUTPUT);
854 /*******************************************************************************
856 * FUNCTION: AcpiDbWalkAndMatchName
858 * PARAMETERS: Callback from WalkNamespace
862 * DESCRIPTION: Find a particular name/names within the namespace. Wildcards
863 * are supported -- '?' matches any character.
865 ******************************************************************************/
868 AcpiDbWalkAndMatchName (
869 ACPI_HANDLE ObjHandle,
874 ACPI_OPERAND_OBJECT *ObjDesc;
876 NATIVE_CHAR *RequestedName = (NATIVE_CHAR *) Context;
879 NATIVE_CHAR Buffer[96];
882 ObjDesc = ((ACPI_NAMESPACE_NODE *)ObjHandle)->Object;
885 /* Check for a name match */
887 for (i = 0; i < 4; i++)
889 /* Wildcard support */
891 if ((RequestedName[i] != '?') &&
892 (RequestedName[i] != ((NATIVE_CHAR *) (&((ACPI_NAMESPACE_NODE *) ObjHandle)->Name))[i]))
894 /* No match, just exit */
901 /* Get the full pathname to this object */
903 BufSize = sizeof (Buffer) / sizeof (*Buffer);
905 Status = AcpiNsHandleToPathname (ObjHandle, &BufSize, Buffer);
906 if (ACPI_FAILURE (Status))
908 AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
913 AcpiOsPrintf ("%32s (%p) - %s\n", Buffer, ObjHandle,
914 AcpiCmGetTypeName (((ACPI_NAMESPACE_NODE *) ObjHandle)->Type));
921 /*******************************************************************************
923 * FUNCTION: AcpiDbFindNameInNamespace
925 * PARAMETERS: NameArg - The 4-character ACPI name to find.
926 * wildcards are supported.
930 * DESCRIPTION: Search the namespace for a given name (with wildcards)
932 ******************************************************************************/
935 AcpiDbFindNameInNamespace (
936 NATIVE_CHAR *NameArg)
939 if (STRLEN (NameArg) > 4)
941 AcpiOsPrintf ("Name must be no longer than 4 characters\n");
945 /* Walk the namespace from the root */
947 AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
948 AcpiDbWalkAndMatchName, NameArg, NULL);
950 AcpiDbSetOutputDestination (DB_CONSOLE_OUTPUT);
955 /*******************************************************************************
957 * FUNCTION: AcpiDbSetScope
959 * PARAMETERS: Name - New scope path
963 * DESCRIPTION: Set the "current scope" as maintained by this utility.
964 * The scope is used as a prefix to ACPI paths.
966 ******************************************************************************/
973 if (!Name || Name[0] == 0)
975 AcpiOsPrintf ("Current scope: %s\n", ScopeBuf);
979 AcpiDbPrepNamestring (Name);
981 /* TBD: [Future] Validate scope here */
985 STRCPY (ScopeBuf, Name);
986 STRCAT (ScopeBuf, "\\");
991 STRCAT (ScopeBuf, Name);
992 STRCAT (ScopeBuf, "\\");
995 AcpiOsPrintf ("New scope: %s\n", ScopeBuf);
999 /*******************************************************************************
1001 * FUNCTION: AcpiDbDisplayResources
1003 * PARAMETERS: ObjectArg - String with hex value of the object
1009 ******************************************************************************/
1012 AcpiDbDisplayResources (
1013 NATIVE_CHAR *ObjectArg)
1015 ACPI_OPERAND_OBJECT *ObjDesc;
1017 ACPI_BUFFER ReturnObj;
1018 PCI_ROUTING_TABLE *Prt;
1022 AcpiDbSetOutputDestination (DB_REDIRECTABLE_OUTPUT);
1024 /* Convert string to object pointer */
1026 ObjDesc = (ACPI_OPERAND_OBJECT *) STRTOUL (ObjectArg, NULL, 16);
1028 /* Prepare for a return object of arbitrary size */
1030 ReturnObj.Pointer = Buffer;
1031 ReturnObj.Length = BUFFER_SIZE;
1033 Status = AcpiEvaluateObject (ObjDesc, "_PRT", NULL, &ReturnObj);
1034 if (ACPI_FAILURE (Status))
1036 AcpiOsPrintf ("Could not obtain _PRT: %s\n", AcpiCmFormatException (Status));
1040 ReturnObj.Pointer = Buffer;
1041 ReturnObj.Length = BUFFER_SIZE;
1043 Status = AcpiGetIrqRoutingTable (ObjDesc, &ReturnObj);
1044 if (ACPI_FAILURE (Status))
1046 AcpiOsPrintf ("GetIrqRoutingTable failed: %s\n", AcpiCmFormatException (Status));
1050 Prt = (PCI_ROUTING_TABLE *) Buffer;
1052 while ((char *) Prt < (Buffer + ReturnObj.Length))
1054 AcpiOsPrintf ("Prt[%d] Src=%s: Addr=%X\n", i, Prt->Source, Prt->Address);
1056 Prt = (PCI_ROUTING_TABLE *) (((char *) Prt) + Prt->Length);
1061 AcpiDbSetOutputDestination (DB_CONSOLE_OUTPUT);
1070 #endif /* ENABLE_DEBUGGER */