FreeBSD/sys/contrib/dev/acpica/components/dispatcher/dswscope.c
/****************************************************************************
 *
 * FUNCTION:    AcpiDsScopeStackPush
 *
 * PARAMETERS:  Node            - Name to be made current
 *              Type            - Type of frame being pushed
 *              WalkState       - Current state
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Push the current scope on the scope stack, and make the
 *              passed Node current.
 *
 ***************************************************************************/
AcpiDsScopeStackPush
PARAMETERS:  Node            - Name to be made current
Type            - Type of frame being pushed
WalkState       - Current state

Status

Push the current scope on the scope stack, and make the
passed Node current.
AcpiDsScopeStackPush PARAMETERS : Node - Name to be made current Type - Type of frame being pushed WalkState - Current state Status Push the current scope on the scope stack and make the passed Node current .
ACPI_STATUS
AcpiDsScopeStackPush (
    ACPI_NAMESPACE_NODE     *Node,
    ACPI_OBJECT_TYPE        Type,
    ACPI_WALK_STATE         *WalkState)
{
    ACPI_GENERIC_STATE      *ScopeInfo;
    ACPI_GENERIC_STATE      *OldScopeInfo;
    ACPI_FUNCTION_TRACE (DsScopeStackPush);
    if (!Node)
    {
        ACPI_ERROR ((AE_INFO, "Null scope parameter"));
        return_ACPI_STATUS (AE_BAD_PARAMETER);
    }
    if (!AcpiUtValidObjectType (Type))
    {
        ACPI_WARNING ((AE_INFO,
            "Invalid object type: 0x%X", Type));
    }
    ScopeInfo = AcpiUtCreateGenericState ();
    if (!ScopeInfo)
    {
        return_ACPI_STATUS (AE_NO_MEMORY);
    }
    ScopeInfo->Common.DescriptorType = ACPI_DESC_TYPE_STATE_WSCOPE;
    ScopeInfo->Scope.Node = Node;
    ScopeInfo->Common.Value = (UINT16) Type;
    WalkState->ScopeDepth++;
    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
        "[%.2d] Pushed scope ", (UINT32) WalkState->ScopeDepth));
    OldScopeInfo = WalkState->ScopeInfo;
    if (OldScopeInfo)
    {
        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
            "[%4.4s] (%s)",
            AcpiUtGetNodeName (OldScopeInfo->Scope.Node),
            AcpiUtGetTypeName (OldScopeInfo->Common.Value)));
    }
    else
    {
        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
            "[\\___] (%s)", "ROOT"));
    }
    ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
        ", New scope -> [%4.4s] (%s)\n",
        AcpiUtGetNodeName (ScopeInfo->Scope.Node),
        AcpiUtGetTypeName (ScopeInfo->Common.Value)));
    AcpiUtPushGenericState (&WalkState->ScopeInfo, ScopeInfo);
    return_ACPI_STATUS (AE_OK);
}
ACPI_STATUS AcpiDsScopeStackPush ( ACPI_NAMESPACE_NODE * Node , ACPI_OBJECT_TYPE Type , ACPI_WALK_STATE * WalkState ) { ACPI_GENERIC_STATE * ScopeInfo ; ACPI_GENERIC_STATE * OldScopeInfo ; ACPI_FUNCTION_TRACE ( DsScopeStackPush ) ; if ( ! Node ) { ACPI_ERROR ( ( AE_INFO , " " ) ) ; return_ACPI_STATUS ( AE_BAD_PARAMETER ) ; } if ( ! AcpiUtValidObjectType ( Type ) ) { ACPI_WARNING ( ( AE_INFO , " " , Type ) ) ; } ScopeInfo = AcpiUtCreateGenericState ( ) ; if ( ! ScopeInfo ) { return_ACPI_STATUS ( AE_NO_MEMORY ) ; } ScopeInfo -> Common . DescriptorType = ACPI_DESC_TYPE_STATE_WSCOPE ; ScopeInfo -> Scope . Node = Node ; ScopeInfo -> Common . Value = ( UINT16 ) Type ; WalkState -> ScopeDepth ++ ; ACPI_DEBUG_PRINT ( ( ACPI_DB_EXEC , " " , ( UINT32 ) WalkState -> ScopeDepth ) ) ; OldScopeInfo = WalkState -> ScopeInfo ; if ( OldScopeInfo ) { ACPI_DEBUG_PRINT_RAW ( ( ACPI_DB_EXEC , " " , AcpiUtGetNodeName ( OldScopeInfo -> Scope . Node ) , AcpiUtGetTypeName ( OldScopeInfo -> Common . Value ) ) ) ; } else { ACPI_DEBUG_PRINT_RAW ( ( ACPI_DB_EXEC , " \\ " , " " ) ) ; } ACPI_DEBUG_PRINT_RAW ( ( ACPI_DB_EXEC , " \n " , AcpiUtGetNodeName ( ScopeInfo -> Scope . Node ) , AcpiUtGetTypeName ( ScopeInfo -> Common . Value ) ) ) ; AcpiUtPushGenericState ( & WalkState -> ScopeInfo , ScopeInfo ) ; return_ACPI_STATUS ( AE_OK ) ; }
FUNCTION:    AcpiDsScopeStackPush
 PARAMETERS:  Node            - Name to be made current
              Type            - Type of frame being pushed
              WalkState       - Current state
FUNCTION : AcpiDsScopeStackPush PARAMETERS : Node - Name to be made current Type - Type of frame being pushed WalkState - Current state
/* Invalid scope   */ /* Make sure object type is valid */ /* Allocate a new scope object */ /* Init new scope object */ /* Push new scope object onto stack */