summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrmoore1 <rmoore1>2008-01-23 22:19:31 +0000
committerrmoore1 <rmoore1>2008-01-23 22:19:31 +0000
commitf710c3b2e461fbb99c89b034c67963209f970ff8 (patch)
tree7b3c0c61ee456922498a671cb08e8c2677d49325
parent27acc4211a8adb6f5b871cf053a2a8b6c93870fd (diff)
Fixes for Unload and DDBHandles.
Implemented support for the use of DDBHandles as an Indexed Reference, as per the ACPI spec. (Lin Ming) BZ 486. Implemented support for UserTerm (Method invocation) for the Unload operator as per the ACPI spec. (Lin Ming) BZ 580
-rw-r--r--source/compiler/aslanalyze.c8
-rw-r--r--source/compiler/asllookup.c3
-rw-r--r--source/components/executer/exdump.c20
-rw-r--r--source/components/executer/exresolv.c16
-rw-r--r--source/components/executer/exstore.c21
-rw-r--r--source/components/parser/psargs.c36
-rw-r--r--source/components/utilities/utcopy.c11
7 files changed, 95 insertions, 20 deletions
diff --git a/source/compiler/aslanalyze.c b/source/compiler/aslanalyze.c
index baf5c99b9..6f4bf0068 100644
--- a/source/compiler/aslanalyze.c
+++ b/source/compiler/aslanalyze.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: aslanalyze.c - check for semantic errors
- * $Revision: 1.117 $
+ * $Revision: 1.118 $
*
*****************************************************************************/
@@ -272,7 +272,11 @@ AnMapArgTypeToBtype (
return (ACPI_BTYPE_MUTEX);
case ARGI_DDBHANDLE:
- return (ACPI_BTYPE_DDB_HANDLE);
+ /*
+ * DDBHandleObject := SuperName
+ * ACPI_BTYPE_REFERENCE: Index reference as parameter of Load/Unload
+ */
+ return (ACPI_BTYPE_DDB_HANDLE | ACPI_BTYPE_REFERENCE);
/* Interchangeable types */
/*
diff --git a/source/compiler/asllookup.c b/source/compiler/asllookup.c
index 4830170c4..3592be3ba 100644
--- a/source/compiler/asllookup.c
+++ b/source/compiler/asllookup.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: asllookup- Namespace lookup
- * $Revision: 1.105 $
+ * $Revision: 1.106 $
*
*****************************************************************************/
@@ -468,7 +468,6 @@ LsDoOnePathname (
ACPI_BUFFER TargetPath;
-
TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiNsHandleToPathname (Node, &TargetPath);
if (ACPI_FAILURE (Status))
diff --git a/source/components/executer/exdump.c b/source/components/executer/exdump.c
index 43e008b69..5b52e5b43 100644
--- a/source/components/executer/exdump.c
+++ b/source/components/executer/exdump.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exdump - Interpreter debug output routines
- * $Revision: 1.205 $
+ * $Revision: 1.206 $
*
*****************************************************************************/
@@ -1045,9 +1045,21 @@ AcpiExDumpReferenceObj (
{
if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND)
{
- AcpiOsPrintf (" Target: %p [%s]\n",
- ObjDesc->Reference.Object,
- AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *) ObjDesc->Reference.Object)->Common.Type));
+ AcpiOsPrintf (" Target: %p", ObjDesc->Reference.Object);
+ if (ObjDesc->Reference.Opcode == AML_LOAD_OP)
+ {
+ /*
+ * For DDBHandle reference,
+ * ObjDesc->Reference.Object is the table index
+ */
+ AcpiOsPrintf (" [DDBHandle]\n");
+ }
+ else
+ {
+ AcpiOsPrintf (" [%s]\n",
+ AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *)
+ ObjDesc->Reference.Object)->Common.Type));
+ }
}
else
{
diff --git a/source/components/executer/exresolv.c b/source/components/executer/exresolv.c
index 978440dab..6f1c956c5 100644
--- a/source/components/executer/exresolv.c
+++ b/source/components/executer/exresolv.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exresolv - AML Interpreter object resolution
- * $Revision: 1.145 $
+ * $Revision: 1.146 $
*
*****************************************************************************/
@@ -477,10 +477,10 @@ AcpiExResolveMultiple (
}
/*
- * For reference objects created via the RefOf or Index operators,
- * we need to get to the base object (as per the ACPI specification
- * of the ObjectType and SizeOf operators). This means traversing
- * the list of possibly many nested references.
+ * For reference objects created via the RefOf, Index, or Load/LoadTable
+ * operators, we need to get to the base object (as per the ACPI
+ * specification of the ObjectType and SizeOf operators). This means
+ * traversing the list of possibly many nested references.
*/
while (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_LOCAL_REFERENCE)
{
@@ -558,6 +558,12 @@ AcpiExResolveMultiple (
break;
+ case AML_LOAD_OP:
+
+ Type = ACPI_TYPE_DDB_HANDLE;
+ goto Exit;
+
+
case AML_LOCAL_OP:
case AML_ARG_OP:
diff --git a/source/components/executer/exstore.c b/source/components/executer/exstore.c
index d11aa47af..b4ff43de1 100644
--- a/source/components/executer/exstore.c
+++ b/source/components/executer/exstore.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exstore - AML Interpreter object store support
- * $Revision: 1.207 $
+ * $Revision: 1.208 $
*
*****************************************************************************/
@@ -527,10 +527,23 @@ AcpiExStoreObjectToIndex (
*/
ObjDesc = *(IndexDesc->Reference.Where);
- Status = AcpiUtCopyIobjectToIobject (SourceDesc, &NewDesc, WalkState);
- if (ACPI_FAILURE (Status))
+ if (ACPI_GET_OBJECT_TYPE (SourceDesc) == ACPI_TYPE_LOCAL_REFERENCE &&
+ SourceDesc->Reference.Opcode == AML_LOAD_OP)
{
- return_ACPI_STATUS (Status);
+ /* This is a DDBHandle, just add a reference to it */
+
+ AcpiUtAddReference (SourceDesc);
+ NewDesc = SourceDesc;
+ }
+ else
+ {
+ /* Normal object, copy it */
+
+ Status = AcpiUtCopyIobjectToIobject (SourceDesc, &NewDesc, WalkState);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
}
if (ObjDesc)
diff --git a/source/components/parser/psargs.c b/source/components/parser/psargs.c
index 96cf36e66..6e9bf9d6c 100644
--- a/source/components/parser/psargs.c
+++ b/source/components/parser/psargs.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psargs - Parse AML opcode arguments
- * $Revision: 1.94 $
+ * $Revision: 1.95 $
*
*****************************************************************************/
@@ -334,6 +334,7 @@ AcpiPsGetNextNamepath (
ACPI_PARSE_OBJECT *NameOp;
ACPI_OPERAND_OBJECT *MethodDesc;
ACPI_NAMESPACE_NODE *Node;
+ UINT8 *Start = ParserState->Aml;
ACPI_FUNCTION_TRACE (PsGetNextNamepath);
@@ -370,6 +371,18 @@ AcpiPsGetNextNamepath (
PossibleMethodCall &&
(Node->Type == ACPI_TYPE_METHOD))
{
+ if (WalkState->Op->Common.AmlOpcode == AML_UNLOAD_OP)
+ {
+ /*
+ * AcpiPsGetNextNamestring has increased the AML pointer,
+ * so we need to restore the saved AML pointer for method call.
+ */
+ WalkState->ParserState.Aml = Start;
+ WalkState->ArgCount = 1;
+ AcpiPsInitOp (Arg, AML_INT_METHODCALL_OP);
+ return_ACPI_STATUS (AE_OK);
+ }
+
/* This name is actually a control method invocation */
MethodDesc = AcpiNsGetAttachedObject (Node);
@@ -816,7 +829,26 @@ AcpiPsGetNextArg (
return_ACPI_STATUS (AE_NO_MEMORY);
}
- Status = AcpiPsGetNextNamepath (WalkState, ParserState, Arg, 0);
+ /* To support SuperName arg of Unload */
+
+ if (WalkState->Op->Common.AmlOpcode == AML_UNLOAD_OP)
+ {
+ Status = AcpiPsGetNextNamepath (WalkState, ParserState, Arg, 1);
+
+ /*
+ * If the SuperName arg of Unload is a method call,
+ * we have restored the AML pointer, just free this Arg
+ */
+ if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP)
+ {
+ AcpiPsFreeOp (Arg);
+ Arg = NULL;
+ }
+ }
+ else
+ {
+ Status = AcpiPsGetNextNamepath (WalkState, ParserState, Arg, 0);
+ }
}
else
{
diff --git a/source/components/utilities/utcopy.c b/source/components/utilities/utcopy.c
index a2a363cc5..2eb544398 100644
--- a/source/components/utilities/utcopy.c
+++ b/source/components/utilities/utcopy.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utcopy - Internal to external object translation utilities
- * $Revision: 1.133 $
+ * $Revision: 1.134 $
*
*****************************************************************************/
@@ -832,7 +832,16 @@ AcpiUtCopySimpleObject (
/*
* We copied the reference object, so we now must add a reference
* to the object pointed to by the reference
+ *
+ * DDBHandle reference (from Load/LoadTable is a special reference,
+ * it's Reference.Object is the table index, so does not need to
+ * increase the reference count
*/
+ if (SourceDesc->Reference.Opcode == AML_LOAD_OP)
+ {
+ break;
+ }
+
AcpiUtAddReference (SourceDesc->Reference.Object);
break;