FreeBSD/sys/contrib/dev/acpica/components/namespace/nsalloc.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiNsDeleteNode
 *
 * PARAMETERS:  Node            - Node to be deleted
 *
 * RETURN:      None
 *
 * DESCRIPTION: Delete a namespace node. All node deletions must come through
 *              here. Detaches any attached objects, including any attached
 *              data. If a handler is associated with attached data, it is
 *              invoked before the node is deleted.
 *
 ******************************************************************************/
AcpiNsDeleteNode
PARAMETERS:  Node            - Node to be deleted

None

Delete a namespace node. All node deletions must come through
here. Detaches any attached objects, including any attached
data. If a handler is associated with attached data, it is
invoked before the node is deleted.
AcpiNsDeleteNode PARAMETERS : Node - Node to be deleted None Delete a namespace node . All node deletions must come through here . Detaches any attached objects including any attached data . If a handler is associated with attached data it is invoked before the node is deleted .
void
AcpiNsDeleteNode (
    ACPI_NAMESPACE_NODE     *Node)
{
    ACPI_OPERAND_OBJECT     *ObjDesc;
    ACPI_OPERAND_OBJECT     *NextDesc;
    ACPI_FUNCTION_NAME (NsDeleteNode);
    AcpiNsDetachObject (Node);
    ObjDesc = Node->Object;
    while (ObjDesc &&
        (ObjDesc->Common.Type == ACPI_TYPE_LOCAL_DATA))
    {
        if (ObjDesc->Data.Handler)
        {
            ObjDesc->Data.Handler (Node, ObjDesc->Data.Pointer);
        }
        NextDesc = ObjDesc->Common.NextObject;
        AcpiUtRemoveReference (ObjDesc);
        ObjDesc = NextDesc;
    }
    if (Node == AcpiGbl_RootNode)
    {
        return;
    }
    (void) AcpiOsReleaseObject (AcpiGbl_NamespaceCache, Node);
    ACPI_MEM_TRACKING (AcpiGbl_NsNodeList->TotalFreed++);
    ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Node %p, Remaining %X\n",
        Node, AcpiGbl_CurrentNodeCount));
}
void AcpiNsDeleteNode ( ACPI_NAMESPACE_NODE * Node ) { ACPI_OPERAND_OBJECT * ObjDesc ; ACPI_OPERAND_OBJECT * NextDesc ; ACPI_FUNCTION_NAME ( NsDeleteNode ) ; AcpiNsDetachObject ( Node ) ; ObjDesc = Node -> Object ; while ( ObjDesc && ( ObjDesc -> Common . Type == ACPI_TYPE_LOCAL_DATA ) ) { if ( ObjDesc -> Data . Handler ) { ObjDesc -> Data . Handler ( Node , ObjDesc -> Data . Pointer ) ; } NextDesc = ObjDesc -> Common . NextObject ; AcpiUtRemoveReference ( ObjDesc ) ; ObjDesc = NextDesc ; } if ( Node == AcpiGbl_RootNode ) { return ; } ( void ) AcpiOsReleaseObject ( AcpiGbl_NamespaceCache , Node ) ; ACPI_MEM_TRACKING ( AcpiGbl_NsNodeList -> TotalFreed ++ ) ; ACPI_DEBUG_PRINT ( ( ACPI_DB_ALLOCATIONS , " \n " , Node , AcpiGbl_CurrentNodeCount ) ) ; }
FUNCTION:    AcpiNsDeleteNode
 PARAMETERS:  Node            - Node to be deleted
FUNCTION : AcpiNsDeleteNode PARAMETERS : Node - Node to be deleted
/* Detach an object if there is one */ /*
     * Delete an attached data object list if present (objects that were
     * attached via AcpiAttachData). Note: After any normal object is
     * detached above, the only possible remaining object(s) are data
     * objects, in a linked list.
     */ /* Invoke the attached data deletion handler if present */ /* Special case for the statically allocated root node */ /* Now we can delete the node */