summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/utobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/utobject.c')
-rw-r--r--sys/contrib/dev/acpica/utobject.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/sys/contrib/dev/acpica/utobject.c b/sys/contrib/dev/acpica/utobject.c
index 52979a3..b8fa4ab 100644
--- a/sys/contrib/dev/acpica/utobject.c
+++ b/sys/contrib/dev/acpica/utobject.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utobject - ACPI object create/delete/size/cache routines
- * $Revision: 57 $
+ * $Revision: 61 $
*
*****************************************************************************/
@@ -157,6 +157,7 @@ AcpiUtCreateInternalObjectDbg (
ACPI_OBJECT_TYPE8 Type)
{
ACPI_OPERAND_OBJECT *Object;
+ ACPI_OPERAND_OBJECT *SecondObject;
FUNCTION_TRACE_STR ("UtCreateInternalObjectDbg", AcpiUtGetTypeName (Type));
@@ -167,11 +168,32 @@ AcpiUtCreateInternalObjectDbg (
Object = AcpiUtAllocateObjectDescDbg (ModuleName, LineNumber, ComponentId);
if (!Object)
{
- /* Allocation failure */
-
return_PTR (NULL);
}
+ switch (Type)
+ {
+ case ACPI_TYPE_REGION:
+ case ACPI_TYPE_BUFFER_FIELD:
+
+ /* These types require a secondary object */
+
+ SecondObject = AcpiUtAllocateObjectDescDbg (ModuleName, LineNumber, ComponentId);
+ if (!SecondObject)
+ {
+ AcpiUtDeleteObjectDesc (Object);
+ return_PTR (NULL);
+ }
+
+ SecondObject->Common.Type = INTERNAL_TYPE_EXTRA;
+ SecondObject->Common.ReferenceCount = 1;
+
+ /* Link the second object to the first */
+
+ Object->Common.NextObject = SecondObject;
+ break;
+ }
+
/* Save the object type in the object descriptor */
Object->Common.Type = Type;
@@ -355,7 +377,6 @@ AcpiUtDeleteObjectCache (
}
-
/*******************************************************************************
*
* FUNCTION: AcpiUtGetSimpleObjectSize
@@ -578,6 +599,10 @@ AcpiUtGetPackageObjectSize (
Status = AcpiUtWalkPackageTree (InternalObject, NULL,
AcpiUtGetElementLength, &Info);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
/*
* We have handled all of the objects in all levels of the package.
OpenPOWER on IntegriCloud