FreeBSD/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiDsCreateField
 *
 * 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 field in the specified operation region
 *
 ******************************************************************************/
AcpiDsCreateField
PARAMETERS:  Op              - Op containing the Field definition and args
RegionNode      - Object for the containing Operation Region
`           WalkState       - Current method state

Status

Create a new field in the specified operation region
AcpiDsCreateField PARAMETERS : Op - Op containing the Field definition and args RegionNode - Object for the containing Operation Region ` WalkState - Current method state Status Create a new field in the specified operation region
ACPI_STATUS
AcpiDsCreateField (
    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 (DsCreateField, 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);
        }
    }
    memset (&Info, 0, sizeof (ACPI_CREATE_FIELD_INFO));
    Arg = Arg->Common.Next;
    Info.FieldFlags = (UINT8) Arg->Common.Value.Integer;
    Info.Attribute = 0;
    Info.FieldType = ACPI_TYPE_LOCAL_REGION_FIELD;
    Info.RegionNode = RegionNode;
    Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next);
    return_ACPI_STATUS (Status);
}
ACPI_STATUS AcpiDsCreateField ( 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 ( DsCreateField , 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 ) ; } } memset ( & Info , 0 , sizeof ( ACPI_CREATE_FIELD_INFO ) ) ; Arg = Arg -> Common . Next ; Info . FieldFlags = ( UINT8 ) Arg -> Common . Value . Integer ; Info . Attribute = 0 ; Info . FieldType = ACPI_TYPE_LOCAL_REGION_FIELD ; Info . RegionNode = RegionNode ; Status = AcpiDsGetFieldNames ( & Info , WalkState , Arg -> Common . Next ) ; return_ACPI_STATUS ( Status ) ; }
FUNCTION:    AcpiDsCreateField
 PARAMETERS:  Op              - Op containing the Field definition and args
              RegionNode      - Object for the containing Operation Region
  `           WalkState       - Current method state
FUNCTION : AcpiDsCreateField 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 field flags */ /* Each remaining arg is a Named Field */