mirror of
https://github.com/acpica/acpica/
synced 2025-01-19 16:09:19 +03:00
Added memory allocation macros
date 2001.06.29.20.10.00; author rmoore1; state Exp;
This commit is contained in:
parent
261d4fbf25
commit
ca24093917
@ -1,7 +1,7 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Module Name: dsmthdat - control method arguments and local variables
|
||||
* $Revision: 1.44 $
|
||||
* $Revision: 1.47 $
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -154,7 +154,7 @@ AcpiDsMethodDataInit (
|
||||
|
||||
/*
|
||||
* WalkState fields are initialized to zero by the
|
||||
* AcpiCmCallocate().
|
||||
* ACPI_MEM_CALLOCATE().
|
||||
*
|
||||
* An Node is assigned to each argument and local so
|
||||
* that RefOf() can return a pointer to the Node.
|
||||
@ -215,16 +215,14 @@ AcpiDsMethodDataDeleteAll (
|
||||
|
||||
/* Delete the locals */
|
||||
|
||||
DEBUG_PRINT (ACPI_INFO,
|
||||
("MethodDeleteAll: Deleting local variables in %p\n", WalkState));
|
||||
DEBUG_PRINTP (ACPI_INFO, ("Deleting local variables in %p\n", WalkState));
|
||||
|
||||
for (Index = 0; Index < MTH_NUM_LOCALS; Index++)
|
||||
{
|
||||
Object = WalkState->LocalVariables[Index].Object;
|
||||
if (Object)
|
||||
{
|
||||
DEBUG_PRINT (TRACE_EXEC,
|
||||
("MethodDeleteAll: Deleting Local%d=%p\n", Index, Object));
|
||||
DEBUG_PRINTP (TRACE_EXEC, ("Deleting Local%d=%p\n", Index, Object));
|
||||
|
||||
/* Remove first */
|
||||
|
||||
@ -232,23 +230,21 @@ AcpiDsMethodDataDeleteAll (
|
||||
|
||||
/* Was given a ref when stored */
|
||||
|
||||
AcpiCmRemoveReference (Object);
|
||||
AcpiUtRemoveReference (Object);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Delete the arguments */
|
||||
|
||||
DEBUG_PRINT (ACPI_INFO,
|
||||
("MethodDeleteAll: Deleting arguments in %p\n", WalkState));
|
||||
DEBUG_PRINTP (ACPI_INFO, ("Deleting arguments in %p\n", WalkState));
|
||||
|
||||
for (Index = 0; Index < MTH_NUM_ARGS; Index++)
|
||||
{
|
||||
Object = WalkState->Arguments[Index].Object;
|
||||
if (Object)
|
||||
{
|
||||
DEBUG_PRINT (TRACE_EXEC,
|
||||
("MethodDeleteAll: Deleting Arg%d=%p\n", Index, Object));
|
||||
DEBUG_PRINTP (TRACE_EXEC, ("Deleting Arg%d=%p\n", Index, Object));
|
||||
|
||||
/* Remove first */
|
||||
|
||||
@ -256,7 +252,7 @@ AcpiDsMethodDataDeleteAll (
|
||||
|
||||
/* Was given a ref when stored */
|
||||
|
||||
AcpiCmRemoveReference (Object);
|
||||
AcpiUtRemoveReference (Object);
|
||||
}
|
||||
}
|
||||
|
||||
@ -294,8 +290,7 @@ AcpiDsMethodDataInitArgs (
|
||||
|
||||
if (!Params)
|
||||
{
|
||||
DEBUG_PRINT (TRACE_EXEC,
|
||||
("DsMethodDataInitArgs: No param list passed to method\n"));
|
||||
DEBUG_PRINTP (TRACE_EXEC, ("No param list passed to method\n"));
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
@ -313,7 +308,7 @@ AcpiDsMethodDataInitArgs (
|
||||
* Params[Pindex++] argument object descriptor
|
||||
*/
|
||||
Status = AcpiDsStoreObjectToLocal (AML_ARG_OP, Mindex,
|
||||
Params[Pindex], WalkState);
|
||||
Params[Pindex], WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
break;
|
||||
@ -328,8 +323,7 @@ AcpiDsMethodDataInitArgs (
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_PRINT (TRACE_EXEC,
|
||||
("DsMethodDataInitArgs: %d args passed to method\n", Pindex));
|
||||
DEBUG_PRINTP (TRACE_EXEC, ("%d args passed to method\n", Pindex));
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
@ -373,8 +367,7 @@ AcpiDsMethodDataGetEntry (
|
||||
|
||||
if (Index > MTH_MAX_LOCAL)
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("DsMethodDataGetEntry: LocalVar index %d is invalid (max %d)\n",
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("LocalVar index %d is invalid (max %d)\n",
|
||||
Index, MTH_MAX_LOCAL));
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
@ -388,8 +381,7 @@ AcpiDsMethodDataGetEntry (
|
||||
|
||||
if (Index > MTH_MAX_ARG)
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("DsMethodDataGetEntry: Argument index %d is invalid (max %d)\n",
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("Arg index %d is invalid (max %d)\n",
|
||||
Index, MTH_MAX_ARG));
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
@ -400,9 +392,7 @@ AcpiDsMethodDataGetEntry (
|
||||
|
||||
|
||||
default:
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("DsMethodDataGetEntry: Opcode %d is invalid\n",
|
||||
Opcode));
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("Opcode %d is invalid\n", Opcode));
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
@ -449,7 +439,7 @@ AcpiDsMethodDataSetEntry (
|
||||
|
||||
/* Increment ref count so object can't be deleted while installed */
|
||||
|
||||
AcpiCmAddReference (Object);
|
||||
AcpiUtAddReference (Object);
|
||||
|
||||
/* Install the object into the stack entry */
|
||||
|
||||
@ -543,8 +533,7 @@ AcpiDsMethodDataGetNode (
|
||||
|
||||
if (Index > MTH_MAX_LOCAL)
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("DsMethodDataGetNode: LocalVar index %d is invalid (max %d)\n",
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("Local index %d is invalid (max %d)\n",
|
||||
Index, MTH_MAX_LOCAL));
|
||||
return_PTR (Node);
|
||||
}
|
||||
@ -557,8 +546,7 @@ AcpiDsMethodDataGetNode (
|
||||
|
||||
if (Index > MTH_MAX_ARG)
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("DsMethodDataGetNode: Argument index %d is invalid (max %d)\n",
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("Arg index %d is invalid (max %d)\n",
|
||||
Index, MTH_MAX_ARG));
|
||||
return_PTR (Node);
|
||||
}
|
||||
@ -568,9 +556,7 @@ AcpiDsMethodDataGetNode (
|
||||
|
||||
|
||||
default:
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("DsMethodDataGetEntry: Opcode %d is invalid\n",
|
||||
Opcode));
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("Opcode %d is invalid\n", Opcode));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -593,7 +579,7 @@ AcpiDsMethodDataGetNode (
|
||||
*
|
||||
* DESCRIPTION: Retrieve value of selected Arg or Local from the method frame
|
||||
* at the current top of the method stack.
|
||||
* Used only in AcpiAmlResolveToValue().
|
||||
* Used only in AcpiExResolveToValue().
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -616,8 +602,7 @@ AcpiDsMethodDataGetValue (
|
||||
|
||||
if (!DestDesc)
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("DsMethodDataGetValue: NULL object descriptor pointer\n"));
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("Null object descriptor pointer\n"));
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
@ -651,8 +636,7 @@ AcpiDsMethodDataGetValue (
|
||||
{
|
||||
case AML_ARG_OP:
|
||||
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("DsMethodDataGetValue: Uninitialized Arg[%d] at entry %p\n",
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("Uninitialized Arg[%d] at entry %p\n",
|
||||
Index, Entry));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_UNINITIALIZED_ARG);
|
||||
@ -660,8 +644,7 @@ AcpiDsMethodDataGetValue (
|
||||
|
||||
case AML_LOCAL_OP:
|
||||
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("DsMethodDataGetValue: Uninitialized Local[%d] at entry %p\n",
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("Uninitialized Local[%d] at entry %p\n",
|
||||
Index, Entry));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_UNINITIALIZED_LOCAL);
|
||||
@ -676,7 +659,7 @@ AcpiDsMethodDataGetValue (
|
||||
*/
|
||||
|
||||
*DestDesc = Object;
|
||||
AcpiCmAddReference (Object);
|
||||
AcpiUtAddReference (Object);
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
@ -739,7 +722,7 @@ AcpiDsMethodDataDeleteValue (
|
||||
* Decrement the reference count by one to balance the
|
||||
* increment when the object was stored in the slot.
|
||||
*/
|
||||
AcpiCmRemoveReference (Object);
|
||||
AcpiUtRemoveReference (Object);
|
||||
}
|
||||
|
||||
|
||||
@ -776,8 +759,7 @@ AcpiDsStoreObjectToLocal (
|
||||
|
||||
|
||||
FUNCTION_TRACE ("DsMethodDataSetValue");
|
||||
DEBUG_PRINT (TRACE_EXEC,
|
||||
("DsMethodDataSetValue: Opcode=%d Idx=%d Obj=%p\n",
|
||||
DEBUG_PRINTP (TRACE_EXEC, ("Opcode=%d Idx=%d Obj=%p\n",
|
||||
Opcode, Index, SrcDesc));
|
||||
|
||||
|
||||
@ -799,9 +781,7 @@ AcpiDsStoreObjectToLocal (
|
||||
|
||||
if (*Entry == SrcDesc)
|
||||
{
|
||||
DEBUG_PRINT (TRACE_EXEC,
|
||||
("DsMethodDataSetValue: Obj=%p already installed!\n",
|
||||
SrcDesc));
|
||||
DEBUG_PRINTP (TRACE_EXEC, ("Obj=%p already installed!\n", SrcDesc));
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
@ -835,8 +815,8 @@ AcpiDsStoreObjectToLocal (
|
||||
if ((Opcode == AML_ARG_OP) &&
|
||||
(VALID_DESCRIPTOR_TYPE (*Entry, ACPI_DESC_TYPE_NAMED)))
|
||||
{
|
||||
DEBUG_PRINT (TRACE_EXEC,
|
||||
("DsMethodDataSetValue: Arg (%p) is an ObjRef(Node), storing in %p\n",
|
||||
DEBUG_PRINTP (TRACE_EXEC,
|
||||
("Arg (%p) is an ObjRef(Node), storing in %p\n",
|
||||
SrcDesc, *Entry));
|
||||
|
||||
/* Detach an existing object from the Node */
|
||||
@ -858,7 +838,7 @@ AcpiDsStoreObjectToLocal (
|
||||
* Perform "Implicit conversion" of the new object to the type of the
|
||||
* existing object
|
||||
*/
|
||||
Status = AcpiAmlConvertToTargetType ((*Entry)->Common.Type, &SrcDesc, WalkState);
|
||||
Status = AcpiExConvertToTargetType ((*Entry)->Common.Type, &SrcDesc, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dsobject - Dispatcher object management routines
|
||||
* $Revision: 1.62 $
|
||||
* $Revision: 1.66 $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -160,6 +160,9 @@ AcpiDsInitOneObject (
|
||||
UINT8 TableRevision;
|
||||
|
||||
|
||||
PROC_NAME ("DsInitOneObject");
|
||||
|
||||
|
||||
Info->ObjectCount++;
|
||||
TableRevision = Info->TableDesc->Pointer->Revision;
|
||||
|
||||
@ -220,10 +223,9 @@ AcpiDsInitOneObject (
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("DsInitOneObject: Method %p [%4.4s] parse failed! %s\n",
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("Method %p [%4.4s] parse failed! %s\n",
|
||||
ObjHandle, &((ACPI_NAMESPACE_NODE *)ObjHandle)->Name,
|
||||
AcpiCmFormatException (Status)));
|
||||
AcpiUtFormatException (Status)));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -271,8 +273,8 @@ AcpiDsInitializeObjects (
|
||||
FUNCTION_TRACE ("DsInitializeObjects");
|
||||
|
||||
|
||||
DEBUG_PRINT (TRACE_DISPATCH,
|
||||
("DsInitializeObjects: **** Starting initialization of namespace objects ****\n"));
|
||||
DEBUG_PRINTP (TRACE_DISPATCH,
|
||||
("**** Starting initialization of namespace objects ****\n"));
|
||||
DEBUG_PRINT_RAW (ACPI_OK, ("Parsing Methods:"));
|
||||
|
||||
|
||||
@ -288,17 +290,16 @@ AcpiDsInitializeObjects (
|
||||
AcpiDsInitOneObject, &Info, NULL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("DsInitializeObjects: WalkNamespace failed! %x\n", Status));
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("WalkNamespace failed! %x\n", Status));
|
||||
}
|
||||
|
||||
DEBUG_PRINT_RAW (ACPI_OK,
|
||||
("\n%d Control Methods found and parsed (%d nodes total)\n",
|
||||
Info.MethodCount, Info.ObjectCount));
|
||||
DEBUG_PRINT (TRACE_DISPATCH,
|
||||
("DsInitializeObjects: %d Control Methods found\n", Info.MethodCount));
|
||||
DEBUG_PRINT (TRACE_DISPATCH,
|
||||
("DsInitializeObjects: %d Op Regions found\n", Info.OpRegionCount));
|
||||
DEBUG_PRINTP (TRACE_DISPATCH,
|
||||
("%d Control Methods found\n", Info.MethodCount));
|
||||
DEBUG_PRINTP (TRACE_DISPATCH,
|
||||
("%d Op Regions found\n", Info.OpRegionCount));
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
@ -334,6 +335,9 @@ AcpiDsInitObjectFromOp (
|
||||
ACPI_OPCODE_INFO *OpInfo;
|
||||
|
||||
|
||||
PROC_NAME ("DsInitObjectFromOp");
|
||||
|
||||
|
||||
OpInfo = AcpiPsGetOpcodeInfo (Opcode);
|
||||
if (ACPI_GET_OP_TYPE (OpInfo) != ACPI_OP_TYPE_OPCODE)
|
||||
{
|
||||
@ -357,10 +361,10 @@ AcpiDsInitObjectFromOp (
|
||||
|
||||
/* Resolve the object (could be an arg or local) */
|
||||
|
||||
Status = AcpiAmlResolveToValue (&ArgDesc, WalkState);
|
||||
Status = AcpiExResolveToValue (&ArgDesc, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiCmRemoveReference (ArgDesc);
|
||||
AcpiUtRemoveReference (ArgDesc);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
@ -368,17 +372,17 @@ AcpiDsInitObjectFromOp (
|
||||
|
||||
if (ArgDesc->Common.Type != ACPI_TYPE_INTEGER)
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("InitObject: Expecting number, got obj: %p type %X\n",
|
||||
DEBUG_PRINTP (ACPI_ERROR,
|
||||
("Expecting number, got obj: %p type %X\n",
|
||||
ArgDesc, ArgDesc->Common.Type));
|
||||
AcpiCmRemoveReference (ArgDesc);
|
||||
AcpiUtRemoveReference (ArgDesc);
|
||||
return (AE_TYPE);
|
||||
}
|
||||
|
||||
/* Get the value, delete the internal object */
|
||||
|
||||
(*ObjDesc)->Buffer.Length = (UINT32) ArgDesc->Integer.Value;
|
||||
AcpiCmRemoveReference (ArgDesc);
|
||||
AcpiUtRemoveReference (ArgDesc);
|
||||
|
||||
/* Allocate the buffer */
|
||||
|
||||
@ -391,8 +395,8 @@ AcpiDsInitObjectFromOp (
|
||||
|
||||
else
|
||||
{
|
||||
(*ObjDesc)->Buffer.Pointer =
|
||||
AcpiCmCallocate ((*ObjDesc)->Buffer.Length);
|
||||
(*ObjDesc)->Buffer.Pointer = ACPI_MEM_CALLOCATE (
|
||||
(*ObjDesc)->Buffer.Length);
|
||||
|
||||
if (!(*ObjDesc)->Buffer.Pointer)
|
||||
{
|
||||
@ -413,8 +417,7 @@ AcpiDsInitObjectFromOp (
|
||||
{
|
||||
if (ByteList->Opcode != AML_INT_BYTELIST_OP)
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("InitObject: Expecting bytelist, got: %x\n",
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("Expecting bytelist, got: %x\n",
|
||||
ByteList));
|
||||
return (AE_TYPE);
|
||||
}
|
||||
@ -436,7 +439,7 @@ AcpiDsInitObjectFromOp (
|
||||
* so that it is deleted. Error checking is done
|
||||
* within the remove reference function.
|
||||
*/
|
||||
AcpiCmRemoveReference(*ObjDesc);
|
||||
AcpiUtRemoveReference(*ObjDesc);
|
||||
|
||||
Status = AcpiDsBuildInternalObject (WalkState, Op, ObjDesc);
|
||||
break;
|
||||
@ -494,8 +497,7 @@ AcpiDsInitObjectFromOp (
|
||||
|
||||
default:
|
||||
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("InitObject: Unimplemented data type: %x\n",
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("Unimplemented data type: %x\n",
|
||||
(*ObjDesc)->Common.Type));
|
||||
|
||||
break;
|
||||
@ -563,13 +565,15 @@ AcpiDsBuildInternalSimpleObj (
|
||||
{
|
||||
REPORT_WARNING (("Reference %s at AML %X not found\n",
|
||||
Name, Op->AmlOffset));
|
||||
AcpiCmFree (Name);
|
||||
ACPI_MEM_FREE (Name);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
REPORT_WARNING (("Reference %s at AML %X not found\n",
|
||||
Op->Value.String, Op->AmlOffset));
|
||||
}
|
||||
|
||||
*ObjDescPtr = NULL;
|
||||
}
|
||||
|
||||
@ -596,7 +600,7 @@ AcpiDsBuildInternalSimpleObj (
|
||||
|
||||
/* Create and init the internal ACPI object */
|
||||
|
||||
ObjDesc = AcpiCmCreateInternalObject (Type);
|
||||
ObjDesc = AcpiUtCreateInternalObject (Type);
|
||||
if (!ObjDesc)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
@ -605,7 +609,7 @@ AcpiDsBuildInternalSimpleObj (
|
||||
Status = AcpiDsInitObjectFromOp (WalkState, Op, Op->Opcode, &ObjDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiCmRemoveReference (ObjDesc);
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@ -643,7 +647,7 @@ AcpiDsBuildInternalPackageObj (
|
||||
FUNCTION_TRACE ("DsBuildInternalPackageObj");
|
||||
|
||||
|
||||
ObjDesc = AcpiCmCreateInternalObject (ACPI_TYPE_PACKAGE);
|
||||
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_PACKAGE);
|
||||
if (!ObjDesc)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
@ -660,12 +664,12 @@ AcpiDsBuildInternalPackageObj (
|
||||
* that the list is always null terminated.
|
||||
*/
|
||||
|
||||
ObjDesc->Package.Elements =
|
||||
AcpiCmCallocate ((ObjDesc->Package.Count + 1) * sizeof (void *));
|
||||
ObjDesc->Package.Elements = ACPI_MEM_CALLOCATE (
|
||||
(ObjDesc->Package.Count + 1) * sizeof (void *));
|
||||
|
||||
if (!ObjDesc->Package.Elements)
|
||||
{
|
||||
AcpiCmDeleteObjectDesc (ObjDesc);
|
||||
AcpiUtDeleteObjectDesc (ObjDesc);
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
@ -796,7 +800,7 @@ AcpiDsCreateNode (
|
||||
|
||||
Cleanup:
|
||||
|
||||
AcpiCmRemoveReference (ObjDesc);
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Module Name: dsutils - Dispatcher utilities
|
||||
* $Revision: 1.56 $
|
||||
* $Revision: 1.59 $
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -157,7 +157,7 @@ AcpiDsIsResultUsed (
|
||||
|
||||
if (!Op)
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR, ("DsIsResultUsed: Null Op\n"));
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("Null Op\n"));
|
||||
return_VALUE (TRUE);
|
||||
}
|
||||
|
||||
@ -181,10 +181,7 @@ AcpiDsIsResultUsed (
|
||||
ParentInfo = AcpiPsGetOpcodeInfo (Op->Parent->Opcode);
|
||||
if (ACPI_GET_OP_TYPE (ParentInfo) != ACPI_OP_TYPE_OPCODE)
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("DsIsResultUsed: Unknown parent opcode. Op=%X\n",
|
||||
Op));
|
||||
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("Unknown parent opcode. Op=%X\n", Op));
|
||||
return_VALUE (FALSE);
|
||||
}
|
||||
|
||||
@ -209,9 +206,8 @@ AcpiDsIsResultUsed (
|
||||
|
||||
/* Never delete the return value associated with a return opcode */
|
||||
|
||||
DEBUG_PRINT (TRACE_DISPATCH,
|
||||
("DsIsResultUsed: Result used, [RETURN] opcode=%X Op=%X\n",
|
||||
Op->Opcode, Op));
|
||||
DEBUG_PRINTP (TRACE_DISPATCH,
|
||||
("Result used, [RETURN] opcode=%X Op=%X\n", Op->Opcode, Op));
|
||||
return_VALUE (TRUE);
|
||||
break;
|
||||
|
||||
@ -226,8 +222,8 @@ AcpiDsIsResultUsed (
|
||||
if ((WalkState->ControlState->Common.State == CONTROL_PREDICATE_EXECUTING) &&
|
||||
(WalkState->ControlState->Control.PredicateOp == Op))
|
||||
{
|
||||
DEBUG_PRINT (TRACE_DISPATCH,
|
||||
("DsIsResultUsed: Result used as a predicate, [IF/WHILE] opcode=%X Op=%X\n",
|
||||
DEBUG_PRINTP (TRACE_DISPATCH,
|
||||
("Result used as a predicate, [IF/WHILE] opcode=%X Op=%X\n",
|
||||
Op->Opcode, Op));
|
||||
return_VALUE (TRUE);
|
||||
}
|
||||
@ -253,15 +249,14 @@ AcpiDsIsResultUsed (
|
||||
(Op->Parent->Opcode == AML_CREATE_DWORD_FIELD_OP) ||
|
||||
(Op->Parent->Opcode == AML_CREATE_QWORD_FIELD_OP))
|
||||
{
|
||||
DEBUG_PRINT (TRACE_DISPATCH,
|
||||
("DsIsResultUsed: Result used, [Region or CreateField] opcode=%X Op=%X\n",
|
||||
DEBUG_PRINTP (TRACE_DISPATCH,
|
||||
("Result used, [Region or CreateField] opcode=%X Op=%X\n",
|
||||
Op->Opcode, Op));
|
||||
return_VALUE (TRUE);
|
||||
}
|
||||
|
||||
DEBUG_PRINT (TRACE_DISPATCH,
|
||||
("DsIsResultUsed: Result not used, Parent opcode=%X Op=%X\n",
|
||||
Op->Opcode, Op));
|
||||
DEBUG_PRINTP (TRACE_DISPATCH,
|
||||
("Result not used, Parent opcode=%X Op=%X\n", Op->Opcode, Op));
|
||||
|
||||
return_VALUE (FALSE);
|
||||
break;
|
||||
@ -310,9 +305,7 @@ AcpiDsDeleteResultIfNotUsed (
|
||||
|
||||
if (!Op)
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("DsDeleteResultIfNotUsed: Null Op=%X\n",
|
||||
Op));
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("Null Op\n"));
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
@ -332,7 +325,7 @@ AcpiDsDeleteResultIfNotUsed (
|
||||
Status = AcpiDsResultPop (&ObjDesc, WalkState);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
AcpiCmRemoveReference (ResultObj);
|
||||
AcpiUtRemoveReference (ResultObj);
|
||||
}
|
||||
}
|
||||
|
||||
@ -381,15 +374,12 @@ AcpiDsCreateOperand (
|
||||
if ((Arg->Opcode == AML_INT_NAMEPATH_OP) &&
|
||||
(Arg->Value.String))
|
||||
{
|
||||
DEBUG_PRINT (TRACE_DISPATCH,
|
||||
("DsCreateOperand: Getting a name: Arg=%p\n", Arg));
|
||||
DEBUG_PRINTP (TRACE_DISPATCH, ("Getting a name: Arg=%p\n", Arg));
|
||||
|
||||
/* Get the entire name string from the AML stream */
|
||||
|
||||
Status = AcpiAmlGetNameString (ACPI_TYPE_ANY,
|
||||
Arg->Value.Buffer,
|
||||
&NameString,
|
||||
&NameLength);
|
||||
Status = AcpiExGetNameString (ACPI_TYPE_ANY, Arg->Value.Buffer,
|
||||
&NameString, &NameLength);
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@ -434,7 +424,7 @@ AcpiDsCreateOperand (
|
||||
|
||||
/* Free the namestring created above */
|
||||
|
||||
AcpiCmFree (NameString);
|
||||
ACPI_MEM_FREE (NameString);
|
||||
|
||||
/*
|
||||
* The only case where we pass through (ignore) a NOT_FOUND
|
||||
@ -497,8 +487,7 @@ AcpiDsCreateOperand (
|
||||
*/
|
||||
Opcode = AML_ZERO_OP; /* Has no arguments! */
|
||||
|
||||
DEBUG_PRINT (TRACE_DISPATCH,
|
||||
("DsCreateOperand: Null namepath: Arg=%p\n", Arg));
|
||||
DEBUG_PRINTP (TRACE_DISPATCH, ("Null namepath: Arg=%p\n", Arg));
|
||||
|
||||
/*
|
||||
* TBD: [Investigate] anything else needed for the
|
||||
@ -522,8 +511,8 @@ AcpiDsCreateOperand (
|
||||
|
||||
if (Flags & OP_HAS_RETURN_VALUE)
|
||||
{
|
||||
DEBUG_PRINT (TRACE_DISPATCH,
|
||||
("DsCreateOperand: Argument previously created, already stacked \n"));
|
||||
DEBUG_PRINTP (TRACE_DISPATCH,
|
||||
("Argument previously created, already stacked \n"));
|
||||
|
||||
DEBUGGER_EXEC (AcpiDbDisplayArgumentObject (WalkState->Operands [WalkState->NumOperands - 1], WalkState));
|
||||
|
||||
@ -531,7 +520,6 @@ AcpiDsCreateOperand (
|
||||
* Use value that was already previously returned
|
||||
* by the evaluation of this argument
|
||||
*/
|
||||
|
||||
Status = AcpiDsResultPopFromBottom (&ObjDesc, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@ -539,8 +527,8 @@ AcpiDsCreateOperand (
|
||||
* Only error is underflow, and this indicates
|
||||
* a missing or null operand!
|
||||
*/
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("DsCreateOperand: Missing or null operand, %s\n", AcpiCmFormatException (Status)));
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("Missing or null operand, %s\n",
|
||||
AcpiUtFormatException (Status)));
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@ -550,7 +538,7 @@ AcpiDsCreateOperand (
|
||||
{
|
||||
/* Create an ACPI_INTERNAL_OBJECT for the argument */
|
||||
|
||||
ObjDesc = AcpiCmCreateInternalObject (DataType);
|
||||
ObjDesc = AcpiUtCreateInternalObject (DataType);
|
||||
if (!ObjDesc)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
@ -562,7 +550,7 @@ AcpiDsCreateOperand (
|
||||
Opcode, &ObjDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiCmDeleteObjectDesc (ObjDesc);
|
||||
AcpiUtDeleteObjectDesc (ObjDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
@ -619,8 +607,7 @@ AcpiDsCreateOperands (
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
DEBUG_PRINT (TRACE_DISPATCH,
|
||||
("DsCreateOperands: Arg #%d (%p) done, Arg1=%p\n",
|
||||
DEBUG_PRINTP (TRACE_DISPATCH, ("Arg #%d (%p) done, Arg1=%p\n",
|
||||
ArgCount, Arg, FirstArg));
|
||||
|
||||
/* Move on to next argument, if any */
|
||||
@ -641,9 +628,8 @@ Cleanup:
|
||||
|
||||
AcpiDsObjStackPopAndDelete (ArgCount, WalkState);
|
||||
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("DsCreateOperands: Error while creating Arg %d - %s\n",
|
||||
(ArgCount + 1), AcpiCmFormatException (Status)));
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("While creating Arg %d - %s\n",
|
||||
(ArgCount + 1), AcpiUtFormatException (Status)));
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@ -680,12 +666,12 @@ AcpiDsResolveOperands (
|
||||
|
||||
/*
|
||||
* TBD: [Investigate] Note from previous parser:
|
||||
* RefOf problem with AcpiAmlResolveToValue() conversion.
|
||||
* RefOf problem with AcpiExResolveToValue() conversion.
|
||||
*/
|
||||
|
||||
for (i = 0; i < WalkState->NumOperands; i++)
|
||||
{
|
||||
Status = AcpiAmlResolveToValue (&WalkState->Operands[i], WalkState);
|
||||
Status = AcpiExResolveToValue (&WalkState->Operands[i], WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
break;
|
||||
@ -721,15 +707,15 @@ AcpiDsMapOpcodeToDataType (
|
||||
UINT32 Flags = 0;
|
||||
|
||||
|
||||
PROC_NAME ("DsMapOpcodeToDataType");
|
||||
|
||||
|
||||
OpInfo = AcpiPsGetOpcodeInfo (Opcode);
|
||||
if (ACPI_GET_OP_TYPE (OpInfo) != ACPI_OP_TYPE_OPCODE)
|
||||
{
|
||||
/* Unknown opcode */
|
||||
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("MapOpcode: Unknown AML opcode: %x\n",
|
||||
Opcode));
|
||||
|
||||
DEBUG_PRINTP (ACPI_ERROR, ("Unknown AML opcode: %x\n", Opcode));
|
||||
return (DataType);
|
||||
}
|
||||
|
||||
@ -758,9 +744,8 @@ AcpiDsMapOpcodeToDataType (
|
||||
break;
|
||||
|
||||
default:
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("MapOpcode: Unknown (type LITERAL) AML opcode: %x\n",
|
||||
Opcode));
|
||||
DEBUG_PRINTP (ACPI_ERROR,
|
||||
("Unknown (type LITERAL) AML opcode: %x\n", Opcode));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@ -781,9 +766,8 @@ AcpiDsMapOpcodeToDataType (
|
||||
break;
|
||||
|
||||
default:
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("MapOpcode: Unknown (type DATA_TERM) AML opcode: %x\n",
|
||||
Opcode));
|
||||
DEBUG_PRINTP (ACPI_ERROR,
|
||||
("Unknown (type DATA_TERM) AML opcode: %x\n", Opcode));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@ -833,9 +817,8 @@ AcpiDsMapOpcodeToDataType (
|
||||
|
||||
default:
|
||||
|
||||
DEBUG_PRINT (ACPI_ERROR,
|
||||
("MapOpcode: Unimplemented data type opcode: %x\n",
|
||||
Opcode));
|
||||
DEBUG_PRINTP (ACPI_ERROR,
|
||||
("Unimplemented data type opcode: %x\n", Opcode));
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user