dswexec.c 19 KB

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