Use GetAttachedObject instead of directly accessing Node->Object

date	2001.11.07.17.15.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 16:16:59 +00:00
parent 6396c063ef
commit 07daaebe3c
2 changed files with 42 additions and 47 deletions

View File

@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbcmds - debug commands and output routines
* $Revision: 1.66 $
* $Revision: 1.67 $
*
******************************************************************************/
@ -193,7 +193,7 @@ AcpiDbWalkForReferences (
/* Check for match against the object attached to the node */
if (Node->Object == ObjDesc)
if (AcpiNsGetAttachedObject (Node) == ObjDesc)
{
AcpiOsPrintf ("Reference at Node->Object %p [%4.4s]\n", Node, &Node->Name);
}
@ -769,7 +769,7 @@ AcpiDbWalkForSpecificObjects (
NATIVE_CHAR Buffer[64];
ObjDesc = ((ACPI_NAMESPACE_NODE *)ObjHandle)->Object;
ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjHandle);
BufSize = sizeof (Buffer) / sizeof (*Buffer);
/* Get and display the full pathname to this object */

View File

@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbdisply - debug display commands
* $Revision: 1.50 $
* $Revision: 1.60 $
*
******************************************************************************/
@ -168,7 +168,6 @@ AcpiDbGetPointer (
/* Simple flat pointer */
ObjPtr = (void *) STRTOUL (Target, NULL, 16);
#endif
return (ObjPtr);
@ -228,6 +227,7 @@ AcpiDbDecodeAndDisplayObject (
{
void *ObjPtr;
ACPI_NAMESPACE_NODE *Node;
ACPI_OPERAND_OBJECT *ObjDesc;
UINT32 Display = DB_BYTE_DISPLAY;
NATIVE_CHAR Buffer[80];
ACPI_BUFFER RetBuf;
@ -259,7 +259,6 @@ AcpiDbDecodeAndDisplayObject (
}
}
RetBuf.Length = sizeof (Buffer);
RetBuf.Pointer = Buffer;
@ -314,7 +313,6 @@ AcpiDbDecodeAndDisplayObject (
return;
}
AcpiUtDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display, ACPI_UINT32_MAX);
AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr);
}
@ -356,7 +354,7 @@ DumpNte:
else
{
AcpiOsPrintf ("Object Pathname: %s\n", RetBuf.Pointer);
AcpiOsPrintf ("Object (%p) Pathname: %s\n", Node, RetBuf.Pointer);
}
if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
@ -368,17 +366,18 @@ DumpNte:
AcpiUtDumpBuffer ((void *) Node, sizeof (ACPI_NAMESPACE_NODE), Display, ACPI_UINT32_MAX);
AcpiExDumpNode (Node, 1);
if (Node->Object)
ObjDesc = AcpiNsGetAttachedObject (Node);
if (ObjDesc)
{
AcpiOsPrintf ("\nAttached Object (%p):\n", Node->Object);
if (!AcpiOsReadable (Node->Object, sizeof (ACPI_OPERAND_OBJECT)))
AcpiOsPrintf ("\nAttached Object (%p):\n", ObjDesc);
if (!AcpiOsReadable (ObjDesc, sizeof (ACPI_OPERAND_OBJECT)))
{
AcpiOsPrintf ("Invalid internal ACPI Object at address %p\n", Node->Object);
AcpiOsPrintf ("Invalid internal ACPI Object at address %p\n", ObjDesc);
return;
}
AcpiUtDumpBuffer (Node->Object, sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX);
AcpiExDumpObjectDescriptor (Node->Object, 1);
AcpiUtDumpBuffer ((void *) ObjDesc, sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX);
AcpiExDumpObjectDescriptor (ObjDesc, 1);
}
}
@ -475,7 +474,6 @@ AcpiDbDisplayInternalObject (
return;
}
/* Decode the object type */
else if (VALID_DESCRIPTOR_TYPE (ObjDesc, ACPI_DESC_TYPE_PARSER))
@ -488,6 +486,7 @@ AcpiDbDisplayInternalObject (
AcpiOsPrintf ("<Node> Name %4.4s Type-%s",
&((ACPI_NAMESPACE_NODE *)ObjDesc)->Name,
AcpiUtGetTypeName (((ACPI_NAMESPACE_NODE *) ObjDesc)->Type));
if (((ACPI_NAMESPACE_NODE *) ObjDesc)->Flags & ANOBJ_METHOD_ARG)
{
AcpiOsPrintf (" [Method Arg]");
@ -500,7 +499,6 @@ AcpiDbDisplayInternalObject (
else if (VALID_DESCRIPTOR_TYPE (ObjDesc, ACPI_DESC_TYPE_INTERNAL))
{
AcpiOsPrintf ("<Obj> ");
Type = ObjDesc->Common.Type;
if (Type > INTERNAL_TYPE_MAX)
{
@ -516,31 +514,37 @@ AcpiDbDisplayInternalObject (
switch (ObjDesc->Reference.Opcode)
{
case AML_ZERO_OP:
AcpiOsPrintf ("[Const] Zero (0) [Null Target]", 0);
AcpiOsPrintf ("[Const] Zero (0) [Null Target]", 0);
break;
case AML_ONES_OP:
AcpiOsPrintf ("[Const] Ones (0xFFFFFFFFFFFFFFFF) [No Limit]");
AcpiOsPrintf ("[Const] Ones (0xFFFFFFFFFFFFFFFF) [No Limit]");
break;
case AML_ONE_OP:
AcpiOsPrintf ("[Const] One (1)");
AcpiOsPrintf ("[Const] One (1)");
break;
case AML_REVISION_OP:
AcpiOsPrintf ("[Const] Revision (%X)", ACPI_CA_SUPPORT_LEVEL);
break;
case AML_LOCAL_OP:
AcpiOsPrintf ("[Local%d] ", ObjDesc->Reference.Offset);
AcpiOsPrintf ("[Local%d]", ObjDesc->Reference.Offset);
if (WalkState)
{
ObjDesc = WalkState->LocalVariables[ObjDesc->Reference.Offset].Object;
AcpiOsPrintf (" %p", ObjDesc);
AcpiDbDecodeInternalObject (ObjDesc);
}
break;
case AML_ARG_OP:
AcpiOsPrintf ("[Arg%d] ", ObjDesc->Reference.Offset);
AcpiOsPrintf ("[Arg%d] ", ObjDesc->Reference.Offset);
if (WalkState)
{
ObjDesc = WalkState->Arguments[ObjDesc->Reference.Offset].Object;
AcpiOsPrintf (" %p", ObjDesc);
AcpiDbDecodeInternalObject (ObjDesc);
}
break;
@ -561,6 +565,7 @@ AcpiDbDisplayInternalObject (
break;
default:
AcpiOsPrintf ("<Obj> ");
AcpiOsPrintf (" ");
AcpiDbDecodeInternalObject (ObjDesc);
break;
@ -617,9 +622,9 @@ AcpiDbDisplayMethodInfo (
}
ObjDesc = WalkState->MethodDesc;
Node = WalkState->MethodNode;
Node = WalkState->MethodNode;
NumArgs = ObjDesc->Method.ParamCount;
NumArgs = ObjDesc->Method.ParamCount;
Concurrency = ObjDesc->Method.Concurrency;
AcpiOsPrintf ("Currently executing control method is [%4.4s]\n", &Node->Name);
@ -647,24 +652,12 @@ AcpiDbDisplayMethodInfo (
NumRemainingOps++;
}
OpInfo = AcpiPsGetOpcodeInfo (Op->Opcode);
if (ACPI_GET_OP_TYPE (OpInfo) != ACPI_OP_TYPE_OPCODE)
{
/* Bad opcode or ASCII character */
continue;
}
/* Decode the opcode */
switch (ACPI_GET_OP_CLASS (OpInfo))
OpInfo = AcpiPsGetOpcodeInfo (Op->Opcode);
switch (OpInfo->Class)
{
case OPTYPE_CONSTANT: /* argument type only */
case OPTYPE_LITERAL: /* argument type only */
case OPTYPE_DATA_TERM: /* argument type only */
case OPTYPE_LOCAL_VARIABLE: /* argument type only */
case OPTYPE_METHOD_ARGUMENT: /* argument type only */
case AML_CLASS_ARGUMENT:
if (CountRemaining)
{
NumRemainingOperands++;
@ -673,6 +666,11 @@ AcpiDbDisplayMethodInfo (
NumOperands++;
break;
case AML_CLASS_UNKNOWN:
/* Bad opcode or ASCII character */
continue;
default:
if (CountRemaining)
{
@ -683,7 +681,6 @@ AcpiDbDisplayMethodInfo (
break;
}
Op = AcpiPsGetDepthNext (StartOp, Op);
}
@ -725,8 +722,6 @@ AcpiDbDisplayLocals (void)
ObjDesc = WalkState->MethodDesc;
Node = WalkState->MethodNode;
AcpiOsPrintf ("Local Variables for method [%4.4s]:\n", &Node->Name);
for (i = 0; i < MTH_NUM_LOCALS; i++)
@ -769,12 +764,13 @@ AcpiDbDisplayArguments (void)
}
ObjDesc = WalkState->MethodDesc;
Node = WalkState->MethodNode;
Node = WalkState->MethodNode;
NumArgs = ObjDesc->Method.ParamCount;
NumArgs = ObjDesc->Method.ParamCount;
Concurrency = ObjDesc->Method.Concurrency;
AcpiOsPrintf ("Method [%4.4s] has %X arguments, max concurrency = %X\n", &Node->Name, NumArgs, Concurrency);
AcpiOsPrintf ("Method [%4.4s] has %X arguments, max concurrency = %X\n",
&Node->Name, NumArgs, Concurrency);
for (i = 0; i < NumArgs; i++)
{
@ -822,7 +818,8 @@ AcpiDbDisplayResults (void)
NumResults = WalkState->Results->Results.NumResults;
}
AcpiOsPrintf ("Method [%4.4s] has %X stacked result objects\n", &Node->Name, NumResults);
AcpiOsPrintf ("Method [%4.4s] has %X stacked result objects\n",
&Node->Name, NumResults);
for (i = 0; i < NumResults; i++)
{
@ -861,7 +858,6 @@ AcpiDbDisplayCallingTree (void)
}
Node = WalkState->MethodNode;
AcpiOsPrintf ("Current Control Method Call Tree\n");
for (i = 0; WalkState; i++)
@ -928,7 +924,6 @@ AcpiDbDisplayArgumentObject (
ACPI_WALK_STATE *WalkState)
{
if (!AcpiGbl_CmSingleStep)
{
return;