Added low-level object copy

date	2001.11.30.22.21.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 18:26:03 +00:00
parent b55783d49f
commit 6a42e9fe61

View File

@ -2,7 +2,7 @@
*
* Module Name: nseval - Object evaluation interfaces -- includes control
* method lookup and execution.
* $Revision: 1.98 $
* $Revision: 1.105 $
*
******************************************************************************/
@ -188,7 +188,7 @@ AcpiNsEvaluateRelative (
AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
PrefixNode = AcpiNsConvertHandleToEntry (Handle);
PrefixNode = AcpiNsMapHandleToNode (Handle);
if (!PrefixNode)
{
AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
@ -217,7 +217,7 @@ AcpiNsEvaluateRelative (
* to evaluate it.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s [%p] Value %p\n",
Pathname, Node, Node->Object));
Pathname, Node, AcpiNsGetAttachedObject (Node)));
Status = AcpiNsEvaluateByHandle (Node, Params, ReturnObject);
@ -295,7 +295,7 @@ AcpiNsEvaluateByName (
* to evaluate it.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s [%p] Value %p\n",
Pathname, Node, Node->Object));
Pathname, Node, AcpiNsGetAttachedObject (Node)));
Status = AcpiNsEvaluateByHandle (Node, Params, ReturnObject);
@ -374,7 +374,7 @@ AcpiNsEvaluateByHandle (
AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
Node = AcpiNsConvertHandleToEntry (Handle);
Node = AcpiNsMapHandleToNode (Handle);
if (!Node)
{
AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
@ -492,13 +492,14 @@ AcpiNsExecuteControlMethod (
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Control method at Offset %x Length %lx]\n",
ObjDesc->Method.Pcode + 1, ObjDesc->Method.PcodeLength - 1));
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Control method at Offset %p Length %x]\n",
ObjDesc->Method.AmlStart + 1, ObjDesc->Method.AmlLength - 1));
DUMP_PATHNAME (MethodNode, "NsExecuteControlMethod: Executing",
ACPI_LV_NAMES, _COMPONENT);
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "At offset %8XH\n", ObjDesc->Method.Pcode + 1));
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "At offset %p\n",
ObjDesc->Method.AmlStart + 1));
/*
@ -548,7 +549,7 @@ AcpiNsGetObjectValue (
{
ACPI_STATUS Status = AE_OK;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_OPERAND_OBJECT *ValDesc;
ACPI_OPERAND_OBJECT *SourceDesc;
FUNCTION_TRACE ("NsGetObjectValue");
@ -561,7 +562,7 @@ AcpiNsGetObjectValue (
(Node->Type == ACPI_TYPE_POWER))
{
/*
* Create a Reference object to contain the object
* Create a new object of the same type as the return object
*/
ObjDesc = AcpiUtCreateInternalObject (Node->Type);
if (!ObjDesc)
@ -573,21 +574,16 @@ AcpiNsGetObjectValue (
/*
* Get the attached object
*/
ValDesc = AcpiNsGetAttachedObject (Node);
if (!ValDesc)
SourceDesc = AcpiNsGetAttachedObject (Node);
if (!SourceDesc)
{
Status = AE_NULL_OBJECT;
goto UnlockAndExit;
}
/*
* Just copy from the original to the return object
*
* TBD: [Future] - need a low-level object copy that handles
* the reference count automatically. (Don't want to copy it)
*/
MEMCPY (ObjDesc, ValDesc, sizeof (ACPI_OPERAND_OBJECT));
ObjDesc->Common.ReferenceCount = 1;
/* Just copy from the original to the return object */
AcpiUtCopySimpleObject (SourceDesc, ObjDesc);
AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
}
@ -633,7 +629,6 @@ AcpiNsGetObjectValue (
if (ACPI_SUCCESS (Status))
{
Status = AcpiExResolveToValue (&ObjDesc, NULL);
AcpiExExitInterpreter ();
}
}
@ -645,7 +640,6 @@ AcpiNsGetObjectValue (
if (ACPI_SUCCESS (Status))
{
Status = AE_CTRL_RETURN_VALUE;
*ReturnObjDesc = ObjDesc;
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Returning obj %p\n", *ReturnObjDesc));
}