dbobject.c revision 199767f8919635c4928607450d9e0abb932109ce
/*******************************************************************************
*
* Module Name: dbobject - ACPI object decode and display
*
******************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbobject")
/* Local prototypes */
static void
/*******************************************************************************
*
* FUNCTION: AcpiDbDumpMethodInfo
*
* PARAMETERS: Status - Method execution status
* WalkState - Current state of the parse tree walk
*
* RETURN: None
*
* DESCRIPTION: Called when a method has been aborted because of an error.
* and disassembles the AML opcode that failed.
*
******************************************************************************/
void
{
/* Ignore control codes, they are not errors */
{
return;
}
/* We may be executing a deferred opcode */
if (WalkState->DeferredNode)
{
AcpiOsPrintf ("Executing subtree for Buffer/Package/Region\n");
return;
}
/*
* If there is no Thread, we are not actually executing a method.
* This can happen when the iASL compiler calls the interpreter
* to perform constant folding.
*/
if (!Thread)
{
return;
}
/* Display the method locals and arguments */
AcpiOsPrintf ("\n");
AcpiOsPrintf ("\n");
AcpiOsPrintf ("\n");
}
/*******************************************************************************
*
* FUNCTION: AcpiDbDecodeInternalObject
*
* PARAMETERS: ObjDesc - Object to be displayed
*
* RETURN: None
*
*
******************************************************************************/
void
{
UINT32 i;
if (!ObjDesc)
{
AcpiOsPrintf (" Uninitialized");
return;
}
{
return;
}
{
case ACPI_TYPE_INTEGER:
AcpiOsPrintf (" %8.8X%8.8X",
break;
case ACPI_TYPE_STRING:
AcpiOsPrintf ("(%u) \"%.24s",
{
AcpiOsPrintf ("...");
}
else
{
AcpiOsPrintf ("\"");
}
break;
case ACPI_TYPE_BUFFER:
{
}
break;
default:
break;
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDbDecodeNode
*
* PARAMETERS: Node - Object to be displayed
*
* RETURN: None
*
* DESCRIPTION: Short display of a namespace node
*
******************************************************************************/
static void
{
AcpiOsPrintf ("<Node> Name %4.4s",
{
AcpiOsPrintf (" [Method Arg]");
}
{
AcpiOsPrintf (" [Method Local]");
}
{
/* These types have no attached object */
case ACPI_TYPE_DEVICE:
AcpiOsPrintf (" Device");
break;
case ACPI_TYPE_THERMAL:
AcpiOsPrintf (" Thermal Zone");
break;
default:
break;
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDbDisplayInternalObject
*
* PARAMETERS: ObjDesc - Object to be displayed
* WalkState - Current walk state
*
* RETURN: None
*
* DESCRIPTION: Short display of an internal object
*
******************************************************************************/
void
{
if (!ObjDesc)
{
AcpiOsPrintf ("<Null Object>\n");
return;
}
/* Decode the object type */
switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
{
case ACPI_DESC_TYPE_PARSER:
AcpiOsPrintf ("<Parser> ");
break;
case ACPI_DESC_TYPE_NAMED:
break;
case ACPI_DESC_TYPE_OPERAND:
if (Type > ACPI_TYPE_LOCAL_MAX)
{
return;
}
/* Decode the ACPI object type */
{
/* Decode the refererence */
{
case ACPI_REFCLASS_LOCAL:
if (WalkState)
{
}
break;
case ACPI_REFCLASS_ARG:
if (WalkState)
{
}
break;
case ACPI_REFCLASS_INDEX:
{
case ACPI_TYPE_BUFFER_FIELD:
break;
case ACPI_TYPE_PACKAGE:
{
AcpiOsPrintf (" Uninitialized WHERE pointer");
}
else
{
}
break;
default:
AcpiOsPrintf ("Unknown index target type");
break;
}
break;
case ACPI_REFCLASS_REFOF:
{
"Uninitialized reference subobject pointer");
break;
}
/* Reference can be to a Node or an Operand object */
{
case ACPI_DESC_TYPE_NAMED:
break;
case ACPI_DESC_TYPE_OPERAND:
break;
default:
break;
}
break;
case ACPI_REFCLASS_NAME:
break;
case ACPI_REFCLASS_DEBUG:
case ACPI_REFCLASS_TABLE:
AcpiOsPrintf ("\n");
break;
default: /* Unknown reference class */
break;
}
break;
default:
AcpiOsPrintf ("<Obj> ");
break;
}
break;
default:
AcpiOsPrintf ("<Not a valid ACPI Object Descriptor> [%s]",
break;
}
AcpiOsPrintf ("\n");
}
/*******************************************************************************
*
* FUNCTION: AcpiDbDecodeLocals
*
* PARAMETERS: WalkState - State for current method
*
* RETURN: None
*
* DESCRIPTION: Display all locals for the currently running control method
*
******************************************************************************/
void
{
UINT32 i;
if (!Node)
{
"No method node (Executing subtree for buffer or opregion)\n");
return;
}
{
AcpiOsPrintf ("Executing subtree for Buffer/Package/Region\n");
return;
}
AcpiOsPrintf ("Local Variables for method [%4.4s]:\n",
for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++)
{
AcpiOsPrintf (" Local%X: ", i);
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDbDecodeArguments
*
* PARAMETERS: WalkState - State for current method
*
* RETURN: None
*
* DESCRIPTION: Display all arguments for the currently running control method
*
******************************************************************************/
void
{
UINT32 i;
if (!Node)
{
"No method node (Executing subtree for buffer or opregion)\n");
return;
}
{
AcpiOsPrintf ("Executing subtree for Buffer/Package/Region\n");
return;
}
"Arguments for Method [%4.4s]: "
"(%X arguments defined, max concurrency = %X)\n",
for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++)
{
AcpiOsPrintf (" Arg%u: ", i);
}
}