xref: /onnv-gate/usr/src/uts/intel/io/acpica/disassembler/dmobject.c (revision 9980:13d7f3eec672)
13446Smrj /*******************************************************************************
23446Smrj  *
33446Smrj  * Module Name: dmobject - ACPI object decode and display
43446Smrj  *
53446Smrj  ******************************************************************************/
63446Smrj 
73446Smrj /******************************************************************************
83446Smrj  *
93446Smrj  * 1. Copyright Notice
103446Smrj  *
11*9980SDana.Myers@Sun.COM  * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
123446Smrj  * All rights reserved.
133446Smrj  *
143446Smrj  * 2. License
153446Smrj  *
163446Smrj  * 2.1. This is your license from Intel Corp. under its intellectual property
173446Smrj  * rights.  You may have additional license terms from the party that provided
183446Smrj  * you this software, covering your right to use that party's intellectual
193446Smrj  * property rights.
203446Smrj  *
213446Smrj  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
223446Smrj  * copy of the source code appearing in this file ("Covered Code") an
233446Smrj  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
243446Smrj  * base code distributed originally by Intel ("Original Intel Code") to copy,
253446Smrj  * make derivatives, distribute, use and display any portion of the Covered
263446Smrj  * Code in any form, with the right to sublicense such rights; and
273446Smrj  *
283446Smrj  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
293446Smrj  * license (with the right to sublicense), under only those claims of Intel
303446Smrj  * patents that are infringed by the Original Intel Code, to make, use, sell,
313446Smrj  * offer to sell, and import the Covered Code and derivative works thereof
323446Smrj  * solely to the minimum extent necessary to exercise the above copyright
333446Smrj  * license, and in no event shall the patent license extend to any additions
343446Smrj  * to or modifications of the Original Intel Code.  No other license or right
353446Smrj  * is granted directly or by implication, estoppel or otherwise;
363446Smrj  *
373446Smrj  * The above copyright and patent license is granted only if the following
383446Smrj  * conditions are met:
393446Smrj  *
403446Smrj  * 3. Conditions
413446Smrj  *
423446Smrj  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
433446Smrj  * Redistribution of source code of any substantial portion of the Covered
443446Smrj  * Code or modification with rights to further distribute source must include
453446Smrj  * the above Copyright Notice, the above License, this list of Conditions,
463446Smrj  * and the following Disclaimer and Export Compliance provision.  In addition,
473446Smrj  * Licensee must cause all Covered Code to which Licensee contributes to
483446Smrj  * contain a file documenting the changes Licensee made to create that Covered
493446Smrj  * Code and the date of any change.  Licensee must include in that file the
503446Smrj  * documentation of any changes made by any predecessor Licensee.  Licensee
513446Smrj  * must include a prominent statement that the modification is derived,
523446Smrj  * directly or indirectly, from Original Intel Code.
533446Smrj  *
543446Smrj  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
553446Smrj  * Redistribution of source code of any substantial portion of the Covered
563446Smrj  * Code or modification without rights to further distribute source must
573446Smrj  * include the following Disclaimer and Export Compliance provision in the
583446Smrj  * documentation and/or other materials provided with distribution.  In
593446Smrj  * addition, Licensee may not authorize further sublicense of source of any
603446Smrj  * portion of the Covered Code, and must include terms to the effect that the
613446Smrj  * license from Licensee to its licensee is limited to the intellectual
623446Smrj  * property embodied in the software Licensee provides to its licensee, and
633446Smrj  * not to intellectual property embodied in modifications its licensee may
643446Smrj  * make.
653446Smrj  *
663446Smrj  * 3.3. Redistribution of Executable. Redistribution in executable form of any
673446Smrj  * substantial portion of the Covered Code or modification must reproduce the
683446Smrj  * above Copyright Notice, and the following Disclaimer and Export Compliance
693446Smrj  * provision in the documentation and/or other materials provided with the
703446Smrj  * distribution.
713446Smrj  *
723446Smrj  * 3.4. Intel retains all right, title, and interest in and to the Original
733446Smrj  * Intel Code.
743446Smrj  *
753446Smrj  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
763446Smrj  * Intel shall be used in advertising or otherwise to promote the sale, use or
773446Smrj  * other dealings in products derived from or relating to the Covered Code
783446Smrj  * without prior written authorization from Intel.
793446Smrj  *
803446Smrj  * 4. Disclaimer and Export Compliance
813446Smrj  *
823446Smrj  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
833446Smrj  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
843446Smrj  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
853446Smrj  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
863446Smrj  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
873446Smrj  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
883446Smrj  * PARTICULAR PURPOSE.
893446Smrj  *
903446Smrj  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
913446Smrj  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
923446Smrj  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
933446Smrj  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
943446Smrj  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
953446Smrj  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
963446Smrj  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
973446Smrj  * LIMITED REMEDY.
983446Smrj  *
993446Smrj  * 4.3. Licensee shall not export, either directly or indirectly, any of this
1003446Smrj  * software or system incorporating such software without first obtaining any
1013446Smrj  * required license or other approval from the U. S. Department of Commerce or
1023446Smrj  * any other agency or department of the United States Government.  In the
1033446Smrj  * event Licensee exports any such software from the United States or
1043446Smrj  * re-exports any such software from a foreign destination, Licensee shall
1053446Smrj  * ensure that the distribution and export/re-export of the software is in
1063446Smrj  * compliance with all laws, regulations, orders, or other restrictions of the
1073446Smrj  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
1083446Smrj  * any of its subsidiaries will export/re-export any technical data, process,
1093446Smrj  * software, or service, directly or indirectly, to any country for which the
1103446Smrj  * United States government or any agency thereof requires an export license,
1113446Smrj  * other governmental approval, or letter of assurance, without first obtaining
1123446Smrj  * such license, approval or letter.
1133446Smrj  *
1143446Smrj  *****************************************************************************/
1153446Smrj 
1163446Smrj 
1173446Smrj #include "acpi.h"
118*9980SDana.Myers@Sun.COM #include "accommon.h"
1193446Smrj #include "acnamesp.h"
1203446Smrj #include "acdisasm.h"
1213446Smrj 
1223446Smrj 
1233446Smrj #ifdef ACPI_DISASSEMBLER
1243446Smrj 
1253446Smrj #define _COMPONENT          ACPI_CA_DEBUGGER
1263446Smrj         ACPI_MODULE_NAME    ("dmnames")
1273446Smrj 
1283446Smrj /* Local prototypes */
1293446Smrj 
1303446Smrj static void
1313446Smrj AcpiDmDecodeNode (
1323446Smrj     ACPI_NAMESPACE_NODE     *Node);
1333446Smrj 
1343446Smrj 
1353446Smrj /*******************************************************************************
1363446Smrj  *
1373446Smrj  * FUNCTION:    AcpiDmDumpMethodInfo
1383446Smrj  *
1393446Smrj  * PARAMETERS:  Status          - Method execution status
1403446Smrj  *              WalkState       - Current state of the parse tree walk
1413446Smrj  *              Op              - Executing parse op
1423446Smrj  *
1433446Smrj  * RETURN:      None
1443446Smrj  *
1453446Smrj  * DESCRIPTION: Called when a method has been aborted because of an error.
1463446Smrj  *              Dumps the method execution stack, and the method locals/args,
1473446Smrj  *              and disassembles the AML opcode that failed.
1483446Smrj  *
1493446Smrj  ******************************************************************************/
1503446Smrj 
1513446Smrj void
AcpiDmDumpMethodInfo(ACPI_STATUS Status,ACPI_WALK_STATE * WalkState,ACPI_PARSE_OBJECT * Op)1523446Smrj AcpiDmDumpMethodInfo (
1533446Smrj     ACPI_STATUS             Status,
1543446Smrj     ACPI_WALK_STATE         *WalkState,
1553446Smrj     ACPI_PARSE_OBJECT       *Op)
1563446Smrj {
1573446Smrj     ACPI_PARSE_OBJECT       *Next;
1583446Smrj     ACPI_THREAD_STATE       *Thread;
1593446Smrj     ACPI_WALK_STATE         *NextWalkState;
1603446Smrj     ACPI_NAMESPACE_NODE     *PreviousMethod = NULL;
1613446Smrj 
1623446Smrj 
1633446Smrj     /* Ignore control codes, they are not errors */
1643446Smrj 
1653446Smrj     if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL)
1663446Smrj     {
1673446Smrj         return;
1683446Smrj     }
1693446Smrj 
1703446Smrj     /* We may be executing a deferred opcode */
1713446Smrj 
1723446Smrj     if (WalkState->DeferredNode)
1733446Smrj     {
1743446Smrj         AcpiOsPrintf ("Executing subtree for Buffer/Package/Region\n");
1753446Smrj         return;
1763446Smrj     }
1773446Smrj 
1783446Smrj     /*
1793446Smrj      * If there is no Thread, we are not actually executing a method.
1803446Smrj      * This can happen when the iASL compiler calls the interpreter
1813446Smrj      * to perform constant folding.
1823446Smrj      */
1833446Smrj     Thread = WalkState->Thread;
1843446Smrj     if (!Thread)
1853446Smrj     {
1863446Smrj         return;
1873446Smrj     }
1883446Smrj 
1893446Smrj     /* Display exception and method name */
1903446Smrj 
1913446Smrj     AcpiOsPrintf ("\n**** Exception %s during execution of method ",
1923446Smrj         AcpiFormatException (Status));
1933446Smrj     AcpiNsPrintNodePathname (WalkState->MethodNode, NULL);
1943446Smrj 
1953446Smrj     /* Display stack of executing methods */
1963446Smrj 
1973446Smrj     AcpiOsPrintf ("\n\nMethod Execution Stack:\n");
1983446Smrj     NextWalkState = Thread->WalkStateList;
1993446Smrj 
2003446Smrj     /* Walk list of linked walk states */
2013446Smrj 
2023446Smrj     while (NextWalkState)
2033446Smrj     {
2043446Smrj         AcpiOsPrintf ("    Method [%4.4s] executing: ",
2053446Smrj                 AcpiUtGetNodeName (NextWalkState->MethodNode));
2063446Smrj 
2073446Smrj         /* First method is the currently executing method */
2083446Smrj 
2093446Smrj         if (NextWalkState == WalkState)
2103446Smrj         {
2117851SDana.Myers@Sun.COM             if (Op)
2127851SDana.Myers@Sun.COM             {
2137851SDana.Myers@Sun.COM                 /* Display currently executing ASL statement */
2143446Smrj 
2157851SDana.Myers@Sun.COM                 Next = Op->Common.Next;
2167851SDana.Myers@Sun.COM                 Op->Common.Next = NULL;
2173446Smrj 
2187851SDana.Myers@Sun.COM                 AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX);
2197851SDana.Myers@Sun.COM                 Op->Common.Next = Next;
2207851SDana.Myers@Sun.COM             }
2213446Smrj         }
2223446Smrj         else
2233446Smrj         {
2243446Smrj             /*
2253446Smrj              * This method has called another method
2263446Smrj              * NOTE: the method call parse subtree is already deleted at this
2273446Smrj              * point, so we cannot disassemble the method invocation.
2283446Smrj              */
2293446Smrj             AcpiOsPrintf ("Call to method ");
2303446Smrj             AcpiNsPrintNodePathname (PreviousMethod, NULL);
2313446Smrj         }
2323446Smrj 
2333446Smrj         PreviousMethod = NextWalkState->MethodNode;
2343446Smrj         NextWalkState = NextWalkState->Next;
2353446Smrj         AcpiOsPrintf ("\n");
2363446Smrj     }
2373446Smrj 
2383446Smrj     /* Display the method locals and arguments */
2393446Smrj 
2403446Smrj     AcpiOsPrintf ("\n");
2413446Smrj     AcpiDmDisplayLocals (WalkState);
2423446Smrj     AcpiOsPrintf ("\n");
2433446Smrj     AcpiDmDisplayArguments (WalkState);
2443446Smrj     AcpiOsPrintf ("\n");
2453446Smrj }
2463446Smrj 
2473446Smrj 
2483446Smrj /*******************************************************************************
2493446Smrj  *
2503446Smrj  * FUNCTION:    AcpiDmDecodeInternalObject
2513446Smrj  *
2523446Smrj  * PARAMETERS:  ObjDesc         - Object to be displayed
2533446Smrj  *
2543446Smrj  * RETURN:      None
2553446Smrj  *
2563446Smrj  * DESCRIPTION: Short display of an internal object.  Numbers/Strings/Buffers.
2573446Smrj  *
2583446Smrj  ******************************************************************************/
2593446Smrj 
2603446Smrj void
AcpiDmDecodeInternalObject(ACPI_OPERAND_OBJECT * ObjDesc)2613446Smrj AcpiDmDecodeInternalObject (
2623446Smrj     ACPI_OPERAND_OBJECT     *ObjDesc)
2633446Smrj {
2643446Smrj     UINT32                  i;
2653446Smrj 
2663446Smrj 
2673446Smrj     if (!ObjDesc)
2683446Smrj     {
2693446Smrj         AcpiOsPrintf (" Uninitialized");
2703446Smrj         return;
2713446Smrj     }
2723446Smrj 
2733446Smrj     if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
2743446Smrj     {
2753446Smrj         AcpiOsPrintf (" %p [%s]", ObjDesc, AcpiUtGetDescriptorName (ObjDesc));
2763446Smrj         return;
2773446Smrj     }
2783446Smrj 
2793446Smrj     AcpiOsPrintf (" %s", AcpiUtGetObjectTypeName (ObjDesc));
2803446Smrj 
281*9980SDana.Myers@Sun.COM     switch (ObjDesc->Common.Type)
2823446Smrj     {
2833446Smrj     case ACPI_TYPE_INTEGER:
2843446Smrj 
2853446Smrj         AcpiOsPrintf (" %8.8X%8.8X",
2863446Smrj                 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
2873446Smrj         break;
2883446Smrj 
2893446Smrj 
2903446Smrj     case ACPI_TYPE_STRING:
2913446Smrj 
2923446Smrj         AcpiOsPrintf ("(%d) \"%.24s",
2933446Smrj                 ObjDesc->String.Length, ObjDesc->String.Pointer);
2943446Smrj 
2953446Smrj         if (ObjDesc->String.Length > 24)
2963446Smrj         {
2973446Smrj             AcpiOsPrintf ("...");
2983446Smrj         }
2993446Smrj         else
3003446Smrj         {
3013446Smrj             AcpiOsPrintf ("\"");
3023446Smrj         }
3033446Smrj         break;
3043446Smrj 
3053446Smrj 
3063446Smrj     case ACPI_TYPE_BUFFER:
3073446Smrj 
3083446Smrj         AcpiOsPrintf ("(%d)", ObjDesc->Buffer.Length);
3093446Smrj         for (i = 0; (i < 8) && (i < ObjDesc->Buffer.Length); i++)
3103446Smrj         {
3113446Smrj             AcpiOsPrintf (" %2.2X", ObjDesc->Buffer.Pointer[i]);
3123446Smrj         }
3133446Smrj         break;
3143446Smrj 
3153446Smrj 
3163446Smrj     default:
3173446Smrj 
3183446Smrj         AcpiOsPrintf (" %p", ObjDesc);
3193446Smrj         break;
3203446Smrj     }
3213446Smrj }
3223446Smrj 
3233446Smrj 
3243446Smrj /*******************************************************************************
3253446Smrj  *
3263446Smrj  * FUNCTION:    AcpiDmDecodeNode
3273446Smrj  *
3283446Smrj  * PARAMETERS:  Node        - Object to be displayed
3293446Smrj  *
3303446Smrj  * RETURN:      None
3313446Smrj  *
3323446Smrj  * DESCRIPTION: Short display of a namespace node
3333446Smrj  *
3343446Smrj  ******************************************************************************/
3353446Smrj 
3363446Smrj static void
AcpiDmDecodeNode(ACPI_NAMESPACE_NODE * Node)3373446Smrj AcpiDmDecodeNode (
3383446Smrj     ACPI_NAMESPACE_NODE     *Node)
3393446Smrj {
3403446Smrj 
3413446Smrj     AcpiOsPrintf ("<Node>            Name %4.4s",
3423446Smrj             AcpiUtGetNodeName (Node));
3433446Smrj 
3443446Smrj     if (Node->Flags & ANOBJ_METHOD_ARG)
3453446Smrj     {
3463446Smrj         AcpiOsPrintf (" [Method Arg]");
3473446Smrj     }
3483446Smrj     if (Node->Flags & ANOBJ_METHOD_LOCAL)
3493446Smrj     {
3503446Smrj         AcpiOsPrintf (" [Method Local]");
3513446Smrj     }
3523446Smrj 
3537851SDana.Myers@Sun.COM     switch (Node->Type)
3547851SDana.Myers@Sun.COM     {
3557851SDana.Myers@Sun.COM     /* These types have no attached object */
3567851SDana.Myers@Sun.COM 
3577851SDana.Myers@Sun.COM     case ACPI_TYPE_DEVICE:
3587851SDana.Myers@Sun.COM         AcpiOsPrintf (" Device");
3597851SDana.Myers@Sun.COM         break;
3607851SDana.Myers@Sun.COM 
3617851SDana.Myers@Sun.COM     case ACPI_TYPE_THERMAL:
3627851SDana.Myers@Sun.COM         AcpiOsPrintf (" Thermal Zone");
3637851SDana.Myers@Sun.COM         break;
3647851SDana.Myers@Sun.COM 
3657851SDana.Myers@Sun.COM     default:
3667851SDana.Myers@Sun.COM         AcpiDmDecodeInternalObject (AcpiNsGetAttachedObject (Node));
3677851SDana.Myers@Sun.COM         break;
3687851SDana.Myers@Sun.COM     }
3693446Smrj }
3703446Smrj 
3713446Smrj 
3723446Smrj /*******************************************************************************
3733446Smrj  *
3743446Smrj  * FUNCTION:    AcpiDmDisplayInternalObject
3753446Smrj  *
3763446Smrj  * PARAMETERS:  ObjDesc         - Object to be displayed
3773446Smrj  *              WalkState       - Current walk state
3783446Smrj  *
3793446Smrj  * RETURN:      None
3803446Smrj  *
3813446Smrj  * DESCRIPTION: Short display of an internal object
3823446Smrj  *
3833446Smrj  ******************************************************************************/
3843446Smrj 
3853446Smrj void
AcpiDmDisplayInternalObject(ACPI_OPERAND_OBJECT * ObjDesc,ACPI_WALK_STATE * WalkState)3863446Smrj AcpiDmDisplayInternalObject (
3873446Smrj     ACPI_OPERAND_OBJECT     *ObjDesc,
3883446Smrj     ACPI_WALK_STATE         *WalkState)
3893446Smrj {
3903446Smrj     UINT8                   Type;
3913446Smrj 
3923446Smrj 
3933446Smrj     AcpiOsPrintf ("%p ", ObjDesc);
3943446Smrj 
3953446Smrj     if (!ObjDesc)
3963446Smrj     {
3973446Smrj         AcpiOsPrintf ("<Null Object>\n");
3983446Smrj         return;
3993446Smrj     }
4003446Smrj 
4013446Smrj     /* Decode the object type */
4023446Smrj 
4033446Smrj     switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
4043446Smrj     {
4053446Smrj     case ACPI_DESC_TYPE_PARSER:
4063446Smrj 
4073446Smrj         AcpiOsPrintf ("<Parser>  ");
4083446Smrj         break;
4093446Smrj 
4103446Smrj 
4113446Smrj     case ACPI_DESC_TYPE_NAMED:
4123446Smrj 
4133446Smrj         AcpiDmDecodeNode ((ACPI_NAMESPACE_NODE *) ObjDesc);
4143446Smrj         break;
4153446Smrj 
4163446Smrj 
4173446Smrj     case ACPI_DESC_TYPE_OPERAND:
4183446Smrj 
419*9980SDana.Myers@Sun.COM         Type = ObjDesc->Common.Type;
4203446Smrj         if (Type > ACPI_TYPE_LOCAL_MAX)
4213446Smrj         {
4223446Smrj             AcpiOsPrintf (" Type %X [Invalid Type]", (UINT32) Type);
4233446Smrj             return;
4243446Smrj         }
4253446Smrj 
4263446Smrj         /* Decode the ACPI object type */
4273446Smrj 
428*9980SDana.Myers@Sun.COM         switch (ObjDesc->Common.Type)
4293446Smrj         {
4303446Smrj         case ACPI_TYPE_LOCAL_REFERENCE:
4313446Smrj 
4327851SDana.Myers@Sun.COM             AcpiOsPrintf ("[%s] ", AcpiUtGetReferenceName (ObjDesc));
4337851SDana.Myers@Sun.COM 
4347851SDana.Myers@Sun.COM             /* Decode the refererence */
4357851SDana.Myers@Sun.COM 
4367851SDana.Myers@Sun.COM             switch (ObjDesc->Reference.Class)
4373446Smrj             {
4387851SDana.Myers@Sun.COM             case ACPI_REFCLASS_LOCAL:
4393446Smrj 
4407851SDana.Myers@Sun.COM                 AcpiOsPrintf ("%X ", ObjDesc->Reference.Value);
4413446Smrj                 if (WalkState)
4423446Smrj                 {
4437851SDana.Myers@Sun.COM                     ObjDesc = WalkState->LocalVariables
4447851SDana.Myers@Sun.COM                                 [ObjDesc->Reference.Value].Object;
4453446Smrj                     AcpiOsPrintf ("%p", ObjDesc);
4463446Smrj                     AcpiDmDecodeInternalObject (ObjDesc);
4473446Smrj                 }
4483446Smrj                 break;
4493446Smrj 
4503446Smrj 
4517851SDana.Myers@Sun.COM             case ACPI_REFCLASS_ARG:
4523446Smrj 
4537851SDana.Myers@Sun.COM                 AcpiOsPrintf ("%X ", ObjDesc->Reference.Value);
4543446Smrj                 if (WalkState)
4553446Smrj                 {
4567851SDana.Myers@Sun.COM                     ObjDesc = WalkState->Arguments
4577851SDana.Myers@Sun.COM                                 [ObjDesc->Reference.Value].Object;
4583446Smrj                     AcpiOsPrintf ("%p", ObjDesc);
4593446Smrj                     AcpiDmDecodeInternalObject (ObjDesc);
4603446Smrj                 }
4613446Smrj                 break;
4623446Smrj 
4633446Smrj 
4647851SDana.Myers@Sun.COM             case ACPI_REFCLASS_INDEX:
4653446Smrj 
4663446Smrj                 switch (ObjDesc->Reference.TargetType)
4673446Smrj                 {
4683446Smrj                 case ACPI_TYPE_BUFFER_FIELD:
4697851SDana.Myers@Sun.COM 
4703446Smrj                     AcpiOsPrintf ("%p", ObjDesc->Reference.Object);
4713446Smrj                     AcpiDmDecodeInternalObject (ObjDesc->Reference.Object);
4723446Smrj                     break;
4733446Smrj 
4743446Smrj                 case ACPI_TYPE_PACKAGE:
4753446Smrj 
4763446Smrj                     AcpiOsPrintf ("%p", ObjDesc->Reference.Where);
4773446Smrj                     if (!ObjDesc->Reference.Where)
4783446Smrj                     {
4797851SDana.Myers@Sun.COM                         AcpiOsPrintf (" Uninitialized WHERE pointer");
4803446Smrj                     }
4813446Smrj                     else
4823446Smrj                     {
4833446Smrj                         AcpiDmDecodeInternalObject (
4843446Smrj                             *(ObjDesc->Reference.Where));
4853446Smrj                     }
4863446Smrj                     break;
4873446Smrj 
4883446Smrj                 default:
4897851SDana.Myers@Sun.COM 
4903446Smrj                     AcpiOsPrintf ("Unknown index target type");
4913446Smrj                     break;
4923446Smrj                 }
4933446Smrj                 break;
4943446Smrj 
4953446Smrj 
4967851SDana.Myers@Sun.COM             case ACPI_REFCLASS_REFOF:
4973446Smrj 
4983446Smrj                 if (!ObjDesc->Reference.Object)
4993446Smrj                 {
5007851SDana.Myers@Sun.COM                     AcpiOsPrintf ("Uninitialized reference subobject pointer");
5013446Smrj                     break;
5023446Smrj                 }
5033446Smrj 
5043446Smrj                 /* Reference can be to a Node or an Operand object */
5053446Smrj 
5063446Smrj                 switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc->Reference.Object))
5073446Smrj                 {
5083446Smrj                 case ACPI_DESC_TYPE_NAMED:
5093446Smrj                     AcpiDmDecodeNode (ObjDesc->Reference.Object);
5103446Smrj                     break;
5113446Smrj 
5123446Smrj                 case ACPI_DESC_TYPE_OPERAND:
5133446Smrj                     AcpiDmDecodeInternalObject (ObjDesc->Reference.Object);
5143446Smrj                     break;
5153446Smrj 
5163446Smrj                 default:
5173446Smrj                     break;
5183446Smrj                 }
5193446Smrj                 break;
5203446Smrj 
5217851SDana.Myers@Sun.COM 
5227851SDana.Myers@Sun.COM             case ACPI_REFCLASS_NAME:
5233446Smrj 
5243446Smrj                 AcpiDmDecodeNode (ObjDesc->Reference.Node);
5253446Smrj                 break;
5263446Smrj 
5277851SDana.Myers@Sun.COM 
5287851SDana.Myers@Sun.COM             case ACPI_REFCLASS_DEBUG:
5297851SDana.Myers@Sun.COM             case ACPI_REFCLASS_TABLE:
5303446Smrj 
5317851SDana.Myers@Sun.COM                 AcpiOsPrintf ("\n");
5327851SDana.Myers@Sun.COM                 break;
5337851SDana.Myers@Sun.COM 
5347851SDana.Myers@Sun.COM 
5357851SDana.Myers@Sun.COM             default:    /* Unknown reference class */
5367851SDana.Myers@Sun.COM 
5377851SDana.Myers@Sun.COM                 AcpiOsPrintf ("%2.2X\n", ObjDesc->Reference.Class);
5383446Smrj                 break;
5393446Smrj             }
5403446Smrj             break;
5413446Smrj 
5427851SDana.Myers@Sun.COM 
5433446Smrj         default:
5443446Smrj 
5453446Smrj             AcpiOsPrintf ("<Obj>            ");
5463446Smrj             AcpiDmDecodeInternalObject (ObjDesc);
5473446Smrj             break;
5483446Smrj         }
5493446Smrj         break;
5503446Smrj 
5513446Smrj 
5523446Smrj     default:
5533446Smrj 
5543446Smrj         AcpiOsPrintf ("<Not a valid ACPI Object Descriptor> [%s]",
5557851SDana.Myers@Sun.COM             AcpiUtGetDescriptorName (ObjDesc));
5563446Smrj         break;
5573446Smrj     }
5583446Smrj 
5593446Smrj     AcpiOsPrintf ("\n");
5603446Smrj }
5613446Smrj 
5623446Smrj 
5633446Smrj /*******************************************************************************
5643446Smrj  *
5653446Smrj  * FUNCTION:    AcpiDmDisplayLocals
5663446Smrj  *
5673446Smrj  * PARAMETERS:  WalkState       - State for current method
5683446Smrj  *
5693446Smrj  * RETURN:      None
5703446Smrj  *
5713446Smrj  * DESCRIPTION: Display all locals for the currently running control method
5723446Smrj  *
5733446Smrj  ******************************************************************************/
5743446Smrj 
5753446Smrj void
AcpiDmDisplayLocals(ACPI_WALK_STATE * WalkState)5763446Smrj AcpiDmDisplayLocals (
5773446Smrj     ACPI_WALK_STATE         *WalkState)
5783446Smrj {
5793446Smrj     UINT32                  i;
5803446Smrj     ACPI_OPERAND_OBJECT     *ObjDesc;
5813446Smrj     ACPI_NAMESPACE_NODE     *Node;
5823446Smrj 
5833446Smrj 
5843446Smrj     ObjDesc = WalkState->MethodDesc;
5853446Smrj     Node    = WalkState->MethodNode;
5863446Smrj     if (!Node)
5873446Smrj     {
5883446Smrj         AcpiOsPrintf (
5893446Smrj             "No method node (Executing subtree for buffer or opregion)\n");
5903446Smrj         return;
5913446Smrj     }
5923446Smrj 
5933446Smrj     if (Node->Type != ACPI_TYPE_METHOD)
5943446Smrj     {
5953446Smrj         AcpiOsPrintf ("Executing subtree for Buffer/Package/Region\n");
5963446Smrj         return;
5973446Smrj     }
5983446Smrj 
5993446Smrj     AcpiOsPrintf ("Local Variables for method [%4.4s]:\n",
6003446Smrj             AcpiUtGetNodeName (Node));
6013446Smrj 
6023446Smrj     for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++)
6033446Smrj     {
6043446Smrj         ObjDesc = WalkState->LocalVariables[i].Object;
6053446Smrj         AcpiOsPrintf ("    Local%X: ", i);
6063446Smrj         AcpiDmDisplayInternalObject (ObjDesc, WalkState);
6073446Smrj     }
6083446Smrj }
6093446Smrj 
6103446Smrj 
6113446Smrj /*******************************************************************************
6123446Smrj  *
6133446Smrj  * FUNCTION:    AcpiDmDisplayArguments
6143446Smrj  *
6153446Smrj  * PARAMETERS:  WalkState       - State for current method
6163446Smrj  *
6173446Smrj  * RETURN:      None
6183446Smrj  *
6193446Smrj  * DESCRIPTION: Display all arguments for the currently running control method
6203446Smrj  *
6213446Smrj  ******************************************************************************/
6223446Smrj 
6233446Smrj void
AcpiDmDisplayArguments(ACPI_WALK_STATE * WalkState)6243446Smrj AcpiDmDisplayArguments (
6253446Smrj     ACPI_WALK_STATE         *WalkState)
6263446Smrj {
6273446Smrj     UINT32                  i;
6283446Smrj     ACPI_OPERAND_OBJECT     *ObjDesc;
6293446Smrj     ACPI_NAMESPACE_NODE     *Node;
6303446Smrj 
6313446Smrj 
6323446Smrj     ObjDesc = WalkState->MethodDesc;
6333446Smrj     Node    = WalkState->MethodNode;
6343446Smrj     if (!Node)
6353446Smrj     {
6363446Smrj         AcpiOsPrintf (
6373446Smrj             "No method node (Executing subtree for buffer or opregion)\n");
6383446Smrj         return;
6393446Smrj     }
6403446Smrj 
6413446Smrj     if (Node->Type != ACPI_TYPE_METHOD)
6423446Smrj     {
6433446Smrj         AcpiOsPrintf ("Executing subtree for Buffer/Package/Region\n");
6443446Smrj         return;
6453446Smrj     }
6463446Smrj 
6473446Smrj     AcpiOsPrintf (
6483446Smrj         "Arguments for Method [%4.4s]:  (%X arguments defined, max concurrency = %X)\n",
6493446Smrj         AcpiUtGetNodeName (Node), ObjDesc->Method.ParamCount, ObjDesc->Method.SyncLevel);
6503446Smrj 
6513446Smrj     for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++)
6523446Smrj     {
6533446Smrj         ObjDesc = WalkState->Arguments[i].Object;
6543446Smrj         AcpiOsPrintf ("    Arg%d:   ", i);
6553446Smrj         AcpiDmDisplayInternalObject (ObjDesc, WalkState);
6563446Smrj     }
6573446Smrj }
6583446Smrj 
6593446Smrj #endif
6603446Smrj 
6613446Smrj 
662