Fix for Store (Local0, Local1) did not create a new object

date	2003.12.02.20.53.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 17:04:04 +00:00
parent 606d33dd32
commit 6a50cf7489

View File

@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dsmthdat - control method arguments and local variables
* $Revision: 1.73 $
* $Revision: 1.74 $
*
******************************************************************************/
@ -662,13 +662,13 @@ AcpiDsStoreObjectToLocal (
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
ACPI_OPERAND_OBJECT *CurrentObjDesc;
ACPI_OPERAND_OBJECT *NewObjDesc;
ACPI_FUNCTION_TRACE ("DsStoreObjectToLocal");
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode=%d Idx=%d Obj=%p\n",
Opcode, Index, ObjDesc));
/* Parameter validation */
if (!ObjDesc)
@ -692,6 +692,21 @@ AcpiDsStoreObjectToLocal (
return_ACPI_STATUS (Status);
}
/*
* If the reference count on the object is more than one, we must
* take a copy of the object before we store.
*/
NewObjDesc = ObjDesc;
if (ObjDesc->Common.ReferenceCount > 1)
{
Status = AcpiUtCopyIobjectToIobject (ObjDesc, &NewObjDesc, WalkState);
NewObjDesc;
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
}
/*
* If there is an object already in this slot, we either
* have to delete it, or if this is an argument and there
@ -739,14 +754,21 @@ AcpiDsStoreObjectToLocal (
{
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Arg (%p) is an ObjRef(Node), storing in node %p\n",
ObjDesc, CurrentObjDesc));
NewObjDesc, CurrentObjDesc));
/*
* Store this object to the Node
* (perform the indirect store)
*/
Status = AcpiExStoreObjectToNode (ObjDesc,
Status = AcpiExStoreObjectToNode (NewObjDesc,
CurrentObjDesc->Reference.Object, WalkState);
/* Remove local reference if we copied the object above */
if (NewObjDesc != ObjDesc)
{
AcpiUtRemoveReference (NewObjDesc);
}
return_ACPI_STATUS (Status);
}
}
@ -759,12 +781,19 @@ AcpiDsStoreObjectToLocal (
}
/*
* Install the ObjStack descriptor (*ObjDesc) into
* Install the Obj descriptor (*NewObjDesc) into
* the descriptor for the Arg or Local.
* Install the new object in the stack entry
* (increments the object reference count by one)
*/
Status = AcpiDsMethodDataSetValue (Opcode, Index, ObjDesc, WalkState);
Status = AcpiDsMethodDataSetValue (Opcode, Index, NewObjDesc, WalkState);
/* Remove local reference if we copied the object above */
if (NewObjDesc != ObjDesc)
{
AcpiUtRemoveReference (NewObjDesc);
}
return_ACPI_STATUS (Status);
}