summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/nsxfeval.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/nsxfeval.c')
-rw-r--r--sys/contrib/dev/acpica/nsxfeval.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/sys/contrib/dev/acpica/nsxfeval.c b/sys/contrib/dev/acpica/nsxfeval.c
index cc75b68..4184bff 100644
--- a/sys/contrib/dev/acpica/nsxfeval.c
+++ b/sys/contrib/dev/acpica/nsxfeval.c
@@ -2,7 +2,7 @@
*
* Module Name: nsxfeval - Public interfaces to the ACPI subsystem
* ACPI Object evaluation interfaces
- * $Revision: 11 $
+ * $Revision: 12 $
*
******************************************************************************/
@@ -120,6 +120,7 @@
#include "acpi.h"
#include "acnamesp.h"
+#include "acinterp.h"
#define _COMPONENT ACPI_NAMESPACE
@@ -231,11 +232,11 @@ AcpiEvaluateObjectTyped (
* FUNCTION: AcpiEvaluateObject
*
* PARAMETERS: Handle - Object handle (optional)
- * *Pathname - Object pathname (optional)
- * **ExternalParams - List of parameters to pass to method,
+ * Pathname - Object pathname (optional)
+ * ExternalParams - List of parameters to pass to method,
* terminated by NULL. May be NULL
* if no parameters are being passed.
- * *ReturnBuffer - Where to put method's return value (if
+ * ReturnBuffer - Where to put method's return value (if
* any). If NULL, no value is returned.
*
* RETURN: Status
@@ -254,6 +255,7 @@ AcpiEvaluateObject (
ACPI_BUFFER *ReturnBuffer)
{
ACPI_STATUS Status;
+ ACPI_STATUS Status2;
ACPI_OPERAND_OBJECT **InternalParams = NULL;
ACPI_OPERAND_OBJECT *InternalReturnObj = NULL;
ACPI_SIZE BufferSpaceNeeded;
@@ -288,7 +290,7 @@ AcpiEvaluateObject (
for (i = 0; i < ExternalParams->Count; i++)
{
Status = AcpiUtCopyEobjectToIobject (&ExternalParams->Pointer[i],
- &InternalParams[i]);
+ &InternalParams[i]);
if (ACPI_FAILURE (Status))
{
AcpiUtDeleteInternalObjectList (InternalParams);
@@ -422,15 +424,22 @@ AcpiEvaluateObject (
}
}
- /* Delete the return and parameter objects */
-
if (InternalReturnObj)
{
- /*
- * Delete the internal return object. (Or at least
- * decrement the reference count by one)
+ /*
+ * Delete the internal return object. NOTE: Interpreter
+ * must be locked to avoid race condition.
*/
- AcpiUtRemoveReference (InternalReturnObj);
+ Status2 = AcpiExEnterInterpreter ();
+ if (ACPI_SUCCESS (Status2))
+ {
+ /*
+ * Delete the internal return object. (Or at least
+ * decrement the reference count by one)
+ */
+ AcpiUtRemoveReference (InternalReturnObj);
+ AcpiExExitInterpreter ();
+ }
}
/*
OpenPOWER on IntegriCloud