diff options
author | njl <njl@FreeBSD.org> | 2003-07-13 22:52:51 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2003-07-13 22:52:51 +0000 |
commit | d0931ce8bb6f6c2762d49bd76e28fe6e6691f2a5 (patch) | |
tree | 7e5274aaae84f015543bb5916be0d5cc1e61cb00 /sys | |
parent | cdeb778dc4e5a412f52a3fa942ac477dba9620ec (diff) | |
parent | 05a34bb4660e12e1bad2b826032f6274d01f2e31 (diff) | |
download | FreeBSD-src-d0931ce8bb6f6c2762d49bd76e28fe6e6691f2a5.zip FreeBSD-src-d0931ce8bb6f6c2762d49bd76e28fe6e6691f2a5.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r117527,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/contrib/dev/acpica/dsmthdat.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/sys/contrib/dev/acpica/dsmthdat.c b/sys/contrib/dev/acpica/dsmthdat.c index 3515957..ed3d14e 100644 --- a/sys/contrib/dev/acpica/dsmthdat.c +++ b/sys/contrib/dev/acpica/dsmthdat.c @@ -392,6 +392,7 @@ AcpiDsMethodDataSetValue ( { ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node; + ACPI_OPERAND_OBJECT *NewDesc = Object; ACPI_FUNCTION_TRACE ("DsMethodDataSetValue"); @@ -410,17 +411,32 @@ AcpiDsMethodDataSetValue ( return_ACPI_STATUS (Status); } - /* - * Increment ref count so object can't be deleted while installed. - * NOTE: We do not copy the object in order to preserve the call by - * reference semantics of ACPI Control Method invocation. - * (See ACPI Specification 2.0C) + /* + * If the object has just been created and is not attached to anything, + * (the reference count is 1), then we can just store it directly into + * the arg/local. Otherwise, we must copy it. */ - AcpiUtAddReference (Object); + if (Object->Common.ReferenceCount > 1) + { + Status = AcpiUtCopyIobjectToIobject (Object, &NewDesc, WalkState); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Object Copied %p, new %p\n", + Object, NewDesc)); + } + else + { + /* Increment ref count so object can't be deleted while installed */ + + AcpiUtAddReference (NewDesc); + } /* Install the object */ - Node->Object = Object; + Node->Object = NewDesc; return_ACPI_STATUS (Status); } |