summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/dswexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/dswexec.c')
-rw-r--r--sys/contrib/dev/acpica/dswexec.c67
1 files changed, 50 insertions, 17 deletions
diff --git a/sys/contrib/dev/acpica/dswexec.c b/sys/contrib/dev/acpica/dswexec.c
index ba8df46..f9bfe8e 100644
--- a/sys/contrib/dev/acpica/dswexec.c
+++ b/sys/contrib/dev/acpica/dswexec.c
@@ -2,7 +2,7 @@
*
* Module Name: dswexec - Dispatcher method execution callbacks;
* dispatch to interpreter.
- * $Revision: 64 $
+ * $Revision: 70 $
*
*****************************************************************************/
@@ -200,7 +200,6 @@ AcpiDsGetPredicateValue (
* Result of predicate evaluation currently must
* be a number
*/
-
if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
@@ -220,7 +219,6 @@ AcpiDsGetPredicateValue (
* Save the result of the predicate evaluation on
* the control stack
*/
-
if (ObjDesc->Integer.Value)
{
WalkState->ControlState->Common.Value = TRUE;
@@ -232,7 +230,6 @@ AcpiDsGetPredicateValue (
* Predicate is FALSE, we will just toss the
* rest of the package
*/
-
WalkState->ControlState->Common.Value = FALSE;
Status = AE_CTRL_FALSE;
}
@@ -251,11 +248,9 @@ Cleanup:
* Delete the predicate result object (we know that
* we don't need it anymore)
*/
-
AcpiUtRemoveReference (ObjDesc);
WalkState->ControlState->Common.State = CONTROL_NORMAL;
-
return_ACPI_STATUS (Status);
}
@@ -283,8 +278,9 @@ AcpiDsExecBeginOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT **OutOp)
{
- ACPI_OPCODE_INFO *OpInfo;
+ const ACPI_OPCODE_INFO *OpInfo;
ACPI_STATUS Status = AE_OK;
+ UINT8 OpcodeClass;
FUNCTION_TRACE_PTR ("DsExecBeginOp", Op);
@@ -316,7 +312,6 @@ AcpiDsExecBeginOp (
* must be the beginning of the associated predicate.
* Save this knowledge in the current scope descriptor
*/
-
if ((WalkState->ControlState) &&
(WalkState->ControlState->Common.State ==
CONTROL_CONDITIONAL_EXECUTING))
@@ -333,20 +328,19 @@ AcpiDsExecBeginOp (
OpInfo = AcpiPsGetOpcodeInfo (Op->Opcode);
+ OpcodeClass = (UINT8) ACPI_GET_OP_CLASS (OpInfo);
/* We want to send namepaths to the load code */
if (Op->Opcode == AML_INT_NAMEPATH_OP)
{
- OpInfo->Flags = OPTYPE_NAMED_OBJECT;
+ OpcodeClass = OPTYPE_NAMED_OBJECT;
}
-
/*
* Handle the opcode based upon the opcode type
*/
-
- switch (ACPI_GET_OP_CLASS (OpInfo))
+ switch (OpcodeClass)
{
case OPTYPE_CONTROL:
@@ -371,7 +365,6 @@ AcpiDsExecBeginOp (
* will be deleted upon completion of the execution
* of this method.
*/
-
Status = AcpiDsLoad2BeginOp (Op->Opcode, Op, WalkState, NULL);
}
@@ -442,7 +435,8 @@ AcpiDsExecEndOp (
ACPI_PARSE_OBJECT *NextOp;
ACPI_PARSE_OBJECT *FirstArg;
ACPI_OPERAND_OBJECT *ResultObj = NULL;
- ACPI_OPCODE_INFO *OpInfo;
+ const ACPI_OPCODE_INFO *OpInfo;
+ UINT32 i;
FUNCTION_TRACE_PTR ("DsExecEndOp", Op);
@@ -530,6 +524,36 @@ AcpiDsExecEndOp (
goto Cleanup;
}
+ /* Resolve all operands */
+
+ Status = AcpiExResolveOperands (Opcode,
+ &(WalkState->Operands [WalkState->NumOperands -1]),
+ WalkState);
+ if (ACPI_FAILURE (Status))
+ {
+ /* TBD: must pop and delete operands */
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "[%s]: Could not resolve operands, %s\n",
+ AcpiPsGetOpcodeName (Opcode), AcpiFormatException (Status)));
+
+ /*
+ * On error, we must delete all the operands and clear the
+ * operand stack
+ */
+ for (i = 0; i < WalkState->NumOperands; i++)
+ {
+ AcpiUtRemoveReference (WalkState->Operands[i]);
+ WalkState->Operands[i] = NULL;
+ }
+
+ WalkState->NumOperands = 0;
+
+ goto Cleanup;
+ }
+
+ DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE, AcpiPsGetOpcodeName (Opcode),
+ WalkState->NumOperands, "after ExResolveOperands");
+
switch (Optype)
{
case OPTYPE_MONADIC1:
@@ -595,9 +619,11 @@ AcpiDsExecEndOp (
Status = AcpiExTriadic (Opcode, WalkState, &ResultObj);
break;
+
case OPTYPE_QUADRADIC: /* Opcode with 4 operands */
break;
+
case OPTYPE_HEXADIC: /* Opcode with 6 operands */
/* 6 Operands, 0 ExternalResult, 1 InternalResult */
@@ -614,6 +640,14 @@ AcpiDsExecEndOp (
break;
}
+ /* Clear the operand stack */
+
+ for (i = 0; i < WalkState->NumOperands; i++)
+ {
+ WalkState->Operands[i] = NULL;
+ }
+ WalkState->NumOperands = 0;
+
/*
* If a result object was returned from above, push it on the
* current result stack
@@ -668,7 +702,6 @@ AcpiDsExecEndOp (
* references here (Local variables, arguments
* to *this* method, etc.)
*/
-
Status = AcpiDsResolveOperands (WalkState);
if (ACPI_FAILURE (Status))
{
@@ -691,7 +724,7 @@ AcpiDsExecEndOp (
case OPTYPE_CREATE_FIELD:
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Executing CreateField Buffer/Index Op=%X\n", Op));
Status = AcpiDsLoad2EndOp (WalkState, Op);
@@ -751,7 +784,7 @@ AcpiDsExecEndOp (
default:
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Unimplemented opcode, type=%X Opcode=%X Op=%X\n",
Optype, Op->Opcode, Op));
OpenPOWER on IntegriCloud