dswload2.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745
  1. // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
  2. /******************************************************************************
  3. *
  4. * Module Name: dswload2 - Dispatcher second pass namespace load callbacks
  5. *
  6. * Copyright (C) 2000 - 2022, Intel Corp.
  7. *
  8. *****************************************************************************/
  9. #include <acpi/acpi.h>
  10. #include "accommon.h"
  11. #include "acparser.h"
  12. #include "amlcode.h"
  13. #include "acdispat.h"
  14. #include "acinterp.h"
  15. #include "acnamesp.h"
  16. #include "acevents.h"
  17. #ifdef ACPI_EXEC_APP
  18. #include "aecommon.h"
  19. #endif
  20. #define _COMPONENT ACPI_DISPATCHER
  21. ACPI_MODULE_NAME("dswload2")
  22. /*******************************************************************************
  23. *
  24. * FUNCTION: acpi_ds_load2_begin_op
  25. *
  26. * PARAMETERS: walk_state - Current state of the parse tree walk
  27. * out_op - Where to return op if a new one is created
  28. *
  29. * RETURN: Status
  30. *
  31. * DESCRIPTION: Descending callback used during the loading of ACPI tables.
  32. *
  33. ******************************************************************************/
  34. acpi_status
  35. acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
  36. union acpi_parse_object **out_op)
  37. {
  38. union acpi_parse_object *op;
  39. struct acpi_namespace_node *node;
  40. acpi_status status;
  41. acpi_object_type object_type;
  42. char *buffer_ptr;
  43. u32 flags;
  44. ACPI_FUNCTION_TRACE(ds_load2_begin_op);
  45. op = walk_state->op;
  46. ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op,
  47. walk_state));
  48. if (op) {
  49. if ((walk_state->control_state) &&
  50. (walk_state->control_state->common.state ==
  51. ACPI_CONTROL_CONDITIONAL_EXECUTING)) {
  52. /* We are executing a while loop outside of a method */
  53. status = acpi_ds_exec_begin_op(walk_state, out_op);
  54. return_ACPI_STATUS(status);
  55. }
  56. /* We only care about Namespace opcodes here */
  57. if ((!(walk_state->op_info->flags & AML_NSOPCODE) &&
  58. (walk_state->opcode != AML_INT_NAMEPATH_OP)) ||
  59. (!(walk_state->op_info->flags & AML_NAMED))) {
  60. return_ACPI_STATUS(AE_OK);
  61. }
  62. /* Get the name we are going to enter or lookup in the namespace */
  63. if (walk_state->opcode == AML_INT_NAMEPATH_OP) {
  64. /* For Namepath op, get the path string */
  65. buffer_ptr = op->common.value.string;
  66. if (!buffer_ptr) {
  67. /* No name, just exit */
  68. return_ACPI_STATUS(AE_OK);
  69. }
  70. } else {
  71. /* Get name from the op */
  72. buffer_ptr = ACPI_CAST_PTR(char, &op->named.name);
  73. }
  74. } else {
  75. /* Get the namestring from the raw AML */
  76. buffer_ptr =
  77. acpi_ps_get_next_namestring(&walk_state->parser_state);
  78. }
  79. /* Map the opcode into an internal object type */
  80. object_type = walk_state->op_info->object_type;
  81. ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
  82. "State=%p Op=%p Type=%X\n", walk_state, op,
  83. object_type));
  84. switch (walk_state->opcode) {
  85. case AML_FIELD_OP:
  86. case AML_BANK_FIELD_OP:
  87. case AML_INDEX_FIELD_OP:
  88. node = NULL;
  89. status = AE_OK;
  90. break;
  91. case AML_INT_NAMEPATH_OP:
  92. /*
  93. * The name_path is an object reference to an existing object.
  94. * Don't enter the name into the namespace, but look it up
  95. * for use later.
  96. */
  97. status =
  98. acpi_ns_lookup(walk_state->scope_info, buffer_ptr,
  99. object_type, ACPI_IMODE_EXECUTE,
  100. ACPI_NS_SEARCH_PARENT, walk_state, &(node));
  101. break;
  102. case AML_SCOPE_OP:
  103. /* Special case for Scope(\) -> refers to the Root node */
  104. if (op && (op->named.node == acpi_gbl_root_node)) {
  105. node = op->named.node;
  106. status =
  107. acpi_ds_scope_stack_push(node, object_type,
  108. walk_state);
  109. if (ACPI_FAILURE(status)) {
  110. return_ACPI_STATUS(status);
  111. }
  112. } else {
  113. /*
  114. * The Path is an object reference to an existing object.
  115. * Don't enter the name into the namespace, but look it up
  116. * for use later.
  117. */
  118. status =
  119. acpi_ns_lookup(walk_state->scope_info, buffer_ptr,
  120. object_type, ACPI_IMODE_EXECUTE,
  121. ACPI_NS_SEARCH_PARENT, walk_state,
  122. &(node));
  123. if (ACPI_FAILURE(status)) {
  124. #ifdef ACPI_ASL_COMPILER
  125. if (status == AE_NOT_FOUND) {
  126. status = AE_OK;
  127. } else {
  128. ACPI_ERROR_NAMESPACE(walk_state->
  129. scope_info,
  130. buffer_ptr,
  131. status);
  132. }
  133. #else
  134. ACPI_ERROR_NAMESPACE(walk_state->scope_info,
  135. buffer_ptr, status);
  136. #endif
  137. return_ACPI_STATUS(status);
  138. }
  139. }
  140. /*
  141. * We must check to make sure that the target is
  142. * one of the opcodes that actually opens a scope
  143. */
  144. switch (node->type) {
  145. case ACPI_TYPE_ANY:
  146. case ACPI_TYPE_LOCAL_SCOPE: /* Scope */
  147. case ACPI_TYPE_DEVICE:
  148. case ACPI_TYPE_POWER:
  149. case ACPI_TYPE_PROCESSOR:
  150. case ACPI_TYPE_THERMAL:
  151. /* These are acceptable types */
  152. break;
  153. case ACPI_TYPE_INTEGER:
  154. case ACPI_TYPE_STRING:
  155. case ACPI_TYPE_BUFFER:
  156. /*
  157. * These types we will allow, but we will change the type.
  158. * This enables some existing code of the form:
  159. *
  160. * Name (DEB, 0)
  161. * Scope (DEB) { ... }
  162. */
  163. ACPI_WARNING((AE_INFO,
  164. "Type override - [%4.4s] had invalid type (%s) "
  165. "for Scope operator, changed to type ANY",
  166. acpi_ut_get_node_name(node),
  167. acpi_ut_get_type_name(node->type)));
  168. node->type = ACPI_TYPE_ANY;
  169. walk_state->scope_info->common.value = ACPI_TYPE_ANY;
  170. break;
  171. case ACPI_TYPE_METHOD:
  172. /*
  173. * Allow scope change to root during execution of module-level
  174. * code. Root is typed METHOD during this time.
  175. */
  176. if ((node == acpi_gbl_root_node) &&
  177. (walk_state->
  178. parse_flags & ACPI_PARSE_MODULE_LEVEL)) {
  179. break;
  180. }
  181. ACPI_FALLTHROUGH;
  182. default:
  183. /* All other types are an error */
  184. ACPI_ERROR((AE_INFO,
  185. "Invalid type (%s) for target of "
  186. "Scope operator [%4.4s] (Cannot override)",
  187. acpi_ut_get_type_name(node->type),
  188. acpi_ut_get_node_name(node)));
  189. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  190. }
  191. break;
  192. default:
  193. /* All other opcodes */
  194. if (op && op->common.node) {
  195. /* This op/node was previously entered into the namespace */
  196. node = op->common.node;
  197. if (acpi_ns_opens_scope(object_type)) {
  198. status =
  199. acpi_ds_scope_stack_push(node, object_type,
  200. walk_state);
  201. if (ACPI_FAILURE(status)) {
  202. return_ACPI_STATUS(status);
  203. }
  204. }
  205. return_ACPI_STATUS(AE_OK);
  206. }
  207. /*
  208. * Enter the named type into the internal namespace. We enter the name
  209. * as we go downward in the parse tree. Any necessary subobjects that
  210. * involve arguments to the opcode must be created as we go back up the
  211. * parse tree later.
  212. *
  213. * Note: Name may already exist if we are executing a deferred opcode.
  214. */
  215. if (walk_state->deferred_node) {
  216. /* This name is already in the namespace, get the node */
  217. node = walk_state->deferred_node;
  218. status = AE_OK;
  219. break;
  220. }
  221. flags = ACPI_NS_NO_UPSEARCH;
  222. if (walk_state->pass_number == ACPI_IMODE_EXECUTE) {
  223. /* Execution mode, node cannot already exist, node is temporary */
  224. flags |= ACPI_NS_ERROR_IF_FOUND;
  225. if (!
  226. (walk_state->
  227. parse_flags & ACPI_PARSE_MODULE_LEVEL)) {
  228. flags |= ACPI_NS_TEMPORARY;
  229. }
  230. }
  231. #ifdef ACPI_ASL_COMPILER
  232. /*
  233. * Do not open a scope for AML_EXTERNAL_OP
  234. * acpi_ns_lookup can open a new scope based on the object type
  235. * of this op. AML_EXTERNAL_OP is a declaration rather than a
  236. * definition. In the case that this external is a method object,
  237. * acpi_ns_lookup will open a new scope. However, an AML_EXTERNAL_OP
  238. * associated with the ACPI_TYPE_METHOD is a declaration, rather than
  239. * a definition. Flags is set to avoid opening a scope for any
  240. * AML_EXTERNAL_OP.
  241. */
  242. if (walk_state->opcode == AML_EXTERNAL_OP) {
  243. flags |= ACPI_NS_DONT_OPEN_SCOPE;
  244. }
  245. #endif
  246. /*
  247. * For name creation opcodes, the full namepath prefix must
  248. * exist, except for the final (new) nameseg.
  249. */
  250. if (walk_state->op_info->flags & AML_NAMED) {
  251. flags |= ACPI_NS_PREFIX_MUST_EXIST;
  252. }
  253. /* Add new entry or lookup existing entry */
  254. status =
  255. acpi_ns_lookup(walk_state->scope_info, buffer_ptr,
  256. object_type, ACPI_IMODE_LOAD_PASS2, flags,
  257. walk_state, &node);
  258. if (ACPI_SUCCESS(status) && (flags & ACPI_NS_TEMPORARY)) {
  259. ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
  260. "***New Node [%4.4s] %p is temporary\n",
  261. acpi_ut_get_node_name(node), node));
  262. }
  263. break;
  264. }
  265. if (ACPI_FAILURE(status)) {
  266. ACPI_ERROR_NAMESPACE(walk_state->scope_info,
  267. buffer_ptr, status);
  268. return_ACPI_STATUS(status);
  269. }
  270. if (!op) {
  271. /* Create a new op */
  272. op = acpi_ps_alloc_op(walk_state->opcode, walk_state->aml);
  273. if (!op) {
  274. return_ACPI_STATUS(AE_NO_MEMORY);
  275. }
  276. /* Initialize the new op */
  277. if (node) {
  278. op->named.name = node->name.integer;
  279. }
  280. *out_op = op;
  281. }
  282. /*
  283. * Put the Node in the "op" object that the parser uses, so we
  284. * can get it again quickly when this scope is closed
  285. */
  286. op->common.node = node;
  287. return_ACPI_STATUS(status);
  288. }
  289. /*******************************************************************************
  290. *
  291. * FUNCTION: acpi_ds_load2_end_op
  292. *
  293. * PARAMETERS: walk_state - Current state of the parse tree walk
  294. *
  295. * RETURN: Status
  296. *
  297. * DESCRIPTION: Ascending callback used during the loading of the namespace,
  298. * both control methods and everything else.
  299. *
  300. ******************************************************************************/
  301. acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
  302. {
  303. union acpi_parse_object *op;
  304. acpi_status status = AE_OK;
  305. acpi_object_type object_type;
  306. struct acpi_namespace_node *node;
  307. union acpi_parse_object *arg;
  308. struct acpi_namespace_node *new_node;
  309. u32 i;
  310. u8 region_space;
  311. #ifdef ACPI_EXEC_APP
  312. union acpi_operand_object *obj_desc;
  313. char *namepath;
  314. #endif
  315. ACPI_FUNCTION_TRACE(ds_load2_end_op);
  316. op = walk_state->op;
  317. ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "Opcode [%s] Op %p State %p\n",
  318. walk_state->op_info->name, op, walk_state));
  319. /* Check if opcode had an associated namespace object */
  320. if (!(walk_state->op_info->flags & AML_NSOBJECT)) {
  321. return_ACPI_STATUS(AE_OK);
  322. }
  323. if (op->common.aml_opcode == AML_SCOPE_OP) {
  324. ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
  325. "Ending scope Op=%p State=%p\n", op,
  326. walk_state));
  327. }
  328. object_type = walk_state->op_info->object_type;
  329. /*
  330. * Get the Node/name from the earlier lookup
  331. * (It was saved in the *op structure)
  332. */
  333. node = op->common.node;
  334. /*
  335. * Put the Node on the object stack (Contains the ACPI Name of
  336. * this object)
  337. */
  338. walk_state->operands[0] = (void *)node;
  339. walk_state->num_operands = 1;
  340. /* Pop the scope stack */
  341. if (acpi_ns_opens_scope(object_type) &&
  342. (op->common.aml_opcode != AML_INT_METHODCALL_OP)) {
  343. ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
  344. "(%s) Popping scope for Op %p\n",
  345. acpi_ut_get_type_name(object_type), op));
  346. status = acpi_ds_scope_stack_pop(walk_state);
  347. if (ACPI_FAILURE(status)) {
  348. goto cleanup;
  349. }
  350. }
  351. /*
  352. * Named operations are as follows:
  353. *
  354. * AML_ALIAS
  355. * AML_BANKFIELD
  356. * AML_CREATEBITFIELD
  357. * AML_CREATEBYTEFIELD
  358. * AML_CREATEDWORDFIELD
  359. * AML_CREATEFIELD
  360. * AML_CREATEQWORDFIELD
  361. * AML_CREATEWORDFIELD
  362. * AML_DATA_REGION
  363. * AML_DEVICE
  364. * AML_EVENT
  365. * AML_FIELD
  366. * AML_INDEXFIELD
  367. * AML_METHOD
  368. * AML_METHODCALL
  369. * AML_MUTEX
  370. * AML_NAME
  371. * AML_NAMEDFIELD
  372. * AML_OPREGION
  373. * AML_POWERRES
  374. * AML_PROCESSOR
  375. * AML_SCOPE
  376. * AML_THERMALZONE
  377. */
  378. ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
  379. "Create-Load [%s] State=%p Op=%p NamedObj=%p\n",
  380. acpi_ps_get_opcode_name(op->common.aml_opcode),
  381. walk_state, op, node));
  382. /* Decode the opcode */
  383. arg = op->common.value.arg;
  384. switch (walk_state->op_info->type) {
  385. case AML_TYPE_CREATE_FIELD:
  386. /*
  387. * Create the field object, but the field buffer and index must
  388. * be evaluated later during the execution phase
  389. */
  390. status = acpi_ds_create_buffer_field(op, walk_state);
  391. if (ACPI_FAILURE(status)) {
  392. ACPI_EXCEPTION((AE_INFO, status,
  393. "CreateBufferField failure"));
  394. goto cleanup;
  395. }
  396. break;
  397. case AML_TYPE_NAMED_FIELD:
  398. /*
  399. * If we are executing a method, initialize the field
  400. */
  401. if (walk_state->method_node) {
  402. status = acpi_ds_init_field_objects(op, walk_state);
  403. }
  404. switch (op->common.aml_opcode) {
  405. case AML_INDEX_FIELD_OP:
  406. status =
  407. acpi_ds_create_index_field(op,
  408. (acpi_handle)arg->common.
  409. node, walk_state);
  410. break;
  411. case AML_BANK_FIELD_OP:
  412. status =
  413. acpi_ds_create_bank_field(op, arg->common.node,
  414. walk_state);
  415. break;
  416. case AML_FIELD_OP:
  417. status =
  418. acpi_ds_create_field(op, arg->common.node,
  419. walk_state);
  420. break;
  421. default:
  422. /* All NAMED_FIELD opcodes must be handled above */
  423. break;
  424. }
  425. break;
  426. case AML_TYPE_NAMED_SIMPLE:
  427. status = acpi_ds_create_operands(walk_state, arg);
  428. if (ACPI_FAILURE(status)) {
  429. goto cleanup;
  430. }
  431. switch (op->common.aml_opcode) {
  432. case AML_PROCESSOR_OP:
  433. status = acpi_ex_create_processor(walk_state);
  434. break;
  435. case AML_POWER_RESOURCE_OP:
  436. status = acpi_ex_create_power_resource(walk_state);
  437. break;
  438. case AML_MUTEX_OP:
  439. status = acpi_ex_create_mutex(walk_state);
  440. break;
  441. case AML_EVENT_OP:
  442. status = acpi_ex_create_event(walk_state);
  443. break;
  444. case AML_ALIAS_OP:
  445. status = acpi_ex_create_alias(walk_state);
  446. break;
  447. default:
  448. /* Unknown opcode */
  449. status = AE_OK;
  450. goto cleanup;
  451. }
  452. /* Delete operands */
  453. for (i = 1; i < walk_state->num_operands; i++) {
  454. acpi_ut_remove_reference(walk_state->operands[i]);
  455. walk_state->operands[i] = NULL;
  456. }
  457. break;
  458. case AML_TYPE_NAMED_COMPLEX:
  459. switch (op->common.aml_opcode) {
  460. case AML_REGION_OP:
  461. case AML_DATA_REGION_OP:
  462. if (op->common.aml_opcode == AML_REGION_OP) {
  463. region_space = (acpi_adr_space_type)
  464. ((op->common.value.arg)->common.value.
  465. integer);
  466. } else {
  467. region_space = ACPI_ADR_SPACE_DATA_TABLE;
  468. }
  469. /*
  470. * The op_region is not fully parsed at this time. The only valid
  471. * argument is the space_id. (We must save the address of the
  472. * AML of the address and length operands)
  473. *
  474. * If we have a valid region, initialize it. The namespace is
  475. * unlocked at this point.
  476. *
  477. * Need to unlock interpreter if it is locked (if we are running
  478. * a control method), in order to allow _REG methods to be run
  479. * during acpi_ev_initialize_region.
  480. */
  481. if (walk_state->method_node) {
  482. /*
  483. * Executing a method: initialize the region and unlock
  484. * the interpreter
  485. */
  486. status = acpi_ex_create_region(op->named.data,
  487. op->named.length,
  488. region_space,
  489. walk_state);
  490. if (ACPI_FAILURE(status)) {
  491. return_ACPI_STATUS(status);
  492. }
  493. }
  494. status =
  495. acpi_ev_initialize_region
  496. (acpi_ns_get_attached_object(node));
  497. break;
  498. case AML_NAME_OP:
  499. status = acpi_ds_create_node(walk_state, node, op);
  500. if (ACPI_FAILURE(status)) {
  501. goto cleanup;
  502. }
  503. #ifdef ACPI_EXEC_APP
  504. /*
  505. * acpi_exec support for namespace initialization file (initialize
  506. * Name opcodes in this code.)
  507. */
  508. namepath = acpi_ns_get_external_pathname(node);
  509. status = ae_lookup_init_file_entry(namepath, &obj_desc);
  510. if (ACPI_SUCCESS(status)) {
  511. /* Detach any existing object, attach new object */
  512. if (node->object) {
  513. acpi_ns_detach_object(node);
  514. }
  515. acpi_ns_attach_object(node, obj_desc,
  516. obj_desc->common.type);
  517. }
  518. ACPI_FREE(namepath);
  519. status = AE_OK;
  520. #endif
  521. break;
  522. case AML_METHOD_OP:
  523. /*
  524. * method_op pkg_length name_string method_flags term_list
  525. *
  526. * Note: We must create the method node/object pair as soon as we
  527. * see the method declaration. This allows later pass1 parsing
  528. * of invocations of the method (need to know the number of
  529. * arguments.)
  530. */
  531. ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
  532. "LOADING-Method: State=%p Op=%p NamedObj=%p\n",
  533. walk_state, op, op->named.node));
  534. if (!acpi_ns_get_attached_object(op->named.node)) {
  535. walk_state->operands[0] =
  536. ACPI_CAST_PTR(void, op->named.node);
  537. walk_state->num_operands = 1;
  538. status =
  539. acpi_ds_create_operands(walk_state,
  540. op->common.value.
  541. arg);
  542. if (ACPI_SUCCESS(status)) {
  543. status =
  544. acpi_ex_create_method(op->named.
  545. data,
  546. op->named.
  547. length,
  548. walk_state);
  549. }
  550. walk_state->operands[0] = NULL;
  551. walk_state->num_operands = 0;
  552. if (ACPI_FAILURE(status)) {
  553. return_ACPI_STATUS(status);
  554. }
  555. }
  556. break;
  557. default:
  558. /* All NAMED_COMPLEX opcodes must be handled above */
  559. break;
  560. }
  561. break;
  562. case AML_CLASS_INTERNAL:
  563. /* case AML_INT_NAMEPATH_OP: */
  564. break;
  565. case AML_CLASS_METHOD_CALL:
  566. ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
  567. "RESOLVING-MethodCall: State=%p Op=%p NamedObj=%p\n",
  568. walk_state, op, node));
  569. /*
  570. * Lookup the method name and save the Node
  571. */
  572. status =
  573. acpi_ns_lookup(walk_state->scope_info,
  574. arg->common.value.string, ACPI_TYPE_ANY,
  575. ACPI_IMODE_LOAD_PASS2,
  576. ACPI_NS_SEARCH_PARENT |
  577. ACPI_NS_DONT_OPEN_SCOPE, walk_state,
  578. &(new_node));
  579. if (ACPI_SUCCESS(status)) {
  580. /*
  581. * Make sure that what we found is indeed a method
  582. * We didn't search for a method on purpose, to see if the name
  583. * would resolve
  584. */
  585. if (new_node->type != ACPI_TYPE_METHOD) {
  586. status = AE_AML_OPERAND_TYPE;
  587. }
  588. /* We could put the returned object (Node) on the object stack for
  589. * later, but for now, we will put it in the "op" object that the
  590. * parser uses, so we can get it again at the end of this scope
  591. */
  592. op->common.node = new_node;
  593. } else {
  594. ACPI_ERROR_NAMESPACE(walk_state->scope_info,
  595. arg->common.value.string, status);
  596. }
  597. break;
  598. default:
  599. break;
  600. }
  601. cleanup:
  602. /* Remove the Node pushed at the very beginning */
  603. walk_state->operands[0] = NULL;
  604. walk_state->num_operands = 0;
  605. return_ACPI_STATUS(status);
  606. }