Lines Matching +full:parent +full:- +full:child
1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
4 * Module Name: nsalloc - Namespace allocation and deletion utilities
19 * PARAMETERS: name - Name of the new node (4 char ACPI name)
40 ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_allocated++); in acpi_ns_create_node()
43 temp = acpi_gbl_ns_node_list->total_allocated - in acpi_ns_create_node()
44 acpi_gbl_ns_node_list->total_freed; in acpi_ns_create_node()
45 if (temp > acpi_gbl_ns_node_list->max_occupied) { in acpi_ns_create_node()
46 acpi_gbl_ns_node_list->max_occupied = temp; in acpi_ns_create_node()
50 node->name.integer = name; in acpi_ns_create_node()
59 * PARAMETERS: node - Node to be deleted
91 obj_desc = node->object; in acpi_ns_delete_node()
92 while (obj_desc && (obj_desc->common.type == ACPI_TYPE_LOCAL_DATA)) { in acpi_ns_delete_node()
96 if (obj_desc->data.handler) { in acpi_ns_delete_node()
97 obj_desc->data.handler(node, obj_desc->data.pointer); in acpi_ns_delete_node()
100 next_desc = obj_desc->common.next_object; in acpi_ns_delete_node()
115 ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_freed++); in acpi_ns_delete_node()
124 * PARAMETERS: node - Node to be removed/deleted
140 parent_node = node->parent; in acpi_ns_remove_node()
143 next_node = parent_node->child; in acpi_ns_remove_node()
145 /* Find the node that is the previous peer in the parent's child list */ in acpi_ns_remove_node()
149 next_node = next_node->peer; in acpi_ns_remove_node()
154 /* Node is not first child, unlink it */ in acpi_ns_remove_node()
156 prev_node->peer = node->peer; in acpi_ns_remove_node()
159 * Node is first child (has no previous peer). in acpi_ns_remove_node()
160 * Link peer list to parent in acpi_ns_remove_node()
162 parent_node->child = node->peer; in acpi_ns_remove_node()
175 * PARAMETERS: walk_state - Current state of the walk
176 * parent_node - The parent of the new Node
177 * node - The new Node to install
178 * type - ACPI object type of the new Node
191 …tall_node(struct acpi_walk_state *walk_state, struct acpi_namespace_node *parent_node, /* Parent */ in acpi_ns_install_node()
192 struct acpi_namespace_node *node, /* New Child */ in acpi_ns_install_node()
205 owner_id = walk_state->owner_id; in acpi_ns_install_node()
207 if ((walk_state->method_desc) && in acpi_ns_install_node()
208 (parent_node != walk_state->method_node)) { in acpi_ns_install_node()
210 * A method is creating a new node that is not a child of the in acpi_ns_install_node()
211 * method (it is non-local). Mark the executing method as having in acpi_ns_install_node()
215 walk_state->method_desc->method.info_flags |= in acpi_ns_install_node()
220 /* Link the new entry into the parent and existing children */ in acpi_ns_install_node()
222 node->peer = NULL; in acpi_ns_install_node()
223 node->parent = parent_node; in acpi_ns_install_node()
224 child_node = parent_node->child; in acpi_ns_install_node()
227 parent_node->child = node; in acpi_ns_install_node()
231 while (child_node->peer) { in acpi_ns_install_node()
232 child_node = child_node->peer; in acpi_ns_install_node()
235 child_node->peer = node; in acpi_ns_install_node()
240 node->owner_id = owner_id; in acpi_ns_install_node()
241 node->type = (u8) type; in acpi_ns_install_node()
246 acpi_ut_get_type_name(node->type), node, owner_id, in acpi_ns_install_node()
248 acpi_ut_get_type_name(parent_node->type), in acpi_ns_install_node()
258 * PARAMETERS: parent_node - Delete this objects children
262 * DESCRIPTION: Delete all children of the parent object. In other words,
280 next_node = parent_node->child; in acpi_ns_delete_children()
285 if (next_node->child) { in acpi_ns_delete_children()
291 * Delete this child node and move on to the next child in the list. in acpi_ns_delete_children()
295 next_node = next_node->peer; in acpi_ns_delete_children()
299 /* Clear the parent's child pointer */ in acpi_ns_delete_children()
301 parent_node->child = NULL; in acpi_ns_delete_children()
309 * PARAMETERS: parent_node - Root of the subtree to be deleted
348 /* Found a child node - detach any attached object */ in acpi_ns_delete_namespace_subtree()
354 if (child_node->child) { in acpi_ns_delete_namespace_subtree()
356 * There is at least one child of this node, in acpi_ns_delete_namespace_subtree()
365 * No more children of this parent node. in acpi_ns_delete_namespace_subtree()
368 level--; in acpi_ns_delete_namespace_subtree()
371 * Now delete all of the children of this parent in acpi_ns_delete_namespace_subtree()
376 /* New "last child" is this parent node */ in acpi_ns_delete_namespace_subtree()
382 parent_node = parent_node->parent; in acpi_ns_delete_namespace_subtree()
394 * PARAMETERS: owner_id - All nodes with this owner will be deleted
438 * Get the next child of this parent node. When child_node is NULL, in acpi_ns_delete_namespace_by_owner()
439 * the first child of the parent is returned in acpi_ns_delete_namespace_by_owner()
450 if (child_node->owner_id == owner_id) { in acpi_ns_delete_namespace_by_owner()
452 /* Found a matching child node - detach any attached object */ in acpi_ns_delete_namespace_by_owner()
459 if (child_node->child) { in acpi_ns_delete_namespace_by_owner()
461 * There is at least one child of this node, in acpi_ns_delete_namespace_by_owner()
467 } else if (child_node->owner_id == owner_id) { in acpi_ns_delete_namespace_by_owner()
472 * No more children of this parent node. in acpi_ns_delete_namespace_by_owner()
475 level--; in acpi_ns_delete_namespace_by_owner()
477 if (parent_node->owner_id == owner_id) { in acpi_ns_delete_namespace_by_owner()
482 /* New "last child" is this parent node */ in acpi_ns_delete_namespace_by_owner()
488 parent_node = parent_node->parent; in acpi_ns_delete_namespace_by_owner()