FreeBSD/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiDsCreateBankField
 *
 * PARAMETERS:  Op              - Op containing the Field definition and args
 *              RegionNode      - Object for the containing Operation Region
 *              WalkState       - Current method state
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Create a new bank field in the specified operation region
 *
 ******************************************************************************/
AcpiDsCreateBankField
PARAMETERS:  Op              - Op containing the Field definition and args
RegionNode      - Object for the containing Operation Region
WalkState       - Current method state

Status

Create a new bank field in the specified operation region
AcpiDsCreateBankField PARAMETERS : Op - Op containing the Field definition and args RegionNode - Object for the containing Operation Region WalkState - Current method state Status Create a new bank field in the specified operation region
ACPI_STATUS
AcpiDsCreateBankField (
    ACPI_PARSE_OBJECT       *Op,
    ACPI_NAMESPACE_NODE     *RegionNode,
    ACPI_WALK_STATE         *WalkState)
{
    ACPI_STATUS             Status;
    ACPI_PARSE_OBJECT       *Arg;
    ACPI_CREATE_FIELD_INFO  Info;
    ACPI_FUNCTION_TRACE_PTR (DsCreateBankField, Op);
    Arg = Op->Common.Value.Arg;
    if (!RegionNode)
    {
        Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name,
            ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
            ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
#ifdef ACPI_ASL_COMPILER
        Status = AcpiDsCreateExternalRegion (Status, Arg,
            Arg->Common.Value.Name, WalkState, &RegionNode);
#endif
        if (ACPI_FAILURE (Status))
        {
            ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status);
            return_ACPI_STATUS (Status);
        }
    }
    Arg = Arg->Common.Next;
    Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
        ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
        ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode);
    if (ACPI_FAILURE (Status))
    {
        ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
        return_ACPI_STATUS (Status);
    }
    Arg = Arg->Common.Next;
    Arg = Arg->Common.Next;
    Info.FieldFlags = (UINT8) Arg->Common.Value.Integer;
    Info.FieldType = ACPI_TYPE_LOCAL_BANK_FIELD;
    Info.RegionNode = RegionNode;
    Info.DataRegisterNode = (ACPI_NAMESPACE_NODE*) Op;
    Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next);
    return_ACPI_STATUS (Status);
}
ACPI_STATUS AcpiDsCreateBankField ( ACPI_PARSE_OBJECT * Op , ACPI_NAMESPACE_NODE * RegionNode , ACPI_WALK_STATE * WalkState ) { ACPI_STATUS Status ; ACPI_PARSE_OBJECT * Arg ; ACPI_CREATE_FIELD_INFO Info ; ACPI_FUNCTION_TRACE_PTR ( DsCreateBankField , Op ) ; Arg = Op -> Common . Value . Arg ; if ( ! RegionNode ) { Status = AcpiNsLookup ( WalkState -> ScopeInfo , Arg -> Common . Value . Name , ACPI_TYPE_REGION , ACPI_IMODE_EXECUTE , ACPI_NS_SEARCH_PARENT , WalkState , & RegionNode ) ; #ifdef ACPI_ASL_COMPILER Status = AcpiDsCreateExternalRegion ( Status , Arg , Arg -> Common . Value . Name , WalkState , & RegionNode ) ; #endif if ( ACPI_FAILURE ( Status ) ) { ACPI_ERROR_NAMESPACE ( Arg -> Common . Value . Name , Status ) ; return_ACPI_STATUS ( Status ) ; } } Arg = Arg -> Common . Next ; Status = AcpiNsLookup ( WalkState -> ScopeInfo , Arg -> Common . Value . String , ACPI_TYPE_ANY , ACPI_IMODE_EXECUTE , ACPI_NS_SEARCH_PARENT , WalkState , & Info . RegisterNode ) ; if ( ACPI_FAILURE ( Status ) ) { ACPI_ERROR_NAMESPACE ( Arg -> Common . Value . String , Status ) ; return_ACPI_STATUS ( Status ) ; } Arg = Arg -> Common . Next ; Arg = Arg -> Common . Next ; Info . FieldFlags = ( UINT8 ) Arg -> Common . Value . Integer ; Info . FieldType = ACPI_TYPE_LOCAL_BANK_FIELD ; Info . RegionNode = RegionNode ; Info . DataRegisterNode = ( ACPI_NAMESPACE_NODE * ) Op ; Status = AcpiDsGetFieldNames ( & Info , WalkState , Arg -> Common . Next ) ; return_ACPI_STATUS ( Status ) ; }
FUNCTION:    AcpiDsCreateBankField
 PARAMETERS:  Op              - Op containing the Field definition and args
              RegionNode      - Object for the containing Operation Region
              WalkState       - Current method state
FUNCTION : AcpiDsCreateBankField PARAMETERS : Op - Op containing the Field definition and args RegionNode - Object for the containing Operation Region WalkState - Current method state
/* First arg is the name of the parent OpRegion (must already exist) */ /* Second arg is the Bank Register (Field) (must already exist) */ /*
     * Third arg is the BankValue
     * This arg is a TermArg, not a constant
     * It will be evaluated later, by AcpiDsEvalBankFieldOperands
     */ /* Fourth arg is the field flags */ /* Each remaining arg is a Named Field */ /*
     * Use Info.DataRegisterNode to store BankField Op
     * It's safe because DataRegisterNode will never be used when create
     * bank field \we store AmlStart and AmlLength in the BankField Op for
     * late evaluation. Used in AcpiExPrepFieldValue(Info)
     *
     * TBD: Or, should we add a field in ACPI_CREATE_FIELD_INFO, like
     * "void *ParentOp"?
     */