diff options
author | iwasaki <iwasaki@FreeBSD.org> | 2002-08-29 01:51:24 +0000 |
---|---|---|
committer | iwasaki <iwasaki@FreeBSD.org> | 2002-08-29 01:51:24 +0000 |
commit | 1824f192010fc0c0826e9889892e534075b58793 (patch) | |
tree | bbc04a2733724f3f0ab5cecb259948ac9a9723d7 /sys/contrib/dev/acpica/dsmthdat.c | |
parent | 3f86517f16a9cf970e93e483e90066da6eb323dd (diff) | |
download | FreeBSD-src-1824f192010fc0c0826e9889892e534075b58793.zip FreeBSD-src-1824f192010fc0c0826e9889892e534075b58793.tar.gz |
Vendor import of the Intel ACPI CA 20020815 drop.
Diffstat (limited to 'sys/contrib/dev/acpica/dsmthdat.c')
-rw-r--r-- | sys/contrib/dev/acpica/dsmthdat.c | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/sys/contrib/dev/acpica/dsmthdat.c b/sys/contrib/dev/acpica/dsmthdat.c index 12bfc85..e466158 100644 --- a/sys/contrib/dev/acpica/dsmthdat.c +++ b/sys/contrib/dev/acpica/dsmthdat.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dsmthdat - control method arguments and local variables - * $Revision: 62 $ + * $Revision: 63 $ * ******************************************************************************/ @@ -704,24 +704,43 @@ AcpiDsStoreObjectToLocal ( * * Weird, but true. */ - if ((Opcode == AML_ARG_OP) && - (ACPI_GET_DESCRIPTOR_TYPE (CurrentObjDesc) == ACPI_DESC_TYPE_NAMED)) + if (Opcode == AML_ARG_OP) { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Arg (%p) is an ObjRef(Node), storing in node %p\n", - ObjDesc, CurrentObjDesc)); - - /* Detach an existing object from the Node */ - - AcpiNsDetachObject ((ACPI_NAMESPACE_NODE *) CurrentObjDesc); - - /* - * Store this object into the Node - * (perform the indirect store) + /* + * Make sure that the object is the correct type. This may be overkill, but + * it is here because references were NS nodes in the past. Now they are + * operand objects of type Reference. */ - Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) CurrentObjDesc, - ObjDesc, ACPI_GET_OBJECT_TYPE (ObjDesc)); - return_ACPI_STATUS (Status); + if (ACPI_GET_DESCRIPTOR_TYPE (CurrentObjDesc) != ACPI_DESC_TYPE_OPERAND) + { + ACPI_REPORT_ERROR (("Invalid descriptor type while storing to method arg: %X\n", + CurrentObjDesc->Common.Type)); + return_ACPI_STATUS (AE_AML_INTERNAL); + } + + /* + * If we have a valid reference object that came from RefOf(), do the + * indirect store + */ + if ((CurrentObjDesc->Common.Type == INTERNAL_TYPE_REFERENCE) && + (CurrentObjDesc->Reference.Opcode == AML_REF_OF_OP)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "Arg (%p) is an ObjRef(Node), storing in node %p\n", + ObjDesc, CurrentObjDesc)); + + /* Detach an existing object from the referenced Node */ + + AcpiNsDetachObject (CurrentObjDesc->Reference.Object); + + /* + * Store this object into the Node + * (perform the indirect store) + */ + Status = AcpiNsAttachObject (CurrentObjDesc->Reference.Object, + ObjDesc, ACPI_GET_OBJECT_TYPE (ObjDesc)); + return_ACPI_STATUS (Status); + } } /* |