FreeBSD/sys/contrib/dev/acpica/components/parser/psparse.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiPsNextParseState
 *
 * PARAMETERS:  WalkState           - Current state
 *              Op                  - Current parse op
 *              CallbackStatus      - Status from previous operation
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Update the parser state based upon the return exception from
 *              the parser callback.
 *
 ******************************************************************************/
AcpiPsNextParseState
PARAMETERS:  WalkState           - Current state
Op                  - Current parse op
CallbackStatus      - Status from previous operation

Status

Update the parser state based upon the return exception from
the parser callback.
AcpiPsNextParseState PARAMETERS : WalkState - Current state Op - Current parse op CallbackStatus - Status from previous operation Status Update the parser state based upon the return exception from the parser callback .
ACPI_STATUS
AcpiPsNextParseState (
    ACPI_WALK_STATE         *WalkState,
    ACPI_PARSE_OBJECT       *Op,
    ACPI_STATUS             CallbackStatus)
{
    ACPI_PARSE_STATE        *ParserState = &WalkState->ParserState;
    ACPI_STATUS             Status = AE_CTRL_PENDING;
    ACPI_FUNCTION_TRACE_PTR (PsNextParseState, Op);
    switch (CallbackStatus)
    {
    case AE_CTRL_TERMINATE:
        ParserState->Aml = ParserState->AmlEnd;
        Status = AE_CTRL_TERMINATE;
        break;
    case AE_CTRL_BREAK:
        ParserState->Aml = WalkState->AmlLastWhile;
        WalkState->ControlState->Common.Value = FALSE;
        Status = AE_CTRL_BREAK;
        break;
    case AE_CTRL_CONTINUE:
        ParserState->Aml = WalkState->AmlLastWhile;
        Status = AE_CTRL_CONTINUE;
        break;
    case AE_CTRL_PENDING:
        ParserState->Aml = WalkState->AmlLastWhile;
        break;
#if 0
    case AE_CTRL_SKIP:
        ParserState->Aml = ParserState->Scope->ParseScope.PkgEnd;
        Status = AE_OK;
        break;
#endif
    case AE_CTRL_TRUE:
        ParserState->Aml = AcpiPsGetNextPackageEnd (ParserState);
        Status = AE_CTRL_PENDING;
        break;
    case AE_CTRL_FALSE:
        ParserState->Aml = ParserState->Scope->ParseScope.PkgEnd;
        WalkState->ControlState->Common.Value = FALSE;
        Status = AE_CTRL_END;
        break;
    case AE_CTRL_TRANSFER:
        Status = AE_CTRL_TRANSFER;
        WalkState->PrevOp = Op;
        WalkState->MethodCallOp = Op;
        WalkState->MethodCallNode = (Op->Common.Value.Arg)->Common.Node;
        WalkState->ReturnUsed = AcpiDsIsResultUsed (Op, WalkState);
        break;
    default:
        Status = CallbackStatus;
        if ((CallbackStatus & AE_CODE_MASK) == AE_CODE_CONTROL)
        {
            Status = AE_OK;
        }
        break;
    }
    return_ACPI_STATUS (Status);
}
ACPI_STATUS AcpiPsNextParseState ( ACPI_WALK_STATE * WalkState , ACPI_PARSE_OBJECT * Op , ACPI_STATUS CallbackStatus ) { ACPI_PARSE_STATE * ParserState = & WalkState -> ParserState ; ACPI_STATUS Status = AE_CTRL_PENDING ; ACPI_FUNCTION_TRACE_PTR ( PsNextParseState , Op ) ; switch ( CallbackStatus ) { case AE_CTRL_TERMINATE : ParserState -> Aml = ParserState -> AmlEnd ; Status = AE_CTRL_TERMINATE ; break ; case AE_CTRL_BREAK : ParserState -> Aml = WalkState -> AmlLastWhile ; WalkState -> ControlState -> Common . Value = FALSE ; Status = AE_CTRL_BREAK ; break ; case AE_CTRL_CONTINUE : ParserState -> Aml = WalkState -> AmlLastWhile ; Status = AE_CTRL_CONTINUE ; break ; case AE_CTRL_PENDING : ParserState -> Aml = WalkState -> AmlLastWhile ; break ; #if 0 case AE_CTRL_SKIP : ParserState -> Aml = ParserState -> Scope -> ParseScope . PkgEnd ; Status = AE_OK ; break ; #endif case AE_CTRL_TRUE : ParserState -> Aml = AcpiPsGetNextPackageEnd ( ParserState ) ; Status = AE_CTRL_PENDING ; break ; case AE_CTRL_FALSE : ParserState -> Aml = ParserState -> Scope -> ParseScope . PkgEnd ; WalkState -> ControlState -> Common . Value = FALSE ; Status = AE_CTRL_END ; break ; case AE_CTRL_TRANSFER : Status = AE_CTRL_TRANSFER ; WalkState -> PrevOp = Op ; WalkState -> MethodCallOp = Op ; WalkState -> MethodCallNode = ( Op -> Common . Value . Arg ) -> Common . Node ; WalkState -> ReturnUsed = AcpiDsIsResultUsed ( Op , WalkState ) ; break ; default : Status = CallbackStatus ; if ( ( CallbackStatus & AE_CODE_MASK ) == AE_CODE_CONTROL ) { Status = AE_OK ; } break ; } return_ACPI_STATUS ( Status ) ; }
FUNCTION:    AcpiPsNextParseState
 PARAMETERS:  WalkState           - Current state
              Op                  - Current parse op
              CallbackStatus      - Status from previous operation
FUNCTION : AcpiPsNextParseState PARAMETERS : WalkState - Current state Op - Current parse op CallbackStatus - Status from previous operation
/*
         * A control method was terminated via a RETURN statement.
         * The walk of this method is complete.
         */ /*
         * Predicate of an IF was true, and we are at the matching ELSE.
         * Just close out this package
         */ /*
         * Either an IF/WHILE Predicate was false or we encountered a BREAK
         * opcode. In both cases, we do not execute the rest of the
         * package;  We simply close out the parent (finishing the walk of
         * this branch of the tree) and continue execution at the parent
         * level.
         */ /* In the case of a BREAK, just force a predicate (if any) to FALSE */ /* A method call (invocation) -- transfer control */ /* Will return value (if any) be used by the caller? */