FreeBSD/sys/contrib/dev/acpica/common/dmrestag.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiDmAddResourceToNamespace
 *
 * PARAMETERS:  ACPI_WALK_AML_CALLBACK
 *              BufferNode              - Node for the parent buffer
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Add one resource descriptor to the namespace as a child of the
 *              parent buffer. The same name is used for each descriptor. This
 *              is changed later to a unique name if the resource is actually
 *              referenced by an AML operator.
 *
 ******************************************************************************/
AcpiDmAddResourceToNamespace
PARAMETERS:  ACPI_WALK_AML_CALLBACK
BufferNode              - Node for the parent buffer

Status

Add one resource descriptor to the namespace as a child of the
parent buffer. The same name is used for each descriptor. This
is changed later to a unique name if the resource is actually
referenced by an AML operator.
AcpiDmAddResourceToNamespace PARAMETERS : ACPI_WALK_AML_CALLBACK BufferNode - Node for the parent buffer Status Add one resource descriptor to the namespace as a child of the parent buffer . The same name is used for each descriptor . This is changed later to a unique name if the resource is actually referenced by an AML operator .
static ACPI_STATUS
AcpiDmAddResourceToNamespace (
    UINT8                   *Aml,
    UINT32                  Length,
    UINT32                  Offset,
    UINT8                   ResourceIndex,
    void                    **Context)
{
    ACPI_STATUS             Status;
    ACPI_GENERIC_STATE      ScopeInfo;
    ACPI_NAMESPACE_NODE     *Node;
    ScopeInfo.Scope.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Context);
    Status = AcpiNsLookup (&ScopeInfo, "_TMP", ACPI_TYPE_LOCAL_RESOURCE,
        ACPI_IMODE_LOAD_PASS2,
        ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_PREFIX_IS_SCOPE,
        NULL, &Node);
    if (ACPI_FAILURE (Status))
    {
        return (AE_OK);
    }
    Node->Name.Integer = ACPI_DEFAULT_RESNAME;
    Node->Value = Offset;
    Node->Length = Length;
    return (AE_OK);
}
static ACPI_STATUS AcpiDmAddResourceToNamespace ( UINT8 * Aml , UINT32 Length , UINT32 Offset , UINT8 ResourceIndex , void * * Context ) { ACPI_STATUS Status ; ACPI_GENERIC_STATE ScopeInfo ; ACPI_NAMESPACE_NODE * Node ; ScopeInfo . Scope . Node = ACPI_CAST_PTR ( ACPI_NAMESPACE_NODE , Context ) ; Status = AcpiNsLookup ( & ScopeInfo , " " , ACPI_TYPE_LOCAL_RESOURCE , ACPI_IMODE_LOAD_PASS2 , ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_PREFIX_IS_SCOPE , NULL , & Node ) ; if ( ACPI_FAILURE ( Status ) ) { return ( AE_OK ) ; } Node -> Name . Integer = ACPI_DEFAULT_RESNAME ; Node -> Value = Offset ; Node -> Length = Length ; return ( AE_OK ) ; }
FUNCTION:    AcpiDmAddResourceToNamespace
 PARAMETERS:  ACPI_WALK_AML_CALLBACK
              BufferNode              - Node for the parent buffer
FUNCTION : AcpiDmAddResourceToNamespace PARAMETERS : ACPI_WALK_AML_CALLBACK BufferNode - Node for the parent buffer
/* TBD: Don't need to add descriptors that have no tags defined? */ /* Add the resource to the namespace, as child of the buffer */ /* Set the name to the default, changed later if resource is referenced */ /* Save the offset of the descriptor (within the original buffer) */