nsaccess.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. /*******************************************************************************
  2. *
  3. * Module Name: nsaccess - Top-level functions for accessing ACPI namespace
  4. *
  5. ******************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2016, Intel Corp.
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #include <acpi/acpi.h>
  43. #include "accommon.h"
  44. #include "amlcode.h"
  45. #include "acnamesp.h"
  46. #include "acdispat.h"
  47. #define _COMPONENT ACPI_NAMESPACE
  48. ACPI_MODULE_NAME("nsaccess")
  49. /*******************************************************************************
  50. *
  51. * FUNCTION: acpi_ns_root_initialize
  52. *
  53. * PARAMETERS: None
  54. *
  55. * RETURN: Status
  56. *
  57. * DESCRIPTION: Allocate and initialize the default root named objects
  58. *
  59. * MUTEX: Locks namespace for entire execution
  60. *
  61. ******************************************************************************/
  62. acpi_status acpi_ns_root_initialize(void)
  63. {
  64. acpi_status status;
  65. const struct acpi_predefined_names *init_val = NULL;
  66. struct acpi_namespace_node *new_node;
  67. union acpi_operand_object *obj_desc;
  68. acpi_string val = NULL;
  69. ACPI_FUNCTION_TRACE(ns_root_initialize);
  70. status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
  71. if (ACPI_FAILURE(status)) {
  72. return_ACPI_STATUS(status);
  73. }
  74. /*
  75. * The global root ptr is initially NULL, so a non-NULL value indicates
  76. * that acpi_ns_root_initialize() has already been called; just return.
  77. */
  78. if (acpi_gbl_root_node) {
  79. status = AE_OK;
  80. goto unlock_and_exit;
  81. }
  82. /*
  83. * Tell the rest of the subsystem that the root is initialized
  84. * (This is OK because the namespace is locked)
  85. */
  86. acpi_gbl_root_node = &acpi_gbl_root_node_struct;
  87. /* Enter the pre-defined names in the name table */
  88. ACPI_DEBUG_PRINT((ACPI_DB_INFO,
  89. "Entering predefined entries into namespace\n"));
  90. for (init_val = acpi_gbl_pre_defined_names; init_val->name; init_val++) {
  91. /* _OSI is optional for now, will be permanent later */
  92. if (!strcmp(init_val->name, "_OSI")
  93. && !acpi_gbl_create_osi_method) {
  94. continue;
  95. }
  96. status =
  97. acpi_ns_lookup(NULL, ACPI_CAST_PTR(char, init_val->name),
  98. init_val->type, ACPI_IMODE_LOAD_PASS2,
  99. ACPI_NS_NO_UPSEARCH, NULL, &new_node);
  100. if (ACPI_FAILURE(status)) {
  101. ACPI_EXCEPTION((AE_INFO, status,
  102. "Could not create predefined name %s",
  103. init_val->name));
  104. continue;
  105. }
  106. /*
  107. * Name entered successfully. If entry in pre_defined_names[] specifies
  108. * an initial value, create the initial value.
  109. */
  110. if (init_val->val) {
  111. status = acpi_os_predefined_override(init_val, &val);
  112. if (ACPI_FAILURE(status)) {
  113. ACPI_ERROR((AE_INFO,
  114. "Could not override predefined %s",
  115. init_val->name));
  116. }
  117. if (!val) {
  118. val = init_val->val;
  119. }
  120. /*
  121. * Entry requests an initial value, allocate a
  122. * descriptor for it.
  123. */
  124. obj_desc =
  125. acpi_ut_create_internal_object(init_val->type);
  126. if (!obj_desc) {
  127. status = AE_NO_MEMORY;
  128. goto unlock_and_exit;
  129. }
  130. /*
  131. * Convert value string from table entry to
  132. * internal representation. Only types actually
  133. * used for initial values are implemented here.
  134. */
  135. switch (init_val->type) {
  136. case ACPI_TYPE_METHOD:
  137. obj_desc->method.param_count =
  138. (u8) ACPI_TO_INTEGER(val);
  139. obj_desc->common.flags |= AOPOBJ_DATA_VALID;
  140. #if defined (ACPI_ASL_COMPILER)
  141. /* Save the parameter count for the iASL compiler */
  142. new_node->value = obj_desc->method.param_count;
  143. #else
  144. /* Mark this as a very SPECIAL method */
  145. obj_desc->method.info_flags =
  146. ACPI_METHOD_INTERNAL_ONLY;
  147. obj_desc->method.dispatch.implementation =
  148. acpi_ut_osi_implementation;
  149. #endif
  150. break;
  151. case ACPI_TYPE_INTEGER:
  152. obj_desc->integer.value = ACPI_TO_INTEGER(val);
  153. break;
  154. case ACPI_TYPE_STRING:
  155. /* Build an object around the static string */
  156. obj_desc->string.length = (u32)strlen(val);
  157. obj_desc->string.pointer = val;
  158. obj_desc->common.flags |= AOPOBJ_STATIC_POINTER;
  159. break;
  160. case ACPI_TYPE_MUTEX:
  161. obj_desc->mutex.node = new_node;
  162. obj_desc->mutex.sync_level =
  163. (u8) (ACPI_TO_INTEGER(val) - 1);
  164. /* Create a mutex */
  165. status =
  166. acpi_os_create_mutex(&obj_desc->mutex.
  167. os_mutex);
  168. if (ACPI_FAILURE(status)) {
  169. acpi_ut_remove_reference(obj_desc);
  170. goto unlock_and_exit;
  171. }
  172. /* Special case for ACPI Global Lock */
  173. if (strcmp(init_val->name, "_GL_") == 0) {
  174. acpi_gbl_global_lock_mutex = obj_desc;
  175. /* Create additional counting semaphore for global lock */
  176. status =
  177. acpi_os_create_semaphore(1, 0,
  178. &acpi_gbl_global_lock_semaphore);
  179. if (ACPI_FAILURE(status)) {
  180. acpi_ut_remove_reference
  181. (obj_desc);
  182. goto unlock_and_exit;
  183. }
  184. }
  185. break;
  186. default:
  187. ACPI_ERROR((AE_INFO,
  188. "Unsupported initial type value 0x%X",
  189. init_val->type));
  190. acpi_ut_remove_reference(obj_desc);
  191. obj_desc = NULL;
  192. continue;
  193. }
  194. /* Store pointer to value descriptor in the Node */
  195. status = acpi_ns_attach_object(new_node, obj_desc,
  196. obj_desc->common.type);
  197. /* Remove local reference to the object */
  198. acpi_ut_remove_reference(obj_desc);
  199. }
  200. }
  201. unlock_and_exit:
  202. (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
  203. /* Save a handle to "_GPE", it is always present */
  204. if (ACPI_SUCCESS(status)) {
  205. status = acpi_ns_get_node(NULL, "\\_GPE", ACPI_NS_NO_UPSEARCH,
  206. &acpi_gbl_fadt_gpe_device);
  207. }
  208. return_ACPI_STATUS(status);
  209. }
  210. /*******************************************************************************
  211. *
  212. * FUNCTION: acpi_ns_lookup
  213. *
  214. * PARAMETERS: scope_info - Current scope info block
  215. * pathname - Search pathname, in internal format
  216. * (as represented in the AML stream)
  217. * type - Type associated with name
  218. * interpreter_mode - IMODE_LOAD_PASS2 => add name if not found
  219. * flags - Flags describing the search restrictions
  220. * walk_state - Current state of the walk
  221. * return_node - Where the Node is placed (if found
  222. * or created successfully)
  223. *
  224. * RETURN: Status
  225. *
  226. * DESCRIPTION: Find or enter the passed name in the name space.
  227. * Log an error if name not found in Exec mode.
  228. *
  229. * MUTEX: Assumes namespace is locked.
  230. *
  231. ******************************************************************************/
  232. acpi_status
  233. acpi_ns_lookup(union acpi_generic_state *scope_info,
  234. char *pathname,
  235. acpi_object_type type,
  236. acpi_interpreter_mode interpreter_mode,
  237. u32 flags,
  238. struct acpi_walk_state *walk_state,
  239. struct acpi_namespace_node **return_node)
  240. {
  241. acpi_status status;
  242. char *path = pathname;
  243. struct acpi_namespace_node *prefix_node;
  244. struct acpi_namespace_node *current_node = NULL;
  245. struct acpi_namespace_node *this_node = NULL;
  246. u32 num_segments;
  247. u32 num_carats;
  248. acpi_name simple_name;
  249. acpi_object_type type_to_check_for;
  250. acpi_object_type this_search_type;
  251. u32 search_parent_flag = ACPI_NS_SEARCH_PARENT;
  252. u32 local_flags;
  253. ACPI_FUNCTION_TRACE(ns_lookup);
  254. if (!return_node) {
  255. return_ACPI_STATUS(AE_BAD_PARAMETER);
  256. }
  257. local_flags = flags &
  258. ~(ACPI_NS_ERROR_IF_FOUND | ACPI_NS_OVERRIDE_IF_FOUND |
  259. ACPI_NS_SEARCH_PARENT);
  260. *return_node = ACPI_ENTRY_NOT_FOUND;
  261. acpi_gbl_ns_lookup_count++;
  262. if (!acpi_gbl_root_node) {
  263. return_ACPI_STATUS(AE_NO_NAMESPACE);
  264. }
  265. /* Get the prefix scope. A null scope means use the root scope */
  266. if ((!scope_info) || (!scope_info->scope.node)) {
  267. ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
  268. "Null scope prefix, using root node (%p)\n",
  269. acpi_gbl_root_node));
  270. prefix_node = acpi_gbl_root_node;
  271. } else {
  272. prefix_node = scope_info->scope.node;
  273. if (ACPI_GET_DESCRIPTOR_TYPE(prefix_node) !=
  274. ACPI_DESC_TYPE_NAMED) {
  275. ACPI_ERROR((AE_INFO, "%p is not a namespace node [%s]",
  276. prefix_node,
  277. acpi_ut_get_descriptor_name(prefix_node)));
  278. return_ACPI_STATUS(AE_AML_INTERNAL);
  279. }
  280. if (!(flags & ACPI_NS_PREFIX_IS_SCOPE)) {
  281. /*
  282. * This node might not be a actual "scope" node (such as a
  283. * Device/Method, etc.) It could be a Package or other object
  284. * node. Backup up the tree to find the containing scope node.
  285. */
  286. while (!acpi_ns_opens_scope(prefix_node->type) &&
  287. prefix_node->type != ACPI_TYPE_ANY) {
  288. prefix_node = prefix_node->parent;
  289. }
  290. }
  291. }
  292. /* Save type. TBD: may be no longer necessary */
  293. type_to_check_for = type;
  294. /*
  295. * Begin examination of the actual pathname
  296. */
  297. if (!pathname) {
  298. /* A Null name_path is allowed and refers to the root */
  299. num_segments = 0;
  300. this_node = acpi_gbl_root_node;
  301. path = "";
  302. ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
  303. "Null Pathname (Zero segments), Flags=%X\n",
  304. flags));
  305. } else {
  306. /*
  307. * Name pointer is valid (and must be in internal name format)
  308. *
  309. * Check for scope prefixes:
  310. *
  311. * As represented in the AML stream, a namepath consists of an
  312. * optional scope prefix followed by a name segment part.
  313. *
  314. * If present, the scope prefix is either a Root Prefix (in
  315. * which case the name is fully qualified), or one or more
  316. * Parent Prefixes (in which case the name's scope is relative
  317. * to the current scope).
  318. */
  319. if (*path == (u8) AML_ROOT_PREFIX) {
  320. /* Pathname is fully qualified, start from the root */
  321. this_node = acpi_gbl_root_node;
  322. search_parent_flag = ACPI_NS_NO_UPSEARCH;
  323. /* Point to name segment part */
  324. path++;
  325. ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
  326. "Path is absolute from root [%p]\n",
  327. this_node));
  328. } else {
  329. /* Pathname is relative to current scope, start there */
  330. ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
  331. "Searching relative to prefix scope [%4.4s] (%p)\n",
  332. acpi_ut_get_node_name(prefix_node),
  333. prefix_node));
  334. /*
  335. * Handle multiple Parent Prefixes (carat) by just getting
  336. * the parent node for each prefix instance.
  337. */
  338. this_node = prefix_node;
  339. num_carats = 0;
  340. while (*path == (u8) AML_PARENT_PREFIX) {
  341. /* Name is fully qualified, no search rules apply */
  342. search_parent_flag = ACPI_NS_NO_UPSEARCH;
  343. /*
  344. * Point past this prefix to the name segment
  345. * part or the next Parent Prefix
  346. */
  347. path++;
  348. /* Backup to the parent node */
  349. num_carats++;
  350. this_node = this_node->parent;
  351. if (!this_node) {
  352. /* Current scope has no parent scope */
  353. ACPI_ERROR((AE_INFO,
  354. "%s: Path has too many parent prefixes (^) "
  355. "- reached beyond root node",
  356. pathname));
  357. return_ACPI_STATUS(AE_NOT_FOUND);
  358. }
  359. }
  360. if (search_parent_flag == ACPI_NS_NO_UPSEARCH) {
  361. ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
  362. "Search scope is [%4.4s], path has %u carat(s)\n",
  363. acpi_ut_get_node_name
  364. (this_node), num_carats));
  365. }
  366. }
  367. /*
  368. * Determine the number of ACPI name segments in this pathname.
  369. *
  370. * The segment part consists of either:
  371. * - A Null name segment (0)
  372. * - A dual_name_prefix followed by two 4-byte name segments
  373. * - A multi_name_prefix followed by a byte indicating the
  374. * number of segments and the segments themselves.
  375. * - A single 4-byte name segment
  376. *
  377. * Examine the name prefix opcode, if any, to determine the number of
  378. * segments.
  379. */
  380. switch (*path) {
  381. case 0:
  382. /*
  383. * Null name after a root or parent prefixes. We already
  384. * have the correct target node and there are no name segments.
  385. */
  386. num_segments = 0;
  387. type = this_node->type;
  388. ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
  389. "Prefix-only Pathname (Zero name segments), Flags=%X\n",
  390. flags));
  391. break;
  392. case AML_DUAL_NAME_PREFIX:
  393. /* More than one name_seg, search rules do not apply */
  394. search_parent_flag = ACPI_NS_NO_UPSEARCH;
  395. /* Two segments, point to first name segment */
  396. num_segments = 2;
  397. path++;
  398. ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
  399. "Dual Pathname (2 segments, Flags=%X)\n",
  400. flags));
  401. break;
  402. case AML_MULTI_NAME_PREFIX_OP:
  403. /* More than one name_seg, search rules do not apply */
  404. search_parent_flag = ACPI_NS_NO_UPSEARCH;
  405. /* Extract segment count, point to first name segment */
  406. path++;
  407. num_segments = (u32) (u8) * path;
  408. path++;
  409. ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
  410. "Multi Pathname (%u Segments, Flags=%X)\n",
  411. num_segments, flags));
  412. break;
  413. default:
  414. /*
  415. * Not a Null name, no Dual or Multi prefix, hence there is
  416. * only one name segment and Pathname is already pointing to it.
  417. */
  418. num_segments = 1;
  419. ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
  420. "Simple Pathname (1 segment, Flags=%X)\n",
  421. flags));
  422. break;
  423. }
  424. ACPI_DEBUG_EXEC(acpi_ns_print_pathname(num_segments, path));
  425. }
  426. /*
  427. * Search namespace for each segment of the name. Loop through and
  428. * verify (or add to the namespace) each name segment.
  429. *
  430. * The object type is significant only at the last name
  431. * segment. (We don't care about the types along the path, only
  432. * the type of the final target object.)
  433. */
  434. this_search_type = ACPI_TYPE_ANY;
  435. current_node = this_node;
  436. while (num_segments && current_node) {
  437. num_segments--;
  438. if (!num_segments) {
  439. /* This is the last segment, enable typechecking */
  440. this_search_type = type;
  441. /*
  442. * Only allow automatic parent search (search rules) if the caller
  443. * requested it AND we have a single, non-fully-qualified name_seg
  444. */
  445. if ((search_parent_flag != ACPI_NS_NO_UPSEARCH) &&
  446. (flags & ACPI_NS_SEARCH_PARENT)) {
  447. local_flags |= ACPI_NS_SEARCH_PARENT;
  448. }
  449. /* Set error flag according to caller */
  450. if (flags & ACPI_NS_ERROR_IF_FOUND) {
  451. local_flags |= ACPI_NS_ERROR_IF_FOUND;
  452. }
  453. /* Set override flag according to caller */
  454. if (flags & ACPI_NS_OVERRIDE_IF_FOUND) {
  455. local_flags |= ACPI_NS_OVERRIDE_IF_FOUND;
  456. }
  457. }
  458. /* Extract one ACPI name from the front of the pathname */
  459. ACPI_MOVE_32_TO_32(&simple_name, path);
  460. /* Try to find the single (4 character) ACPI name */
  461. status =
  462. acpi_ns_search_and_enter(simple_name, walk_state,
  463. current_node, interpreter_mode,
  464. this_search_type, local_flags,
  465. &this_node);
  466. if (ACPI_FAILURE(status)) {
  467. if (status == AE_NOT_FOUND) {
  468. /* Name not found in ACPI namespace */
  469. ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
  470. "Name [%4.4s] not found in scope [%4.4s] %p\n",
  471. (char *)&simple_name,
  472. (char *)&current_node->name,
  473. current_node));
  474. }
  475. *return_node = this_node;
  476. return_ACPI_STATUS(status);
  477. }
  478. /* More segments to follow? */
  479. if (num_segments > 0) {
  480. /*
  481. * If we have an alias to an object that opens a scope (such as a
  482. * device or processor), we need to dereference the alias here so
  483. * that we can access any children of the original node (via the
  484. * remaining segments).
  485. */
  486. if (this_node->type == ACPI_TYPE_LOCAL_ALIAS) {
  487. if (!this_node->object) {
  488. return_ACPI_STATUS(AE_NOT_EXIST);
  489. }
  490. if (acpi_ns_opens_scope
  491. (((struct acpi_namespace_node *)
  492. this_node->object)->type)) {
  493. this_node =
  494. (struct acpi_namespace_node *)
  495. this_node->object;
  496. }
  497. }
  498. }
  499. /* Special handling for the last segment (num_segments == 0) */
  500. else {
  501. /*
  502. * Sanity typecheck of the target object:
  503. *
  504. * If 1) This is the last segment (num_segments == 0)
  505. * 2) And we are looking for a specific type
  506. * (Not checking for TYPE_ANY)
  507. * 3) Which is not an alias
  508. * 4) Which is not a local type (TYPE_SCOPE)
  509. * 5) And the type of target object is known (not TYPE_ANY)
  510. * 6) And target object does not match what we are looking for
  511. *
  512. * Then we have a type mismatch. Just warn and ignore it.
  513. */
  514. if ((type_to_check_for != ACPI_TYPE_ANY) &&
  515. (type_to_check_for != ACPI_TYPE_LOCAL_ALIAS) &&
  516. (type_to_check_for != ACPI_TYPE_LOCAL_METHOD_ALIAS)
  517. && (type_to_check_for != ACPI_TYPE_LOCAL_SCOPE)
  518. && (this_node->type != ACPI_TYPE_ANY)
  519. && (this_node->type != type_to_check_for)) {
  520. /* Complain about a type mismatch */
  521. ACPI_WARNING((AE_INFO,
  522. "NsLookup: Type mismatch on %4.4s (%s), searching for (%s)",
  523. ACPI_CAST_PTR(char, &simple_name),
  524. acpi_ut_get_type_name(this_node->
  525. type),
  526. acpi_ut_get_type_name
  527. (type_to_check_for)));
  528. }
  529. /*
  530. * If this is the last name segment and we are not looking for a
  531. * specific type, but the type of found object is known, use that
  532. * type to (later) see if it opens a scope.
  533. */
  534. if (type == ACPI_TYPE_ANY) {
  535. type = this_node->type;
  536. }
  537. }
  538. /* Point to next name segment and make this node current */
  539. path += ACPI_NAME_SIZE;
  540. current_node = this_node;
  541. }
  542. /* Always check if we need to open a new scope */
  543. if (!(flags & ACPI_NS_DONT_OPEN_SCOPE) && (walk_state)) {
  544. /*
  545. * If entry is a type which opens a scope, push the new scope on the
  546. * scope stack.
  547. */
  548. if (acpi_ns_opens_scope(type)) {
  549. status =
  550. acpi_ds_scope_stack_push(this_node, type,
  551. walk_state);
  552. if (ACPI_FAILURE(status)) {
  553. return_ACPI_STATUS(status);
  554. }
  555. }
  556. }
  557. *return_node = this_node;
  558. return_ACPI_STATUS(AE_OK);
  559. }