Deleted Added
full compact
nsalloc.c (114237) nsalloc.c (115351)
1/*******************************************************************************
2 *
3 * Module Name: nsalloc - Namespace allocation and deletion utilities
1/*******************************************************************************
2 *
3 * Module Name: nsalloc - Namespace allocation and deletion utilities
4 * $Revision: 79 $
4 * $Revision: 82 $
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
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 /* Find the node that is the previous peer in the parent's child list */
196
195 while (NextNode != Node)
196 {
197 PrevNode = NextNode;
198 NextNode = PrevNode->Peer;
199 }
200
201 if (PrevNode)
202 {
197 while (NextNode != Node)
198 {
199 PrevNode = NextNode;
200 NextNode = PrevNode->Peer;
201 }
202
203 if (PrevNode)
204 {
205 /* Node is not first child, unlink it */
206
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 {
207 PrevNode->Peer = NextNode->Peer;
208 if (NextNode->Flags & ANOBJ_END_OF_PEER_LIST)
209 {
210 PrevNode->Flags |= ANOBJ_END_OF_PEER_LIST;
211 }
212 }
213 else
214 {
211 ParentNode->Child = NextNode->Peer;
215 /* Node is first child (has no previous peer) */
216
217 if (NextNode->Flags & ANOBJ_END_OF_PEER_LIST)
218 {
219 /* No peers at all */
220
221 ParentNode->Child = NULL;
222 }
223 else
224 { /* Link peer list to parent */
225
226 ParentNode->Child = NextNode->Peer;
227 }
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{
228 }
229
230
231 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].TotalFreed++);
232
233 /*
234 * Detach an object if there is one then delete the node
235 */

--- 80 unchanged lines hidden (view full) ---

316
317void
318AcpiNsInstallNode (
319 ACPI_WALK_STATE *WalkState,
320 ACPI_NAMESPACE_NODE *ParentNode, /* Parent */
321 ACPI_NAMESPACE_NODE *Node, /* New Child*/
322 ACPI_OBJECT_TYPE Type)
323{
308 UINT16 OwnerId = TABLE_ID_DSDT;
324 UINT16 OwnerId = 0;
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;
325 ACPI_NAMESPACE_NODE *ChildNode;
326#ifdef ACPI_ALPHABETIC_NAMESPACE
327
328 ACPI_NAMESPACE_NODE *PreviousChildNode;
329#endif
330
331
332 ACPI_FUNCTION_TRACE ("NsInstallNode");

--- 126 unchanged lines hidden (view full) ---

459 ******************************************************************************/
460
461void
462AcpiNsDeleteChildren (
463 ACPI_NAMESPACE_NODE *ParentNode)
464{
465 ACPI_NAMESPACE_NODE *ChildNode;
466 ACPI_NAMESPACE_NODE *NextNode;
467 ACPI_NAMESPACE_NODE *Node;
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);
468 UINT8 Flags;
469
470
471 ACPI_FUNCTION_TRACE_PTR ("NsDeleteChildren", ParentNode);
472
473
474 if (!ParentNode)
475 {

--- 32 unchanged lines hidden (view full) ---

508
509 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Object %p, Remaining %X\n",
510 ChildNode, AcpiGbl_CurrentNodeCount));
511
512 /*
513 * Detach an object if there is one, then free the child node
514 */
515 AcpiNsDetachObject (ChildNode);
516
517 /*
518 * Decrement the reference count(s) of all parents up to
519 * the root! (counts were incremented when the node was created)
520 */
521 Node = ChildNode;
522 while ((Node = AcpiNsGetParentNode (Node)) != NULL)
523 {
524 Node->ReferenceCount--;
525 }
526
527 /* There should be only one reference remaining on this node */
528
529 if (ChildNode->ReferenceCount != 1)
530 {
531 ACPI_REPORT_WARNING (("Existing references (%d) on node being deleted (%p)\n",
532 ChildNode->ReferenceCount, ChildNode));
533 }
534
535 /* Now we can delete the node */
536
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
537 ACPI_MEM_FREE (ChildNode);
538
539 /* And move on to the next child in the list */
540
541 ChildNode = NextNode;
542
543 } while (!(Flags & ANOBJ_END_OF_PEER_LIST));
544

--- 102 unchanged lines hidden (view full) ---

647 * RETURN: None.
648 *
649 * DESCRIPTION: Remove a Node reference. Decrements the reference count
650 * of all parent Nodes up to the root. Any node along
651 * the way that reaches zero references is freed.
652 *
653 ******************************************************************************/
654
617static void
655void
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 ---
656AcpiNsRemoveReference (
657 ACPI_NAMESPACE_NODE *Node)
658{
659 ACPI_NAMESPACE_NODE *ParentNode;
660 ACPI_NAMESPACE_NODE *ThisNode;
661
662
663 ACPI_FUNCTION_ENTRY ();

--- 137 unchanged lines hidden ---