aboutsummaryrefslogtreecommitdiff
path: root/source/components/utilities/utdelete.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2012-11-14 22:20:16 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2012-11-14 22:20:16 +0000
commitc2463a8709e5b3a5ce54c09d35b4820a756b0fc5 (patch)
tree2ffc551e57f0545a17c165d729c1438a26236f60 /source/components/utilities/utdelete.c
parent31aa864e8c068201d58aad3a8f82ddb51df11015 (diff)
downloadsrc-c2463a8709e5b3a5ce54c09d35b4820a756b0fc5.tar.gz
src-c2463a8709e5b3a5ce54c09d35b4820a756b0fc5.zip
Import ACPICA 20121114.vendor/acpica/20121114
Notes
Notes: svn path=/vendor-sys/acpica/dist/; revision=243044 svn path=/vendor-sys/acpica/20121114/; revision=243045; tag=vendor/acpica/20121114
Diffstat (limited to 'source/components/utilities/utdelete.c')
-rw-r--r--source/components/utilities/utdelete.c66
1 files changed, 46 insertions, 20 deletions
diff --git a/source/components/utilities/utdelete.c b/source/components/utilities/utdelete.c
index 4ed629762768..d526e0d27891 100644
--- a/source/components/utilities/utdelete.c
+++ b/source/components/utilities/utdelete.c
@@ -368,7 +368,7 @@ AcpiUtDeleteInternalObjectList (
ACPI_OPERAND_OBJECT **InternalObj;
- ACPI_FUNCTION_TRACE (UtDeleteInternalObjectList);
+ ACPI_FUNCTION_NAME (UtDeleteInternalObjectList);
/* Walk the null-terminated internal list */
@@ -381,7 +381,7 @@ AcpiUtDeleteInternalObjectList (
/* Free the combined parameter pointer list and object array */
ACPI_FREE (ObjList);
- return_VOID;
+ return;
}
@@ -528,7 +528,7 @@ AcpiUtUpdateObjectReference (
UINT32 i;
- ACPI_FUNCTION_TRACE_PTR (UtUpdateObjectReference, Object);
+ ACPI_FUNCTION_NAME (UtUpdateObjectReference);
while (Object)
@@ -539,7 +539,7 @@ AcpiUtUpdateObjectReference (
{
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
"Object %p is NS handle\n", Object));
- return_ACPI_STATUS (AE_OK);
+ return (AE_OK);
}
/*
@@ -577,17 +577,43 @@ AcpiUtUpdateObjectReference (
for (i = 0; i < Object->Package.Count; i++)
{
/*
- * Push each element onto the stack for later processing.
- * Note: There can be null elements within the package,
- * these are simply ignored
+ * Null package elements are legal and can be simply
+ * ignored.
*/
- Status = AcpiUtCreateUpdateStateAndPush (
- Object->Package.Elements[i], Action, &StateList);
- if (ACPI_FAILURE (Status))
+ NextObject = Object->Package.Elements[i];
+ if (!NextObject)
+ {
+ continue;
+ }
+
+ switch (NextObject->Common.Type)
{
- goto ErrorExit;
+ case ACPI_TYPE_INTEGER:
+ case ACPI_TYPE_STRING:
+ case ACPI_TYPE_BUFFER:
+ /*
+ * For these very simple sub-objects, we can just
+ * update the reference count here and continue.
+ * Greatly increases performance of this operation.
+ */
+ AcpiUtUpdateRefCount (NextObject, Action);
+ break;
+
+ default:
+ /*
+ * For complex sub-objects, push them onto the stack
+ * for later processing (this eliminates recursion.)
+ */
+ Status = AcpiUtCreateUpdateStateAndPush (
+ NextObject, Action, &StateList);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ErrorExit;
+ }
+ break;
}
}
+ NextObject = NULL;
break;
case ACPI_TYPE_BUFFER_FIELD:
@@ -663,7 +689,7 @@ AcpiUtUpdateObjectReference (
}
}
- return_ACPI_STATUS (AE_OK);
+ return (AE_OK);
ErrorExit:
@@ -679,7 +705,7 @@ ErrorExit:
AcpiUtDeleteGenericState (State);
}
- return_ACPI_STATUS (Status);
+ return (Status);
}
@@ -701,14 +727,14 @@ AcpiUtAddReference (
ACPI_OPERAND_OBJECT *Object)
{
- ACPI_FUNCTION_TRACE_PTR (UtAddReference, Object);
+ ACPI_FUNCTION_NAME (UtAddReference);
/* Ensure that we have a valid object */
if (!AcpiUtValidInternalObject (Object))
{
- return_VOID;
+ return;
}
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
@@ -718,7 +744,7 @@ AcpiUtAddReference (
/* Increment the reference count */
(void) AcpiUtUpdateObjectReference (Object, REF_INCREMENT);
- return_VOID;
+ return;
}
@@ -739,7 +765,7 @@ AcpiUtRemoveReference (
ACPI_OPERAND_OBJECT *Object)
{
- ACPI_FUNCTION_TRACE_PTR (UtRemoveReference, Object);
+ ACPI_FUNCTION_NAME (UtRemoveReference);
/*
@@ -751,14 +777,14 @@ AcpiUtRemoveReference (
(ACPI_GET_DESCRIPTOR_TYPE (Object) == ACPI_DESC_TYPE_NAMED))
{
- return_VOID;
+ return;
}
/* Ensure that we have a valid object */
if (!AcpiUtValidInternalObject (Object))
{
- return_VOID;
+ return;
}
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
@@ -771,5 +797,5 @@ AcpiUtRemoveReference (
* of all subobjects!)
*/
(void) AcpiUtUpdateObjectReference (Object, REF_DECREMENT);
- return_VOID;
+ return;
}