Lines Matching +full:child +full:- +full:node
3 * Module Name: nsalloc - Namespace allocation and deletion utilities
11 * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
108 * any of its subsidiaries will export/re-export any technical data, process,
130 * 3. Neither the names of the above-listed copyright holders nor the names
165 * PARAMETERS: Name - Name of the new node (4 char ACPI name)
167 * RETURN: New namespace node (Null on failure)
169 * DESCRIPTION: Create a namespace node
177 ACPI_NAMESPACE_NODE *Node;
186 Node = AcpiOsAcquireObject (AcpiGbl_NamespaceCache);
187 if (!Node)
192 ACPI_MEM_TRACKING (AcpiGbl_NsNodeList->TotalAllocated++);
195 Temp = AcpiGbl_NsNodeList->TotalAllocated -
196 AcpiGbl_NsNodeList->TotalFreed;
197 if (Temp > AcpiGbl_NsNodeList->MaxOccupied)
199 AcpiGbl_NsNodeList->MaxOccupied = Temp;
203 Node->Name.Integer = Name;
204 ACPI_SET_DESCRIPTOR_TYPE (Node, ACPI_DESC_TYPE_NAMED);
205 return_PTR (Node);
213 * PARAMETERS: Node - Node to be deleted
217 * DESCRIPTION: Delete a namespace node. All node deletions must come through
220 * invoked before the node is deleted.
226 ACPI_NAMESPACE_NODE *Node)
235 if (!Node)
242 AcpiNsDetachObject (Node);
250 ObjDesc = Node->Object;
252 (ObjDesc->Common.Type == ACPI_TYPE_LOCAL_DATA))
256 if (ObjDesc->Data.Handler)
258 ObjDesc->Data.Handler (Node, ObjDesc->Data.Pointer);
261 NextDesc = ObjDesc->Common.NextObject;
266 /* Special case for the statically allocated root node */
268 if (Node == AcpiGbl_RootNode)
273 /* Now we can delete the node */
275 (void) AcpiOsReleaseObject (AcpiGbl_NamespaceCache, Node);
277 ACPI_MEM_TRACKING (AcpiGbl_NsNodeList->TotalFreed++);
278 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Node %p, Remaining %X\n",
279 Node, AcpiGbl_CurrentNodeCount));
287 * PARAMETERS: Node - Node to be removed/deleted
291 * DESCRIPTION: Remove (unlink) and delete a namespace node
297 ACPI_NAMESPACE_NODE *Node)
304 ACPI_FUNCTION_TRACE_PTR (NsRemoveNode, Node);
307 ParentNode = Node->Parent;
310 NextNode = ParentNode->Child;
312 /* Find the node that is the previous peer in the parent's child list */
314 while (NextNode != Node)
317 NextNode = NextNode->Peer;
322 /* Node is not first child, unlink it */
324 PrevNode->Peer = Node->Peer;
329 * Node is first child (has no previous peer).
332 ParentNode->Child = Node->Peer;
335 /* Delete the node and any attached objects */
337 AcpiNsDeleteNode (Node);
346 * PARAMETERS: WalkState - Current state of the walk
347 * ParentNode - The parent of the new Node
348 * Node - The new Node to install
349 * Type - ACPI object type of the new Node
353 * DESCRIPTION: Initialize a new namespace node and install it amongst
366 ACPI_NAMESPACE_NODE *Node, /* New Child*/
382 OwnerId = WalkState->OwnerId;
384 if ((WalkState->MethodDesc) &&
385 (ParentNode != WalkState->MethodNode))
388 * A method is creating a new node that is not a child of the
389 * method (it is non-local). Mark the executing method as having
393 WalkState->MethodDesc->Method.InfoFlags |=
400 Node->Peer = NULL;
401 Node->Parent = ParentNode;
402 ChildNode = ParentNode->Child;
406 ParentNode->Child = Node;
410 /* Add node to the end of the peer list */
412 while (ChildNode->Peer)
414 ChildNode = ChildNode->Peer;
417 ChildNode->Peer = Node;
422 Node->OwnerId = OwnerId;
423 Node->Type = (UINT8) Type;
426 "%4.4s (%s) [Node %p Owner %3.3X] added to %4.4s (%s) [Node %p]\n",
427 AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type), Node, OwnerId,
428 AcpiUtGetNodeName (ParentNode), AcpiUtGetTypeName (ParentNode->Type),
439 * PARAMETERS: ParentNode - Delete this objects children
466 NextNode = ParentNode->Child;
471 if (NextNode->Child)
478 * Delete this child node and move on to the next child in the list.
479 * No need to unlink the node since we are deleting the entire branch.
482 NextNode = NextNode->Peer;
486 /* Clear the parent's child pointer */
488 ParentNode->Child = NULL;
497 * PARAMETERS: ParentNode - Root of the subtree to be deleted
537 /* Get the next node in this scope (NULL if none) */
542 /* Found a child node - detach any attached object */
546 /* Check if this node has any children */
548 if (ChildNode->Child)
551 * There is at least one child of this node,
552 * visit the node
562 * No more children of this parent node.
565 Level--;
573 /* New "last child" is this parent node */
579 ParentNode = ParentNode->Parent;
592 * PARAMETERS: OwnerId - All nodes with this owner will be deleted
643 * Get the next child of this parent node. When ChildNode is NULL,
644 * the first child of the parent is returned
657 if (ChildNode->OwnerId == OwnerId)
659 /* Found a matching child node - detach any attached object */
664 /* Check if this node has any children */
666 if (ChildNode->Child)
669 * There is at least one child of this node,
670 * visit the node
676 else if (ChildNode->OwnerId == OwnerId)
684 * No more children of this parent node.
687 Level--;
690 if (ParentNode->OwnerId == OwnerId)
696 /* New "last child" is this parent node */
702 ParentNode = ParentNode->Parent;