dswexec.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
  2. /******************************************************************************
  3. *
  4. * Module Name: dswexec - Dispatcher method execution callbacks;
  5. * dispatch to interpreter.
  6. *
  7. * Copyright (C) 2000 - 2018, Intel Corp.
  8. *
  9. *****************************************************************************/
  10. #include <acpi/acpi.h>
  11. #include "accommon.h"
  12. #include "acparser.h"
  13. #include "amlcode.h"
  14. #include "acdispat.h"
  15. #include "acinterp.h"
  16. #include "acnamesp.h"
  17. #include "acdebug.h"
  18. #define _COMPONENT ACPI_DISPATCHER
  19. ACPI_MODULE_NAME("dswexec")
  20. /*
  21. * Dispatch table for opcode classes
  22. */
  23. static acpi_execute_op acpi_gbl_op_type_dispatch[] = {
  24. acpi_ex_opcode_0A_0T_1R,
  25. acpi_ex_opcode_1A_0T_0R,
  26. acpi_ex_opcode_1A_0T_1R,
  27. acpi_ex_opcode_1A_1T_0R,
  28. acpi_ex_opcode_1A_1T_1R,
  29. acpi_ex_opcode_2A_0T_0R,
  30. acpi_ex_opcode_2A_0T_1R,
  31. acpi_ex_opcode_2A_1T_1R,
  32. acpi_ex_opcode_2A_2T_1R,
  33. acpi_ex_opcode_3A_0T_0R,
  34. acpi_ex_opcode_3A_1T_1R,
  35. acpi_ex_opcode_6A_0T_1R
  36. };
  37. /*****************************************************************************
  38. *
  39. * FUNCTION: acpi_ds_get_predicate_value
  40. *
  41. * PARAMETERS: walk_state - Current state of the parse tree walk
  42. * result_obj - if non-zero, pop result from result stack
  43. *
  44. * RETURN: Status
  45. *
  46. * DESCRIPTION: Get the result of a predicate evaluation
  47. *
  48. ****************************************************************************/
  49. acpi_status
  50. acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state,
  51. union acpi_operand_object *result_obj)
  52. {
  53. acpi_status status = AE_OK;
  54. union acpi_operand_object *obj_desc;
  55. union acpi_operand_object *local_obj_desc = NULL;
  56. ACPI_FUNCTION_TRACE_PTR(ds_get_predicate_value, walk_state);
  57. walk_state->control_state->common.state = 0;
  58. if (result_obj) {
  59. status = acpi_ds_result_pop(&obj_desc, walk_state);
  60. if (ACPI_FAILURE(status)) {
  61. ACPI_EXCEPTION((AE_INFO, status,
  62. "Could not get result from predicate evaluation"));
  63. return_ACPI_STATUS(status);
  64. }
  65. } else {
  66. status = acpi_ds_create_operand(walk_state, walk_state->op, 0);
  67. if (ACPI_FAILURE(status)) {
  68. return_ACPI_STATUS(status);
  69. }
  70. status =
  71. acpi_ex_resolve_to_value(&walk_state->operands[0],
  72. walk_state);
  73. if (ACPI_FAILURE(status)) {
  74. return_ACPI_STATUS(status);
  75. }
  76. obj_desc = walk_state->operands[0];
  77. }
  78. if (!obj_desc) {
  79. ACPI_ERROR((AE_INFO,
  80. "No predicate ObjDesc=%p State=%p",
  81. obj_desc, walk_state));
  82. return_ACPI_STATUS(AE_AML_NO_OPERAND);
  83. }
  84. /*
  85. * Result of predicate evaluation must be an Integer
  86. * object. Implicitly convert the argument if necessary.
  87. */
  88. status = acpi_ex_convert_to_integer(obj_desc, &local_obj_desc,
  89. ACPI_IMPLICIT_CONVERSION);
  90. if (ACPI_FAILURE(status)) {
  91. goto cleanup;
  92. }
  93. if (local_obj_desc->common.type != ACPI_TYPE_INTEGER) {
  94. ACPI_ERROR((AE_INFO,
  95. "Bad predicate (not an integer) ObjDesc=%p State=%p Type=0x%X",
  96. obj_desc, walk_state, obj_desc->common.type));
  97. status = AE_AML_OPERAND_TYPE;
  98. goto cleanup;
  99. }
  100. /* Truncate the predicate to 32-bits if necessary */
  101. (void)acpi_ex_truncate_for32bit_table(local_obj_desc);
  102. /*
  103. * Save the result of the predicate evaluation on
  104. * the control stack
  105. */
  106. if (local_obj_desc->integer.value) {
  107. walk_state->control_state->common.value = TRUE;
  108. } else {
  109. /*
  110. * Predicate is FALSE, we will just toss the
  111. * rest of the package
  112. */
  113. walk_state->control_state->common.value = FALSE;
  114. status = AE_CTRL_FALSE;
  115. }
  116. /* Predicate can be used for an implicit return value */
  117. (void)acpi_ds_do_implicit_return(local_obj_desc, walk_state, TRUE);
  118. cleanup:
  119. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  120. "Completed a predicate eval=%X Op=%p\n",
  121. walk_state->control_state->common.value,
  122. walk_state->op));
  123. /* Break to debugger to display result */
  124. acpi_db_display_result_object(local_obj_desc, walk_state);
  125. /*
  126. * Delete the predicate result object (we know that
  127. * we don't need it anymore)
  128. */
  129. if (local_obj_desc != obj_desc) {
  130. acpi_ut_remove_reference(local_obj_desc);
  131. }
  132. acpi_ut_remove_reference(obj_desc);
  133. walk_state->control_state->common.state = ACPI_CONTROL_NORMAL;
  134. return_ACPI_STATUS(status);
  135. }
  136. /*****************************************************************************
  137. *
  138. * FUNCTION: acpi_ds_exec_begin_op
  139. *
  140. * PARAMETERS: walk_state - Current state of the parse tree walk
  141. * out_op - Where to return op if a new one is created
  142. *
  143. * RETURN: Status
  144. *
  145. * DESCRIPTION: Descending callback used during the execution of control
  146. * methods. This is where most operators and operands are
  147. * dispatched to the interpreter.
  148. *
  149. ****************************************************************************/
  150. acpi_status
  151. acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state,
  152. union acpi_parse_object **out_op)
  153. {
  154. union acpi_parse_object *op;
  155. acpi_status status = AE_OK;
  156. u32 opcode_class;
  157. ACPI_FUNCTION_TRACE_PTR(ds_exec_begin_op, walk_state);
  158. op = walk_state->op;
  159. if (!op) {
  160. status = acpi_ds_load2_begin_op(walk_state, out_op);
  161. if (ACPI_FAILURE(status)) {
  162. goto error_exit;
  163. }
  164. op = *out_op;
  165. walk_state->op = op;
  166. walk_state->opcode = op->common.aml_opcode;
  167. walk_state->op_info =
  168. acpi_ps_get_opcode_info(op->common.aml_opcode);
  169. if (acpi_ns_opens_scope(walk_state->op_info->object_type)) {
  170. ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
  171. "(%s) Popping scope for Op %p\n",
  172. acpi_ut_get_type_name(walk_state->
  173. op_info->
  174. object_type),
  175. op));
  176. status = acpi_ds_scope_stack_pop(walk_state);
  177. if (ACPI_FAILURE(status)) {
  178. goto error_exit;
  179. }
  180. }
  181. }
  182. if (op == walk_state->origin) {
  183. if (out_op) {
  184. *out_op = op;
  185. }
  186. return_ACPI_STATUS(AE_OK);
  187. }
  188. /*
  189. * If the previous opcode was a conditional, this opcode
  190. * must be the beginning of the associated predicate.
  191. * Save this knowledge in the current scope descriptor
  192. */
  193. if ((walk_state->control_state) &&
  194. (walk_state->control_state->common.state ==
  195. ACPI_CONTROL_CONDITIONAL_EXECUTING)) {
  196. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  197. "Exec predicate Op=%p State=%p\n",
  198. op, walk_state));
  199. walk_state->control_state->common.state =
  200. ACPI_CONTROL_PREDICATE_EXECUTING;
  201. /* Save start of predicate */
  202. walk_state->control_state->control.predicate_op = op;
  203. }
  204. opcode_class = walk_state->op_info->class;
  205. /* We want to send namepaths to the load code */
  206. if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) {
  207. opcode_class = AML_CLASS_NAMED_OBJECT;
  208. }
  209. /*
  210. * Handle the opcode based upon the opcode type
  211. */
  212. switch (opcode_class) {
  213. case AML_CLASS_CONTROL:
  214. status = acpi_ds_exec_begin_control_op(walk_state, op);
  215. break;
  216. case AML_CLASS_NAMED_OBJECT:
  217. if (walk_state->walk_type & ACPI_WALK_METHOD) {
  218. /*
  219. * Found a named object declaration during method execution;
  220. * we must enter this object into the namespace. The created
  221. * object is temporary and will be deleted upon completion of
  222. * the execution of this method.
  223. *
  224. * Note 10/2010: Except for the Scope() op. This opcode does
  225. * not actually create a new object, it refers to an existing
  226. * object. However, for Scope(), we want to indeed open a
  227. * new scope.
  228. */
  229. if (op->common.aml_opcode != AML_SCOPE_OP) {
  230. status =
  231. acpi_ds_load2_begin_op(walk_state, NULL);
  232. } else {
  233. status =
  234. acpi_ds_scope_stack_push(op->named.node,
  235. op->named.node->
  236. type, walk_state);
  237. if (ACPI_FAILURE(status)) {
  238. return_ACPI_STATUS(status);
  239. }
  240. }
  241. }
  242. break;
  243. case AML_CLASS_EXECUTE:
  244. case AML_CLASS_CREATE:
  245. break;
  246. default:
  247. break;
  248. }
  249. /* Nothing to do here during method execution */
  250. return_ACPI_STATUS(status);
  251. error_exit:
  252. status = acpi_ds_method_error(status, walk_state);
  253. return_ACPI_STATUS(status);
  254. }
  255. /*****************************************************************************
  256. *
  257. * FUNCTION: acpi_ds_exec_end_op
  258. *
  259. * PARAMETERS: walk_state - Current state of the parse tree walk
  260. *
  261. * RETURN: Status
  262. *
  263. * DESCRIPTION: Ascending callback used during the execution of control
  264. * methods. The only thing we really need to do here is to
  265. * notice the beginning of IF, ELSE, and WHILE blocks.
  266. *
  267. ****************************************************************************/
  268. acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
  269. {
  270. union acpi_parse_object *op;
  271. acpi_status status = AE_OK;
  272. u32 op_type;
  273. u32 op_class;
  274. union acpi_parse_object *next_op;
  275. union acpi_parse_object *first_arg;
  276. ACPI_FUNCTION_TRACE_PTR(ds_exec_end_op, walk_state);
  277. op = walk_state->op;
  278. op_type = walk_state->op_info->type;
  279. op_class = walk_state->op_info->class;
  280. if (op_class == AML_CLASS_UNKNOWN) {
  281. ACPI_ERROR((AE_INFO, "Unknown opcode 0x%X",
  282. op->common.aml_opcode));
  283. return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
  284. }
  285. first_arg = op->common.value.arg;
  286. /* Init the walk state */
  287. walk_state->num_operands = 0;
  288. walk_state->operand_index = 0;
  289. walk_state->return_desc = NULL;
  290. walk_state->result_obj = NULL;
  291. /* Call debugger for single step support (DEBUG build only) */
  292. status = acpi_db_single_step(walk_state, op, op_class);
  293. if (ACPI_FAILURE(status)) {
  294. return_ACPI_STATUS(status);
  295. }
  296. /* Decode the Opcode Class */
  297. switch (op_class) {
  298. case AML_CLASS_ARGUMENT: /* Constants, literals, etc. */
  299. if (walk_state->opcode == AML_INT_NAMEPATH_OP) {
  300. status = acpi_ds_evaluate_name_path(walk_state);
  301. if (ACPI_FAILURE(status)) {
  302. goto cleanup;
  303. }
  304. }
  305. break;
  306. case AML_CLASS_EXECUTE: /* Most operators with arguments */
  307. /* Build resolved operand stack */
  308. status = acpi_ds_create_operands(walk_state, first_arg);
  309. if (ACPI_FAILURE(status)) {
  310. goto cleanup;
  311. }
  312. /*
  313. * All opcodes require operand resolution, with the only exceptions
  314. * being the object_type and size_of operators.
  315. */
  316. if (!(walk_state->op_info->flags & AML_NO_OPERAND_RESOLVE)) {
  317. /* Resolve all operands */
  318. status = acpi_ex_resolve_operands(walk_state->opcode,
  319. &(walk_state->
  320. operands
  321. [walk_state->
  322. num_operands - 1]),
  323. walk_state);
  324. }
  325. if (ACPI_SUCCESS(status)) {
  326. /*
  327. * Dispatch the request to the appropriate interpreter handler
  328. * routine. There is one routine per opcode "type" based upon the
  329. * number of opcode arguments and return type.
  330. */
  331. status =
  332. acpi_gbl_op_type_dispatch[op_type] (walk_state);
  333. } else {
  334. /*
  335. * Treat constructs of the form "Store(LocalX,LocalX)" as noops when the
  336. * Local is uninitialized.
  337. */
  338. if ((status == AE_AML_UNINITIALIZED_LOCAL) &&
  339. (walk_state->opcode == AML_STORE_OP) &&
  340. (walk_state->operands[0]->common.type ==
  341. ACPI_TYPE_LOCAL_REFERENCE)
  342. && (walk_state->operands[1]->common.type ==
  343. ACPI_TYPE_LOCAL_REFERENCE)
  344. && (walk_state->operands[0]->reference.class ==
  345. walk_state->operands[1]->reference.class)
  346. && (walk_state->operands[0]->reference.value ==
  347. walk_state->operands[1]->reference.value)) {
  348. status = AE_OK;
  349. } else {
  350. ACPI_EXCEPTION((AE_INFO, status,
  351. "While resolving operands for [%s]",
  352. acpi_ps_get_opcode_name
  353. (walk_state->opcode)));
  354. }
  355. }
  356. /* Always delete the argument objects and clear the operand stack */
  357. acpi_ds_clear_operands(walk_state);
  358. /*
  359. * If a result object was returned from above, push it on the
  360. * current result stack
  361. */
  362. if (ACPI_SUCCESS(status) && walk_state->result_obj) {
  363. status =
  364. acpi_ds_result_push(walk_state->result_obj,
  365. walk_state);
  366. }
  367. break;
  368. default:
  369. switch (op_type) {
  370. case AML_TYPE_CONTROL: /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
  371. /* 1 Operand, 0 external_result, 0 internal_result */
  372. status = acpi_ds_exec_end_control_op(walk_state, op);
  373. break;
  374. case AML_TYPE_METHOD_CALL:
  375. /*
  376. * If the method is referenced from within a package
  377. * declaration, it is not a invocation of the method, just
  378. * a reference to it.
  379. */
  380. if ((op->asl.parent) &&
  381. ((op->asl.parent->asl.aml_opcode == AML_PACKAGE_OP)
  382. || (op->asl.parent->asl.aml_opcode ==
  383. AML_VARIABLE_PACKAGE_OP))) {
  384. ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
  385. "Method Reference in a Package, Op=%p\n",
  386. op));
  387. op->common.node = (struct acpi_namespace_node *)
  388. op->asl.value.arg->asl.node;
  389. acpi_ut_add_reference(op->asl.value.arg->asl.
  390. node->object);
  391. return_ACPI_STATUS(AE_OK);
  392. }
  393. ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
  394. "Method invocation, Op=%p\n", op));
  395. /*
  396. * (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains
  397. * the method Node pointer
  398. */
  399. /* next_op points to the op that holds the method name */
  400. next_op = first_arg;
  401. /* next_op points to first argument op */
  402. next_op = next_op->common.next;
  403. /*
  404. * Get the method's arguments and put them on the operand stack
  405. */
  406. status = acpi_ds_create_operands(walk_state, next_op);
  407. if (ACPI_FAILURE(status)) {
  408. break;
  409. }
  410. /*
  411. * Since the operands will be passed to another control method,
  412. * we must resolve all local references here (Local variables,
  413. * arguments to *this* method, etc.)
  414. */
  415. status = acpi_ds_resolve_operands(walk_state);
  416. if (ACPI_FAILURE(status)) {
  417. /* On error, clear all resolved operands */
  418. acpi_ds_clear_operands(walk_state);
  419. break;
  420. }
  421. /*
  422. * Tell the walk loop to preempt this running method and
  423. * execute the new method
  424. */
  425. status = AE_CTRL_TRANSFER;
  426. /*
  427. * Return now; we don't want to disturb anything,
  428. * especially the operand count!
  429. */
  430. return_ACPI_STATUS(status);
  431. case AML_TYPE_CREATE_FIELD:
  432. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  433. "Executing CreateField Buffer/Index Op=%p\n",
  434. op));
  435. status = acpi_ds_load2_end_op(walk_state);
  436. if (ACPI_FAILURE(status)) {
  437. break;
  438. }
  439. status =
  440. acpi_ds_eval_buffer_field_operands(walk_state, op);
  441. break;
  442. case AML_TYPE_CREATE_OBJECT:
  443. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  444. "Executing CreateObject (Buffer/Package) Op=%p Child=%p ParentOpcode=%4.4X\n",
  445. op, op->named.value.arg,
  446. op->common.parent->common.
  447. aml_opcode));
  448. switch (op->common.parent->common.aml_opcode) {
  449. case AML_NAME_OP:
  450. /*
  451. * Put the Node on the object stack (Contains the ACPI Name
  452. * of this object)
  453. */
  454. walk_state->operands[0] = (void *)
  455. op->common.parent->common.node;
  456. walk_state->num_operands = 1;
  457. status = acpi_ds_create_node(walk_state,
  458. op->common.parent->
  459. common.node,
  460. op->common.parent);
  461. if (ACPI_FAILURE(status)) {
  462. break;
  463. }
  464. /* Fall through */
  465. /*lint -fallthrough */
  466. case AML_INT_EVAL_SUBTREE_OP:
  467. status =
  468. acpi_ds_eval_data_object_operands
  469. (walk_state, op,
  470. acpi_ns_get_attached_object(op->common.
  471. parent->common.
  472. node));
  473. break;
  474. default:
  475. status =
  476. acpi_ds_eval_data_object_operands
  477. (walk_state, op, NULL);
  478. break;
  479. }
  480. /*
  481. * If a result object was returned from above, push it on the
  482. * current result stack
  483. */
  484. if (walk_state->result_obj) {
  485. status =
  486. acpi_ds_result_push(walk_state->result_obj,
  487. walk_state);
  488. }
  489. break;
  490. case AML_TYPE_NAMED_FIELD:
  491. case AML_TYPE_NAMED_COMPLEX:
  492. case AML_TYPE_NAMED_SIMPLE:
  493. case AML_TYPE_NAMED_NO_OBJ:
  494. status = acpi_ds_load2_end_op(walk_state);
  495. if (ACPI_FAILURE(status)) {
  496. break;
  497. }
  498. if (op->common.aml_opcode == AML_REGION_OP) {
  499. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  500. "Executing OpRegion Address/Length Op=%p\n",
  501. op));
  502. status =
  503. acpi_ds_eval_region_operands(walk_state,
  504. op);
  505. if (ACPI_FAILURE(status)) {
  506. break;
  507. }
  508. } else if (op->common.aml_opcode == AML_DATA_REGION_OP) {
  509. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  510. "Executing DataTableRegion Strings Op=%p\n",
  511. op));
  512. status =
  513. acpi_ds_eval_table_region_operands
  514. (walk_state, op);
  515. if (ACPI_FAILURE(status)) {
  516. break;
  517. }
  518. } else if (op->common.aml_opcode == AML_BANK_FIELD_OP) {
  519. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  520. "Executing BankField Op=%p\n",
  521. op));
  522. status =
  523. acpi_ds_eval_bank_field_operands(walk_state,
  524. op);
  525. if (ACPI_FAILURE(status)) {
  526. break;
  527. }
  528. }
  529. break;
  530. case AML_TYPE_UNDEFINED:
  531. ACPI_ERROR((AE_INFO,
  532. "Undefined opcode type Op=%p", op));
  533. return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
  534. case AML_TYPE_BOGUS:
  535. ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
  536. "Internal opcode=%X type Op=%p\n",
  537. walk_state->opcode, op));
  538. break;
  539. default:
  540. ACPI_ERROR((AE_INFO,
  541. "Unimplemented opcode, class=0x%X "
  542. "type=0x%X Opcode=0x%X Op=%p",
  543. op_class, op_type, op->common.aml_opcode,
  544. op));
  545. status = AE_NOT_IMPLEMENTED;
  546. break;
  547. }
  548. }
  549. /*
  550. * ACPI 2.0 support for 64-bit integers: Truncate numeric
  551. * result value if we are executing from a 32-bit ACPI table
  552. */
  553. (void)acpi_ex_truncate_for32bit_table(walk_state->result_obj);
  554. /*
  555. * Check if we just completed the evaluation of a
  556. * conditional predicate
  557. */
  558. if ((ACPI_SUCCESS(status)) &&
  559. (walk_state->control_state) &&
  560. (walk_state->control_state->common.state ==
  561. ACPI_CONTROL_PREDICATE_EXECUTING) &&
  562. (walk_state->control_state->control.predicate_op == op)) {
  563. status =
  564. acpi_ds_get_predicate_value(walk_state,
  565. walk_state->result_obj);
  566. walk_state->result_obj = NULL;
  567. }
  568. cleanup:
  569. if (walk_state->result_obj) {
  570. /* Break to debugger to display result */
  571. acpi_db_display_result_object(walk_state->result_obj,
  572. walk_state);
  573. /*
  574. * Delete the result op if and only if:
  575. * Parent will not use the result -- such as any
  576. * non-nested type2 op in a method (parent will be method)
  577. */
  578. acpi_ds_delete_result_if_not_used(op, walk_state->result_obj,
  579. walk_state);
  580. }
  581. #ifdef _UNDER_DEVELOPMENT
  582. if (walk_state->parser_state.aml == walk_state->parser_state.aml_end) {
  583. acpi_db_method_end(walk_state);
  584. }
  585. #endif
  586. /* Invoke exception handler on error */
  587. if (ACPI_FAILURE(status)) {
  588. status = acpi_ds_method_error(status, walk_state);
  589. }
  590. /* Always clear the object stack */
  591. walk_state->num_operands = 0;
  592. return_ACPI_STATUS(status);
  593. }