diff options
author | Mike Smith <msmith@FreeBSD.org> | 2001-09-07 01:22:25 +0000 |
---|---|---|
committer | Mike Smith <msmith@FreeBSD.org> | 2001-09-07 01:22:25 +0000 |
commit | 7fb2c1c6169b76180d4ee5c3147edf4da2fdd083 (patch) | |
tree | ba0c24c50a259baa38d43cef66fae1699ec4f152 /sys/contrib/dev/acpica/dswexec.c | |
parent | 2ee2f9cb7457edd22680e19323177347cd0aabff (diff) | |
download | src-7fb2c1c6169b76180d4ee5c3147edf4da2fdd083.tar.gz src-7fb2c1c6169b76180d4ee5c3147edf4da2fdd083.zip |
Vendor-branch import of the Intel ACPI CA 20010831 snapshot.
Notes
Notes:
svn path=/vendor-sys/acpica/dist/; revision=83174
Diffstat (limited to 'sys/contrib/dev/acpica/dswexec.c')
-rw-r--r-- | sys/contrib/dev/acpica/dswexec.c | 67 |
1 files changed, 50 insertions, 17 deletions
diff --git a/sys/contrib/dev/acpica/dswexec.c b/sys/contrib/dev/acpica/dswexec.c index ba8df46130b3..f9bfe8edb116 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)); |