FreeBSD/sys/contrib/dev/acpica/components/namespace/nsinit.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiNsFindIniMethods
 *
 * PARAMETERS:  ACPI_WALK_CALLBACK
 *
 * RETURN:      ACPI_STATUS
 *
 * DESCRIPTION: Called during namespace walk. Finds objects named _INI under
 *              device/processor/thermal objects, and marks the entire subtree
 *              with a SUBTREE_HAS_INI flag. This flag is used during the
 *              subsequent device initialization walk to avoid entire subtrees
 *              that do not contain an _INI.
 *
 ******************************************************************************/




Called during namespace walk. Finds objects named _INI under
device/processor/thermal objects, and marks the entire subtree
with a SUBTREE_HAS_INI flag. This flag is used during the
subsequent device initialization walk to avoid entire subtrees
that do not contain an _INI.
Called during namespace walk . Finds objects named _INI under device / processor / thermal objects and marks the entire subtree with a SUBTREE_HAS_INI flag . This flag is used during the subsequent device initialization walk to avoid entire subtrees that do not contain an _INI .
static ACPI_STATUS
AcpiNsFindIniMethods (
    ACPI_HANDLE             ObjHandle,
    UINT32                  NestingLevel,
    void                    *Context,
    void                    **ReturnValue)
{
    ACPI_DEVICE_WALK_INFO   *Info = ACPI_CAST_PTR (ACPI_DEVICE_WALK_INFO, Context);
    ACPI_NAMESPACE_NODE     *Node;
    ACPI_NAMESPACE_NODE     *ParentNode;
    Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
    if ((Node->Type == ACPI_TYPE_DEVICE)    ||
        (Node->Type == ACPI_TYPE_PROCESSOR) ||
        (Node->Type == ACPI_TYPE_THERMAL))
    {
        Info->DeviceCount++;
        return (AE_OK);
    }
    if (!ACPI_COMPARE_NAME (Node->Name.Ascii, METHOD_NAME__INI))
    {
        return (AE_OK);
    }
    ParentNode = Node->Parent;
    switch (ParentNode->Type)
    {
    case ACPI_TYPE_DEVICE:
    case ACPI_TYPE_PROCESSOR:
    case ACPI_TYPE_THERMAL:
        while (ParentNode)
        {
            ParentNode->Flags |= ANOBJ_SUBTREE_HAS_INI;
            ParentNode = ParentNode->Parent;
        }
        break;
    default:
        break;
    }
    return (AE_OK);
}
static ACPI_STATUS AcpiNsFindIniMethods ( ACPI_HANDLE ObjHandle , UINT32 NestingLevel , void * Context , void * * ReturnValue ) { ACPI_DEVICE_WALK_INFO * Info = ACPI_CAST_PTR ( ACPI_DEVICE_WALK_INFO , Context ) ; ACPI_NAMESPACE_NODE * Node ; ACPI_NAMESPACE_NODE * ParentNode ; Node = ACPI_CAST_PTR ( ACPI_NAMESPACE_NODE , ObjHandle ) ; if ( ( Node -> Type == ACPI_TYPE_DEVICE ) || ( Node -> Type == ACPI_TYPE_PROCESSOR ) || ( Node -> Type == ACPI_TYPE_THERMAL ) ) { Info -> DeviceCount ++ ; return ( AE_OK ) ; } if ( ! ACPI_COMPARE_NAME ( Node -> Name . Ascii , METHOD_NAME__INI ) ) { return ( AE_OK ) ; } ParentNode = Node -> Parent ; switch ( ParentNode -> Type ) { case ACPI_TYPE_DEVICE : case ACPI_TYPE_PROCESSOR : case ACPI_TYPE_THERMAL : while ( ParentNode ) { ParentNode -> Flags |= ANOBJ_SUBTREE_HAS_INI ; ParentNode = ParentNode -> Parent ; } break ; default : break ; } return ( AE_OK ) ; }
FUNCTION:    AcpiNsFindIniMethods
 PARAMETERS:  ACPI_WALK_CALLBACK
FUNCTION : AcpiNsFindIniMethods PARAMETERS : ACPI_WALK_CALLBACK
/* Keep count of device/processor/thermal objects */ /* We are only looking for methods named _INI */ /*
     * The only _INI methods that we care about are those that are
     * present under Device, Processor, and Thermal objects.
     */ /* Mark parent and bubble up the INI present flag to the root */