1/*******************************************************************************
2 *
3 * Module Name: nsalloc - Namespace allocation and deletion utilities
4 * $Revision: 79 $
5 *
6 ******************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
--- 174 unchanged lines hidden (view full) ---
187 ACPI_FUNCTION_TRACE_PTR ("NsDeleteNode", Node);
188
189
190 ParentNode = AcpiNsGetParentNode (Node);
191
192 PrevNode = NULL;
193 NextNode = ParentNode->Child;
194
195 while (NextNode != Node)
196 {
197 PrevNode = NextNode;
198 NextNode = PrevNode->Peer;
199 }
200
201 if (PrevNode)
202 {
203 PrevNode->Peer = NextNode->Peer;
204 if (NextNode->Flags & ANOBJ_END_OF_PEER_LIST)
205 {
206 PrevNode->Flags |= ANOBJ_END_OF_PEER_LIST;
207 }
208 }
209 else
210 {
211 ParentNode->Child = NextNode->Peer;
212 }
213
214
215 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].TotalFreed++);
216
217 /*
218 * Detach an object if there is one then delete the node
219 */
--- 80 unchanged lines hidden (view full) ---
300
301void
302AcpiNsInstallNode (
303 ACPI_WALK_STATE *WalkState,
304 ACPI_NAMESPACE_NODE *ParentNode, /* Parent */
305 ACPI_NAMESPACE_NODE *Node, /* New Child*/
306 ACPI_OBJECT_TYPE Type)
307{
308 UINT16 OwnerId = TABLE_ID_DSDT;
309 ACPI_NAMESPACE_NODE *ChildNode;
310#ifdef ACPI_ALPHABETIC_NAMESPACE
311
312 ACPI_NAMESPACE_NODE *PreviousChildNode;
313#endif
314
315
316 ACPI_FUNCTION_TRACE ("NsInstallNode");
--- 126 unchanged lines hidden (view full) ---
443 ******************************************************************************/
444
445void
446AcpiNsDeleteChildren (
447 ACPI_NAMESPACE_NODE *ParentNode)
448{
449 ACPI_NAMESPACE_NODE *ChildNode;
450 ACPI_NAMESPACE_NODE *NextNode;
451 UINT8 Flags;
452
453
454 ACPI_FUNCTION_TRACE_PTR ("NsDeleteChildren", ParentNode);
455
456
457 if (!ParentNode)
458 {
--- 32 unchanged lines hidden (view full) ---
491
492 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Object %p, Remaining %X\n",
493 ChildNode, AcpiGbl_CurrentNodeCount));
494
495 /*
496 * Detach an object if there is one, then free the child node
497 */
498 AcpiNsDetachObject (ChildNode);
499 ACPI_MEM_FREE (ChildNode);
500
501 /* And move on to the next child in the list */
502
503 ChildNode = NextNode;
504
505 } while (!(Flags & ANOBJ_END_OF_PEER_LIST));
506
--- 102 unchanged lines hidden (view full) ---
609 * RETURN: None.
610 *
611 * DESCRIPTION: Remove a Node reference. Decrements the reference count
612 * of all parent Nodes up to the root. Any node along
613 * the way that reaches zero references is freed.
614 *
615 ******************************************************************************/
616
617static void
618AcpiNsRemoveReference (
619 ACPI_NAMESPACE_NODE *Node)
620{
621 ACPI_NAMESPACE_NODE *ParentNode;
622 ACPI_NAMESPACE_NODE *ThisNode;
623
624
625 ACPI_FUNCTION_ENTRY ();
--- 137 unchanged lines hidden ---
2 *
3 * Module Name: nsalloc - Namespace allocation and deletion utilities
4 * $Revision: 79 $
5 *
6 ******************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
--- 174 unchanged lines hidden (view full) ---
187 ACPI_FUNCTION_TRACE_PTR ("NsDeleteNode", Node);
188
189
190 ParentNode = AcpiNsGetParentNode (Node);
191
192 PrevNode = NULL;
193 NextNode = ParentNode->Child;
194
195 while (NextNode != Node)
196 {
197 PrevNode = NextNode;
198 NextNode = PrevNode->Peer;
199 }
200
201 if (PrevNode)
202 {
203 PrevNode->Peer = NextNode->Peer;
204 if (NextNode->Flags & ANOBJ_END_OF_PEER_LIST)
205 {
206 PrevNode->Flags |= ANOBJ_END_OF_PEER_LIST;
207 }
208 }
209 else
210 {
211 ParentNode->Child = NextNode->Peer;
212 }
213
214
215 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].TotalFreed++);
216
217 /*
218 * Detach an object if there is one then delete the node
219 */
--- 80 unchanged lines hidden (view full) ---
300
301void
302AcpiNsInstallNode (
303 ACPI_WALK_STATE *WalkState,
304 ACPI_NAMESPACE_NODE *ParentNode, /* Parent */
305 ACPI_NAMESPACE_NODE *Node, /* New Child*/
306 ACPI_OBJECT_TYPE Type)
307{
308 UINT16 OwnerId = TABLE_ID_DSDT;
309 ACPI_NAMESPACE_NODE *ChildNode;
310#ifdef ACPI_ALPHABETIC_NAMESPACE
311
312 ACPI_NAMESPACE_NODE *PreviousChildNode;
313#endif
314
315
316 ACPI_FUNCTION_TRACE ("NsInstallNode");
--- 126 unchanged lines hidden (view full) ---
443 ******************************************************************************/
444
445void
446AcpiNsDeleteChildren (
447 ACPI_NAMESPACE_NODE *ParentNode)
448{
449 ACPI_NAMESPACE_NODE *ChildNode;
450 ACPI_NAMESPACE_NODE *NextNode;
451 UINT8 Flags;
452
453
454 ACPI_FUNCTION_TRACE_PTR ("NsDeleteChildren", ParentNode);
455
456
457 if (!ParentNode)
458 {
--- 32 unchanged lines hidden (view full) ---
491
492 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Object %p, Remaining %X\n",
493 ChildNode, AcpiGbl_CurrentNodeCount));
494
495 /*
496 * Detach an object if there is one, then free the child node
497 */
498 AcpiNsDetachObject (ChildNode);
499 ACPI_MEM_FREE (ChildNode);
500
501 /* And move on to the next child in the list */
502
503 ChildNode = NextNode;
504
505 } while (!(Flags & ANOBJ_END_OF_PEER_LIST));
506
--- 102 unchanged lines hidden (view full) ---
609 * RETURN: None.
610 *
611 * DESCRIPTION: Remove a Node reference. Decrements the reference count
612 * of all parent Nodes up to the root. Any node along
613 * the way that reaches zero references is freed.
614 *
615 ******************************************************************************/
616
617static void
618AcpiNsRemoveReference (
619 ACPI_NAMESPACE_NODE *Node)
620{
621 ACPI_NAMESPACE_NODE *ParentNode;
622 ACPI_NAMESPACE_NODE *ThisNode;
623
624
625 ACPI_FUNCTION_ENTRY ();
--- 137 unchanged lines hidden ---