summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/exstore.c
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2004-02-28 20:23:30 +0000
committernjl <njl@FreeBSD.org>2004-02-28 20:23:30 +0000
commit4335e07b6601dee959fdc8ee35b4cd21f3171c81 (patch)
tree885c1ceace8766961e3a5baedf4ef67ce438b844 /sys/contrib/dev/acpica/exstore.c
parent041f94a8baba77aa39abb282f948d95e42507781 (diff)
downloadFreeBSD-src-4335e07b6601dee959fdc8ee35b4cd21f3171c81.zip
FreeBSD-src-4335e07b6601dee959fdc8ee35b4cd21f3171c81.tar.gz
Vendor import of ACPICA 20040220
Diffstat (limited to 'sys/contrib/dev/acpica/exstore.c')
-rw-r--r--sys/contrib/dev/acpica/exstore.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/sys/contrib/dev/acpica/exstore.c b/sys/contrib/dev/acpica/exstore.c
index 4f55117..a86d17a 100644
--- a/sys/contrib/dev/acpica/exstore.c
+++ b/sys/contrib/dev/acpica/exstore.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exstore - AML Interpreter object store support
- * $Revision: 177 $
+ * $Revision: 180 $
*
*****************************************************************************/
@@ -10,7 +10,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -203,7 +203,7 @@ AcpiExStore (
default:
- /* Destination is not an Reference */
+ /* Destination is not a Reference object */
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Destination is not a Reference or Constant object [%p]\n", DestDesc));
@@ -269,35 +269,38 @@ AcpiExStore (
{
case ACPI_TYPE_INTEGER:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%8.8X%8.8X\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "0x%8.8X%8.8X\n",
ACPI_FORMAT_UINT64 (SourceDesc->Integer.Value)));
break;
case ACPI_TYPE_BUFFER:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Length %.2X\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Length 0x%.2X",
(UINT32) SourceDesc->Buffer.Length));
+ ACPI_DUMP_BUFFER (SourceDesc->Buffer.Pointer,
+ (SourceDesc->Buffer.Length < 32) ? SourceDesc->Buffer.Length : 32);
break;
case ACPI_TYPE_STRING:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%s\n", SourceDesc->String.Pointer));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Length 0x%.2X, \"%s\"\n",
+ SourceDesc->String.Length, SourceDesc->String.Pointer));
break;
case ACPI_TYPE_PACKAGE:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Elements Ptr - %p\n",
- SourceDesc->Package.Elements));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Size 0x%.2X Elements Ptr - %p\n",
+ SourceDesc->Package.Count, SourceDesc->Package.Elements));
break;
default:
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Type %s %p\n",
- AcpiUtGetObjectTypeName (SourceDesc), SourceDesc));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%p\n",
+ SourceDesc));
break;
}
@@ -307,7 +310,7 @@ AcpiExStore (
default:
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown Reference opcode %X\n",
+ ACPI_REPORT_ERROR (("ExStore: Unknown Reference opcode %X\n",
RefDesc->Reference.Opcode));
ACPI_DUMP_ENTRY (RefDesc, ACPI_LV_ERROR);
@@ -343,6 +346,7 @@ AcpiExStoreObjectToIndex (
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_OPERAND_OBJECT *NewDesc;
UINT8 Value = 0;
+ UINT32 i;
ACPI_FUNCTION_TRACE ("ExStoreObjectToIndex");
@@ -364,6 +368,7 @@ AcpiExStoreObjectToIndex (
/*
* The object at *(IndexDesc->Reference.Where) is the
* element within the package that is to be modified.
+ * The parent package object is at IndexDesc->Reference.Object
*/
ObjDesc = *(IndexDesc->Reference.Where);
@@ -389,7 +394,14 @@ AcpiExStoreObjectToIndex (
/* If same as the original source, add a reference */
- if (NewDesc == SourceDesc || ObjDesc == NULL)
+ if (NewDesc == SourceDesc)
+ {
+ AcpiUtAddReference (NewDesc);
+ }
+
+ /* Increment reference count by the ref count of the parent package -1 */
+
+ for (i = 1; i < ((ACPI_OPERAND_OBJECT *) IndexDesc->Reference.Object)->Common.ReferenceCount; i++)
{
AcpiUtAddReference (NewDesc);
}
OpenPOWER on IntegriCloud