blob: e9c9a63bb6a4f4218f417ab28489895c7067990d [file] [log] [blame]
Erik Schmauss95857632018-03-14 16:13:07 -07001// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*******************************************************************************
3 *
4 * Module Name: nssearch - Namespace search
5 *
6 ******************************************************************************/
7
Linus Torvalds1da177e2005-04-16 15:20:36 -07008#include <acpi/acpi.h>
Len Browne2f7a772009-01-09 00:30:03 -05009#include "accommon.h"
10#include "acnamesp.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
Bob Mooree4c1ebf2009-04-22 13:02:06 +080012#ifdef ACPI_ASL_COMPILER
13#include "amlcode.h"
14#endif
15
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#define _COMPONENT ACPI_NAMESPACE
Len Brown4be44fc2005-08-05 00:44:28 -040017ACPI_MODULE_NAME("nssearch")
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
Robert Moore44f6c012005-04-18 22:49:35 -040019/* Local prototypes */
Robert Moore44f6c012005-04-18 22:49:35 -040020static acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -040021acpi_ns_search_parent_tree(u32 target_name,
22 struct acpi_namespace_node *node,
23 acpi_object_type type,
24 struct acpi_namespace_node **return_node);
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
26/*******************************************************************************
27 *
Bob Moore41195322006-05-26 16:36:00 -040028 * FUNCTION: acpi_ns_search_one_scope
Linus Torvalds1da177e2005-04-16 15:20:36 -070029 *
Robert Moore44f6c012005-04-18 22:49:35 -040030 * PARAMETERS: target_name - Ascii ACPI name to search for
Bob Moore41195322006-05-26 16:36:00 -040031 * parent_node - Starting node where search will begin
Bob Mooreba494be2012-07-12 09:40:10 +080032 * type - Object type to match
Robert Moore44f6c012005-04-18 22:49:35 -040033 * return_node - Where the matched Named obj is returned
Linus Torvalds1da177e2005-04-16 15:20:36 -070034 *
35 * RETURN: Status
36 *
Bob Moore41195322006-05-26 16:36:00 -040037 * DESCRIPTION: Search a single level of the namespace. Performs a
Linus Torvalds1da177e2005-04-16 15:20:36 -070038 * simple search of the specified level, and does not add
39 * entries or search parents.
40 *
41 *
42 * Named object lists are built (and subsequently dumped) in the
43 * order in which the names are encountered during the namespace load;
44 *
45 * All namespace searching is linear in this implementation, but
46 * could be easily modified to support any improved search
Bob Moore41195322006-05-26 16:36:00 -040047 * algorithm. However, the linear search was chosen for simplicity
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 * and because the trees are small and the other interpreter
49 * execution overhead is relatively high.
50 *
Bob Moore41195322006-05-26 16:36:00 -040051 * Note: CPU execution analysis has shown that the AML interpreter spends
52 * a very small percentage of its time searching the namespace. Therefore,
53 * the linear search seems to be sufficient, as there would seem to be
54 * little value in improving the search.
55 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070056 ******************************************************************************/
57
58acpi_status
Bob Moore41195322006-05-26 16:36:00 -040059acpi_ns_search_one_scope(u32 target_name,
60 struct acpi_namespace_node *parent_node,
61 acpi_object_type type,
62 struct acpi_namespace_node **return_node)
Linus Torvalds1da177e2005-04-16 15:20:36 -070063{
Bob Moore41195322006-05-26 16:36:00 -040064 struct acpi_namespace_node *node;
Linus Torvalds1da177e2005-04-16 15:20:36 -070065
Bob Moore41195322006-05-26 16:36:00 -040066 ACPI_FUNCTION_TRACE(ns_search_one_scope);
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
68#ifdef ACPI_DEBUG_OUTPUT
69 if (ACPI_LV_NAMES & acpi_dbg_level) {
Len Brown4be44fc2005-08-05 00:44:28 -040070 char *scope_name;
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
Lv Zheng0e166e42015-12-29 13:53:50 +080072 scope_name = acpi_ns_get_normalized_pathname(parent_node, TRUE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070073 if (scope_name) {
Len Brown4be44fc2005-08-05 00:44:28 -040074 ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
75 "Searching %s (%p) For [%4.4s] (%s)\n",
Bob Moore41195322006-05-26 16:36:00 -040076 scope_name, parent_node,
77 ACPI_CAST_PTR(char, &target_name),
Len Brown4be44fc2005-08-05 00:44:28 -040078 acpi_ut_get_type_name(type)));
Linus Torvalds1da177e2005-04-16 15:20:36 -070079
Bob Moore83135242006-10-03 00:00:00 -040080 ACPI_FREE(scope_name);
Linus Torvalds1da177e2005-04-16 15:20:36 -070081 }
82 }
83#endif
84
85 /*
86 * Search for name at this namespace level, which is to say that we
87 * must search for the name among the children of this object
88 */
Bob Moore41195322006-05-26 16:36:00 -040089 node = parent_node->child;
90 while (node) {
Bob Moore52fc0b02006-10-02 00:00:00 -040091
Linus Torvalds1da177e2005-04-16 15:20:36 -070092 /* Check for match against the name */
93
Bob Moore41195322006-05-26 16:36:00 -040094 if (node->name.integer == target_name) {
Bob Moore52fc0b02006-10-02 00:00:00 -040095
Linus Torvalds1da177e2005-04-16 15:20:36 -070096 /* Resolve a control method alias if any */
97
Bob Moore41195322006-05-26 16:36:00 -040098 if (acpi_ns_get_type(node) ==
Len Brown4be44fc2005-08-05 00:44:28 -040099 ACPI_TYPE_LOCAL_METHOD_ALIAS) {
Bob Moore41195322006-05-26 16:36:00 -0400100 node =
Len Brown4be44fc2005-08-05 00:44:28 -0400101 ACPI_CAST_PTR(struct acpi_namespace_node,
Bob Moore41195322006-05-26 16:36:00 -0400102 node->object);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103 }
104
Bob Moore793c2382006-03-31 00:00:00 -0500105 /* Found matching entry */
106
Len Brown4be44fc2005-08-05 00:44:28 -0400107 ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
108 "Name [%4.4s] (%s) %p found in scope [%4.4s] %p\n",
Bob Mooredefba1d2005-12-16 17:05:00 -0500109 ACPI_CAST_PTR(char, &target_name),
Bob Moore41195322006-05-26 16:36:00 -0400110 acpi_ut_get_type_name(node->type),
111 node,
112 acpi_ut_get_node_name(parent_node),
113 parent_node));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114
Bob Moore41195322006-05-26 16:36:00 -0400115 *return_node = node;
Len Brown4be44fc2005-08-05 00:44:28 -0400116 return_ACPI_STATUS(AE_OK);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117 }
118
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119 /* Didn't match name, move on to the next peer object */
120
Bob Moore41195322006-05-26 16:36:00 -0400121 node = node->peer;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122 }
123
124 /* Searched entire namespace level, not found */
125
Len Brown4be44fc2005-08-05 00:44:28 -0400126 ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
Bob Moored4913dc2009-03-06 10:05:18 +0800127 "Name [%4.4s] (%s) not found in search in scope [%4.4s] "
128 "%p first child %p\n",
Bob Mooredefba1d2005-12-16 17:05:00 -0500129 ACPI_CAST_PTR(char, &target_name),
130 acpi_ut_get_type_name(type),
Bob Moore41195322006-05-26 16:36:00 -0400131 acpi_ut_get_node_name(parent_node), parent_node,
132 parent_node->child));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133
Len Brown4be44fc2005-08-05 00:44:28 -0400134 return_ACPI_STATUS(AE_NOT_FOUND);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135}
136
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137/*******************************************************************************
138 *
139 * FUNCTION: acpi_ns_search_parent_tree
140 *
Robert Moore44f6c012005-04-18 22:49:35 -0400141 * PARAMETERS: target_name - Ascii ACPI name to search for
Bob Mooreba494be2012-07-12 09:40:10 +0800142 * node - Starting node where search will begin
143 * type - Object type to match
Robert Moore44f6c012005-04-18 22:49:35 -0400144 * return_node - Where the matched Node is returned
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145 *
146 * RETURN: Status
147 *
148 * DESCRIPTION: Called when a name has not been found in the current namespace
Bob Moore41195322006-05-26 16:36:00 -0400149 * level. Before adding it or giving up, ACPI scope rules require
Linus Torvalds1da177e2005-04-16 15:20:36 -0700150 * searching enclosing scopes in cases identified by acpi_ns_local().
151 *
152 * "A name is located by finding the matching name in the current
153 * name space, and then in the parent name space. If the parent
154 * name space does not contain the name, the search continues
155 * recursively until either the name is found or the name space
Bob Moore41195322006-05-26 16:36:00 -0400156 * does not have a parent (the root of the name space). This
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157 * indicates that the name is not found" (From ACPI Specification,
158 * section 5.3)
159 *
160 ******************************************************************************/
161
162static acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400163acpi_ns_search_parent_tree(u32 target_name,
164 struct acpi_namespace_node *node,
165 acpi_object_type type,
166 struct acpi_namespace_node **return_node)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167{
Len Brown4be44fc2005-08-05 00:44:28 -0400168 acpi_status status;
169 struct acpi_namespace_node *parent_node;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170
Bob Mooreb229cf92006-04-21 17:15:00 -0400171 ACPI_FUNCTION_TRACE(ns_search_parent_tree);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700172
Alexey Starikovskiyc45b5c02010-05-26 11:53:07 +0800173 parent_node = node->parent;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700174
175 /*
176 * If there is no parent (i.e., we are at the root) or type is "local",
177 * we won't be searching the parent tree.
178 */
179 if (!parent_node) {
Len Brown4be44fc2005-08-05 00:44:28 -0400180 ACPI_DEBUG_PRINT((ACPI_DB_NAMES, "[%4.4s] has no parent\n",
Bob Mooredefba1d2005-12-16 17:05:00 -0500181 ACPI_CAST_PTR(char, &target_name)));
Len Brown4be44fc2005-08-05 00:44:28 -0400182 return_ACPI_STATUS(AE_NOT_FOUND);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183 }
184
Len Brown4be44fc2005-08-05 00:44:28 -0400185 if (acpi_ns_local(type)) {
186 ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
187 "[%4.4s] type [%s] must be local to this scope (no parent search)\n",
Bob Mooredefba1d2005-12-16 17:05:00 -0500188 ACPI_CAST_PTR(char, &target_name),
Len Brown4be44fc2005-08-05 00:44:28 -0400189 acpi_ut_get_type_name(type)));
190 return_ACPI_STATUS(AE_NOT_FOUND);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700191 }
192
193 /* Search the parent tree */
194
Len Brown4be44fc2005-08-05 00:44:28 -0400195 ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
196 "Searching parent [%4.4s] for [%4.4s]\n",
197 acpi_ut_get_node_name(parent_node),
Bob Mooredefba1d2005-12-16 17:05:00 -0500198 ACPI_CAST_PTR(char, &target_name)));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199
Bob Moored4913dc2009-03-06 10:05:18 +0800200 /* Search parents until target is found or we have backed up to the root */
201
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202 while (parent_node) {
203 /*
Bob Moore41195322006-05-26 16:36:00 -0400204 * Search parent scope. Use TYPE_ANY because we don't care about the
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205 * object type at this point, we only care about the existence of
Bob Moore41195322006-05-26 16:36:00 -0400206 * the actual name we are searching for. Typechecking comes later.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700207 */
Bob Moore41195322006-05-26 16:36:00 -0400208 status =
209 acpi_ns_search_one_scope(target_name, parent_node,
Len Brown4be44fc2005-08-05 00:44:28 -0400210 ACPI_TYPE_ANY, return_node);
211 if (ACPI_SUCCESS(status)) {
212 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700213 }
214
Bob Moore793c2382006-03-31 00:00:00 -0500215 /* Not found here, go up another level (until we reach the root) */
216
Alexey Starikovskiyc45b5c02010-05-26 11:53:07 +0800217 parent_node = parent_node->parent;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218 }
219
220 /* Not found in parent tree */
221
Len Brown4be44fc2005-08-05 00:44:28 -0400222 return_ACPI_STATUS(AE_NOT_FOUND);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700223}
224
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225/*******************************************************************************
226 *
227 * FUNCTION: acpi_ns_search_and_enter
228 *
229 * PARAMETERS: target_name - Ascii ACPI name to search for (4 chars)
230 * walk_state - Current state of the walk
Bob Mooreba494be2012-07-12 09:40:10 +0800231 * node - Starting node where search will begin
Linus Torvalds1da177e2005-04-16 15:20:36 -0700232 * interpreter_mode - Add names only in ACPI_MODE_LOAD_PASS_x.
233 * Otherwise,search only.
Bob Mooreba494be2012-07-12 09:40:10 +0800234 * type - Object type to match
235 * flags - Flags describing the search restrictions
Robert Moore44f6c012005-04-18 22:49:35 -0400236 * return_node - Where the Node is returned
Linus Torvalds1da177e2005-04-16 15:20:36 -0700237 *
238 * RETURN: Status
239 *
240 * DESCRIPTION: Search for a name segment in a single namespace level,
Bob Moore41195322006-05-26 16:36:00 -0400241 * optionally adding it if it is not found. If the passed
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242 * Type is not Any and the type previously stored in the
243 * entry was Any (i.e. unknown), update the stored type.
244 *
245 * In ACPI_IMODE_EXECUTE, search only.
246 * In other modes, search and add if not found.
247 *
248 ******************************************************************************/
249
250acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400251acpi_ns_search_and_enter(u32 target_name,
252 struct acpi_walk_state *walk_state,
253 struct acpi_namespace_node *node,
254 acpi_interpreter_mode interpreter_mode,
255 acpi_object_type type,
256 u32 flags, struct acpi_namespace_node **return_node)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700257{
Len Brown4be44fc2005-08-05 00:44:28 -0400258 acpi_status status;
259 struct acpi_namespace_node *new_node;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260
Bob Mooreb229cf92006-04-21 17:15:00 -0400261 ACPI_FUNCTION_TRACE(ns_search_and_enter);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262
263 /* Parameter validation */
264
265 if (!node || !target_name || !return_node) {
Bob Mooreb8e4d892006-01-27 16:43:00 -0500266 ACPI_ERROR((AE_INFO,
Bob Mooref6a22b02010-03-05 17:56:40 +0800267 "Null parameter: Node %p Name 0x%X ReturnNode %p",
Bob Mooreb8e4d892006-01-27 16:43:00 -0500268 node, target_name, return_node));
Len Brown4be44fc2005-08-05 00:44:28 -0400269 return_ACPI_STATUS(AE_BAD_PARAMETER);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270 }
271
Bob Moore793c2382006-03-31 00:00:00 -0500272 /*
273 * Name must consist of valid ACPI characters. We will repair the name if
274 * necessary because we don't want to abort because of this, but we want
275 * all namespace names to be printable. A warning message is appropriate.
276 *
277 * This issue came up because there are in fact machines that exhibit
278 * this problem, and we want to be able to enable ACPI support for them,
279 * even though there are a few bad names.
280 */
Bob Moore45dcd312012-10-31 02:24:51 +0000281 acpi_ut_repair_name(ACPI_CAST_PTR(char, &target_name));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700282
283 /* Try to find the name in the namespace level specified by the caller */
284
285 *return_node = ACPI_ENTRY_NOT_FOUND;
Bob Moore41195322006-05-26 16:36:00 -0400286 status = acpi_ns_search_one_scope(target_name, node, type, return_node);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700287 if (status != AE_NOT_FOUND) {
288 /*
289 * If we found it AND the request specifies that a find is an error,
290 * return the error
291 */
Lv Zheng8f6f0362015-07-01 14:44:17 +0800292 if (status == AE_OK) {
293
294 /* The node was found in the namespace */
295
296 /*
297 * If the namespace override feature is enabled for this node,
Bob Moore8ea98652015-07-01 14:44:31 +0800298 * delete any existing attached sub-object and make the node
299 * look like a new node that is owned by the override table.
Lv Zheng8f6f0362015-07-01 14:44:17 +0800300 */
301 if (flags & ACPI_NS_OVERRIDE_IF_FOUND) {
Bob Moore8ea98652015-07-01 14:44:31 +0800302 ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
303 "Namespace override: %4.4s pass %u type %X Owner %X\n",
304 ACPI_CAST_PTR(char,
305 &target_name),
306 interpreter_mode,
307 (*return_node)->type,
308 walk_state->owner_id));
309
Lv Zheng8f6f0362015-07-01 14:44:17 +0800310 acpi_ns_delete_children(*return_node);
Bob Moore8ea98652015-07-01 14:44:31 +0800311 if (acpi_gbl_runtime_namespace_override) {
312 acpi_ut_remove_reference((*return_node)->object);
313 (*return_node)->object = NULL;
314 (*return_node)->owner_id =
315 walk_state->owner_id;
316 } else {
317 acpi_ns_remove_node(*return_node);
318 *return_node = ACPI_ENTRY_NOT_FOUND;
319 }
Lv Zheng8f6f0362015-07-01 14:44:17 +0800320 }
321
322 /* Return an error if we don't expect to find the object */
323
324 else if (flags & ACPI_NS_ERROR_IF_FOUND) {
325 status = AE_ALREADY_EXISTS;
326 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700327 }
Lv Zheng56324c12012-12-19 05:37:03 +0000328#ifdef ACPI_ASL_COMPILER
329 if (*return_node && (*return_node)->type == ACPI_TYPE_ANY) {
330 (*return_node)->flags |= ANOBJ_IS_EXTERNAL;
331 }
332#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700333
Bob Moore793c2382006-03-31 00:00:00 -0500334 /* Either found it or there was an error: finished either way */
335
Len Brown4be44fc2005-08-05 00:44:28 -0400336 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337 }
338
339 /*
Bob Moore41195322006-05-26 16:36:00 -0400340 * The name was not found. If we are NOT performing the first pass
Linus Torvalds1da177e2005-04-16 15:20:36 -0700341 * (name entry) of loading the namespace, search the parent tree (all the
342 * way to the root if necessary.) We don't want to perform the parent
Bob Moore41195322006-05-26 16:36:00 -0400343 * search when the namespace is actually being loaded. We want to perform
Linus Torvalds1da177e2005-04-16 15:20:36 -0700344 * the search when namespace references are being resolved (load pass 2)
345 * and during the execution phase.
346 */
347 if ((interpreter_mode != ACPI_IMODE_LOAD_PASS1) &&
Len Brown4be44fc2005-08-05 00:44:28 -0400348 (flags & ACPI_NS_SEARCH_PARENT)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700349 /*
350 * Not found at this level - search parent tree according to the
351 * ACPI specification
352 */
Len Brown4be44fc2005-08-05 00:44:28 -0400353 status =
354 acpi_ns_search_parent_tree(target_name, node, type,
355 return_node);
356 if (ACPI_SUCCESS(status)) {
357 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700358 }
359 }
360
Bob Moore793c2382006-03-31 00:00:00 -0500361 /* In execute mode, just search, never add names. Exit now */
362
Linus Torvalds1da177e2005-04-16 15:20:36 -0700363 if (interpreter_mode == ACPI_IMODE_EXECUTE) {
Len Brown4be44fc2005-08-05 00:44:28 -0400364 ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
365 "%4.4s Not found in %p [Not adding]\n",
Bob Mooredefba1d2005-12-16 17:05:00 -0500366 ACPI_CAST_PTR(char, &target_name), node));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700367
Len Brown4be44fc2005-08-05 00:44:28 -0400368 return_ACPI_STATUS(AE_NOT_FOUND);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369 }
370
371 /* Create the new named object */
372
Len Brown4be44fc2005-08-05 00:44:28 -0400373 new_node = acpi_ns_create_node(target_name);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700374 if (!new_node) {
Len Brown4be44fc2005-08-05 00:44:28 -0400375 return_ACPI_STATUS(AE_NO_MEMORY);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700376 }
Bob Moore958dd242006-05-12 17:12:00 -0400377#ifdef ACPI_ASL_COMPILER
Bob Moored4913dc2009-03-06 10:05:18 +0800378
379 /* Node is an object defined by an External() statement */
380
Lv Zheng99567bc2013-10-31 09:30:04 +0800381 if (flags & ACPI_NS_EXTERNAL ||
382 (walk_state && walk_state->opcode == AML_SCOPE_OP)) {
Bob Moore958dd242006-05-12 17:12:00 -0400383 new_node->flags |= ANOBJ_IS_EXTERNAL;
Erik Schmaussb43eac62017-11-17 15:40:21 -0800384 new_node->flags |= IMPLICIT_EXTERNAL;
Bob Moore958dd242006-05-12 17:12:00 -0400385 }
386#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700387
Bob Moored1fdda832007-02-02 19:48:21 +0300388 if (flags & ACPI_NS_TEMPORARY) {
389 new_node->flags |= ANOBJ_TEMPORARY;
390 }
391
Linus Torvalds1da177e2005-04-16 15:20:36 -0700392 /* Install the new object into the parent's list of children */
393
Len Brown4be44fc2005-08-05 00:44:28 -0400394 acpi_ns_install_node(walk_state, node, new_node, type);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700395 *return_node = new_node;
Len Brown4be44fc2005-08-05 00:44:28 -0400396 return_ACPI_STATUS(AE_OK);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700397}