Deleted Added
full compact
nsalloc.c (85756) nsalloc.c (87031)
1/*******************************************************************************
2 *
3 * Module Name: nsalloc - Namespace allocation and deletion utilities
1/*******************************************************************************
2 *
3 * Module Name: nsalloc - Namespace allocation and deletion utilities
4 * $Revision: 60 $
4 * $Revision: 62 $
5 *
6 ******************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.

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

211 {
212 ParentNode->Child = NextNode->Peer;
213 }
214
215
216 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].TotalFreed++);
217
218 /*
5 *
6 ******************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.

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

211 {
212 ParentNode->Child = NextNode->Peer;
213 }
214
215
216 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].TotalFreed++);
217
218 /*
219 * Detach an object if there is one
219 * Detach an object if there is one then delete the node
220 */
220 */
221 if (Node->Object)
222 {
223 AcpiNsDetachObject (Node);
224 }
225
221 AcpiNsDetachObject (Node);
226 ACPI_MEM_FREE (Node);
227 return_VOID;
228}
229
230
231/*******************************************************************************
232 *
233 * FUNCTION: AcpiNsInstallNode
234 *
235 * PARAMETERS: WalkState - Current state of the walk
236 * ParentNode - The parent of the new Node
237 * Node - The new Node to install
238 * Type - ACPI object type of the new Node
239 *
240 * RETURN: None
241 *
222 ACPI_MEM_FREE (Node);
223 return_VOID;
224}
225
226
227/*******************************************************************************
228 *
229 * FUNCTION: AcpiNsInstallNode
230 *
231 * PARAMETERS: WalkState - Current state of the walk
232 * ParentNode - The parent of the new Node
233 * Node - The new Node to install
234 * Type - ACPI object type of the new Node
235 *
236 * RETURN: None
237 *
242 * DESCRIPTION: Initialize a new entry within a namespace table.
238 * DESCRIPTION: Initialize a new namespace node and install it amongst
239 * its peers.
243 *
240 *
241 * Note: Current namespace lookup is linear search, so the nodes
242 * are not linked in any particular order.
243 *
244 ******************************************************************************/
245
246void
247AcpiNsInstallNode (
248 ACPI_WALK_STATE *WalkState,
249 ACPI_NAMESPACE_NODE *ParentNode, /* Parent */
250 ACPI_NAMESPACE_NODE *Node, /* New Child*/
251 ACPI_OBJECT_TYPE8 Type)

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

262 * The owner ID is used to track table deletion and
263 * deletion of objects created by methods
264 */
265 if (WalkState)
266 {
267 OwnerId = WalkState->OwnerId;
268 }
269
244 ******************************************************************************/
245
246void
247AcpiNsInstallNode (
248 ACPI_WALK_STATE *WalkState,
249 ACPI_NAMESPACE_NODE *ParentNode, /* Parent */
250 ACPI_NAMESPACE_NODE *Node, /* New Child*/
251 ACPI_OBJECT_TYPE8 Type)

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

262 * The owner ID is used to track table deletion and
263 * deletion of objects created by methods
264 */
265 if (WalkState)
266 {
267 OwnerId = WalkState->OwnerId;
268 }
269
270 /* Link the new entry into the parent and existing children */
270
271
271 /* link the new entry into the parent and existing children */
272
273 /* TBD: Could be first, last, or alphabetic */
274
275 ChildNode = ParentNode->Child;
276 if (!ChildNode)
277 {
278 ParentNode->Child = Node;
279 }
272 ChildNode = ParentNode->Child;
273 if (!ChildNode)
274 {
275 ParentNode->Child = Node;
276 }
280
281 else
282 {
283 while (!(ChildNode->Flags & ANOBJ_END_OF_PEER_LIST))
284 {
285 ChildNode = ChildNode->Peer;
286 }
287
288 ChildNode->Peer = Node;

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

493 * There is at least one child of this node,
494 * visit the node
495 */
496 Level++;
497 ParentNode = ChildNode;
498 ChildNode = 0;
499 }
500 }
277 else
278 {
279 while (!(ChildNode->Flags & ANOBJ_END_OF_PEER_LIST))
280 {
281 ChildNode = ChildNode->Peer;
282 }
283
284 ChildNode->Peer = Node;

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

489 * There is at least one child of this node,
490 * visit the node
491 */
492 Level++;
493 ParentNode = ChildNode;
494 ChildNode = 0;
495 }
496 }
501
502 else
503 {
504 /*
505 * No more children of this parent node.
506 * Move up to the grandparent.
507 */
508 Level--;
509

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

636 /*
637 * There is at least one child of this node,
638 * visit the node
639 */
640 Level++;
641 ParentNode = ChildNode;
642 ChildNode = 0;
643 }
497 else
498 {
499 /*
500 * No more children of this parent node.
501 * Move up to the grandparent.
502 */
503 Level--;
504

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

631 /*
632 * There is at least one child of this node,
633 * visit the node
634 */
635 Level++;
636 ParentNode = ChildNode;
637 ChildNode = 0;
638 }
644
645 else if (ChildNode->OwnerId == OwnerId)
646 {
647 AcpiNsRemoveReference (ChildNode);
648 }
649 }
639 else if (ChildNode->OwnerId == OwnerId)
640 {
641 AcpiNsRemoveReference (ChildNode);
642 }
643 }
650
651 else
652 {
653 /*
654 * No more children of this parent node.
655 * Move up to the grandparent.
656 */
657 Level--;
658

--- 22 unchanged lines hidden ---
644 else
645 {
646 /*
647 * No more children of this parent node.
648 * Move up to the grandparent.
649 */
650 Level--;
651

--- 22 unchanged lines hidden ---