exresop.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  1. /******************************************************************************
  2. *
  3. * Module Name: exresop - AML Interpreter operand/object resolution
  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 "acparser.h"
  46. #include "acinterp.h"
  47. #include "acnamesp.h"
  48. #define _COMPONENT ACPI_EXECUTER
  49. ACPI_MODULE_NAME("exresop")
  50. /* Local prototypes */
  51. static acpi_status
  52. acpi_ex_check_object_type(acpi_object_type type_needed,
  53. acpi_object_type this_type, void *object);
  54. /*******************************************************************************
  55. *
  56. * FUNCTION: acpi_ex_check_object_type
  57. *
  58. * PARAMETERS: type_needed Object type needed
  59. * this_type Actual object type
  60. * Object Object pointer
  61. *
  62. * RETURN: Status
  63. *
  64. * DESCRIPTION: Check required type against actual type
  65. *
  66. ******************************************************************************/
  67. static acpi_status
  68. acpi_ex_check_object_type(acpi_object_type type_needed,
  69. acpi_object_type this_type, void *object)
  70. {
  71. ACPI_FUNCTION_ENTRY();
  72. if (type_needed == ACPI_TYPE_ANY) {
  73. /* All types OK, so we don't perform any typechecks */
  74. return (AE_OK);
  75. }
  76. if (type_needed == ACPI_TYPE_LOCAL_REFERENCE) {
  77. /*
  78. * Allow the AML "Constant" opcodes (Zero, One, etc.) to be reference
  79. * objects and thus allow them to be targets. (As per the ACPI
  80. * specification, a store to a constant is a noop.)
  81. */
  82. if ((this_type == ACPI_TYPE_INTEGER) &&
  83. (((union acpi_operand_object *)object)->common.flags &
  84. AOPOBJ_AML_CONSTANT)) {
  85. return (AE_OK);
  86. }
  87. }
  88. if (type_needed != this_type) {
  89. ACPI_ERROR((AE_INFO,
  90. "Needed type [%s], found [%s] %p",
  91. acpi_ut_get_type_name(type_needed),
  92. acpi_ut_get_type_name(this_type), object));
  93. return (AE_AML_OPERAND_TYPE);
  94. }
  95. return (AE_OK);
  96. }
  97. /*******************************************************************************
  98. *
  99. * FUNCTION: acpi_ex_resolve_operands
  100. *
  101. * PARAMETERS: opcode - Opcode being interpreted
  102. * stack_ptr - Pointer to the operand stack to be
  103. * resolved
  104. * walk_state - Current state
  105. *
  106. * RETURN: Status
  107. *
  108. * DESCRIPTION: Convert multiple input operands to the types required by the
  109. * target operator.
  110. *
  111. * Each 5-bit group in arg_types represents one required
  112. * operand and indicates the required Type. The corresponding operand
  113. * will be converted to the required type if possible, otherwise we
  114. * abort with an exception.
  115. *
  116. ******************************************************************************/
  117. acpi_status
  118. acpi_ex_resolve_operands(u16 opcode,
  119. union acpi_operand_object **stack_ptr,
  120. struct acpi_walk_state *walk_state)
  121. {
  122. union acpi_operand_object *obj_desc;
  123. acpi_status status = AE_OK;
  124. u8 object_type;
  125. u32 arg_types;
  126. const struct acpi_opcode_info *op_info;
  127. u32 this_arg_type;
  128. acpi_object_type type_needed;
  129. u16 target_op = 0;
  130. ACPI_FUNCTION_TRACE_U32(ex_resolve_operands, opcode);
  131. op_info = acpi_ps_get_opcode_info(opcode);
  132. if (op_info->class == AML_CLASS_UNKNOWN) {
  133. return_ACPI_STATUS(AE_AML_BAD_OPCODE);
  134. }
  135. arg_types = op_info->runtime_args;
  136. if (arg_types == ARGI_INVALID_OPCODE) {
  137. ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X", opcode));
  138. return_ACPI_STATUS(AE_AML_INTERNAL);
  139. }
  140. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  141. "Opcode %X [%s] RequiredOperandTypes=%8.8X\n",
  142. opcode, op_info->name, arg_types));
  143. /*
  144. * Normal exit is with (arg_types == 0) at end of argument list.
  145. * Function will return an exception from within the loop upon
  146. * finding an entry which is not (or cannot be converted
  147. * to) the required type; if stack underflows; or upon
  148. * finding a NULL stack entry (which should not happen).
  149. */
  150. while (GET_CURRENT_ARG_TYPE(arg_types)) {
  151. if (!stack_ptr || !*stack_ptr) {
  152. ACPI_ERROR((AE_INFO, "Null stack entry at %p",
  153. stack_ptr));
  154. return_ACPI_STATUS(AE_AML_INTERNAL);
  155. }
  156. /* Extract useful items */
  157. obj_desc = *stack_ptr;
  158. /* Decode the descriptor type */
  159. switch (ACPI_GET_DESCRIPTOR_TYPE(obj_desc)) {
  160. case ACPI_DESC_TYPE_NAMED:
  161. /* Namespace Node */
  162. object_type =
  163. ((struct acpi_namespace_node *)obj_desc)->type;
  164. /*
  165. * Resolve an alias object. The construction of these objects
  166. * guarantees that there is only one level of alias indirection;
  167. * thus, the attached object is always the aliased namespace node
  168. */
  169. if (object_type == ACPI_TYPE_LOCAL_ALIAS) {
  170. obj_desc = acpi_ns_get_attached_object((struct
  171. acpi_namespace_node
  172. *)
  173. obj_desc);
  174. *stack_ptr = obj_desc;
  175. object_type =
  176. ((struct acpi_namespace_node *)obj_desc)->
  177. type;
  178. }
  179. break;
  180. case ACPI_DESC_TYPE_OPERAND:
  181. /* ACPI internal object */
  182. object_type = obj_desc->common.type;
  183. /* Check for bad acpi_object_type */
  184. if (!acpi_ut_valid_object_type(object_type)) {
  185. ACPI_ERROR((AE_INFO,
  186. "Bad operand object type [0x%X]",
  187. object_type));
  188. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  189. }
  190. if (object_type == (u8) ACPI_TYPE_LOCAL_REFERENCE) {
  191. /* Validate the Reference */
  192. switch (obj_desc->reference.class) {
  193. case ACPI_REFCLASS_DEBUG:
  194. target_op = AML_DEBUG_OP;
  195. /*lint -fallthrough */
  196. case ACPI_REFCLASS_ARG:
  197. case ACPI_REFCLASS_LOCAL:
  198. case ACPI_REFCLASS_INDEX:
  199. case ACPI_REFCLASS_REFOF:
  200. case ACPI_REFCLASS_TABLE: /* ddb_handle from LOAD_OP or LOAD_TABLE_OP */
  201. case ACPI_REFCLASS_NAME: /* Reference to a named object */
  202. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  203. "Operand is a Reference, Class [%s] %2.2X\n",
  204. acpi_ut_get_reference_name
  205. (obj_desc),
  206. obj_desc->reference.
  207. class));
  208. break;
  209. default:
  210. ACPI_ERROR((AE_INFO,
  211. "Unknown Reference Class 0x%2.2X in %p",
  212. obj_desc->reference.class,
  213. obj_desc));
  214. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  215. }
  216. }
  217. break;
  218. default:
  219. /* Invalid descriptor */
  220. ACPI_ERROR((AE_INFO, "Invalid descriptor %p [%s]",
  221. obj_desc,
  222. acpi_ut_get_descriptor_name(obj_desc)));
  223. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  224. }
  225. /* Get one argument type, point to the next */
  226. this_arg_type = GET_CURRENT_ARG_TYPE(arg_types);
  227. INCREMENT_ARG_LIST(arg_types);
  228. /*
  229. * Handle cases where the object does not need to be
  230. * resolved to a value
  231. */
  232. switch (this_arg_type) {
  233. case ARGI_REF_OR_STRING: /* Can be a String or Reference */
  234. if ((ACPI_GET_DESCRIPTOR_TYPE(obj_desc) ==
  235. ACPI_DESC_TYPE_OPERAND) &&
  236. (obj_desc->common.type == ACPI_TYPE_STRING)) {
  237. /*
  238. * String found - the string references a named object and
  239. * must be resolved to a node
  240. */
  241. goto next_operand;
  242. }
  243. /*
  244. * Else not a string - fall through to the normal Reference
  245. * case below
  246. */
  247. /*lint -fallthrough */
  248. case ARGI_REFERENCE: /* References: */
  249. case ARGI_INTEGER_REF:
  250. case ARGI_OBJECT_REF:
  251. case ARGI_DEVICE_REF:
  252. case ARGI_TARGETREF: /* Allows implicit conversion rules before store */
  253. case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */
  254. case ARGI_SIMPLE_TARGET: /* Name, Local, or arg - no implicit conversion */
  255. case ARGI_STORE_TARGET:
  256. /*
  257. * Need an operand of type ACPI_TYPE_LOCAL_REFERENCE
  258. * A Namespace Node is OK as-is
  259. */
  260. if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) ==
  261. ACPI_DESC_TYPE_NAMED) {
  262. goto next_operand;
  263. }
  264. status =
  265. acpi_ex_check_object_type(ACPI_TYPE_LOCAL_REFERENCE,
  266. object_type, obj_desc);
  267. if (ACPI_FAILURE(status)) {
  268. return_ACPI_STATUS(status);
  269. }
  270. goto next_operand;
  271. case ARGI_DATAREFOBJ: /* Store operator only */
  272. /*
  273. * We don't want to resolve index_op reference objects during
  274. * a store because this would be an implicit de_ref_of operation.
  275. * Instead, we just want to store the reference object.
  276. * -- All others must be resolved below.
  277. */
  278. if ((opcode == AML_STORE_OP) &&
  279. ((*stack_ptr)->common.type ==
  280. ACPI_TYPE_LOCAL_REFERENCE)
  281. && ((*stack_ptr)->reference.class ==
  282. ACPI_REFCLASS_INDEX)) {
  283. goto next_operand;
  284. }
  285. break;
  286. default:
  287. /* All cases covered above */
  288. break;
  289. }
  290. /*
  291. * Resolve this object to a value
  292. */
  293. status = acpi_ex_resolve_to_value(stack_ptr, walk_state);
  294. if (ACPI_FAILURE(status)) {
  295. return_ACPI_STATUS(status);
  296. }
  297. /* Get the resolved object */
  298. obj_desc = *stack_ptr;
  299. /*
  300. * Check the resulting object (value) type
  301. */
  302. switch (this_arg_type) {
  303. /*
  304. * For the simple cases, only one type of resolved object
  305. * is allowed
  306. */
  307. case ARGI_MUTEX:
  308. /* Need an operand of type ACPI_TYPE_MUTEX */
  309. type_needed = ACPI_TYPE_MUTEX;
  310. break;
  311. case ARGI_EVENT:
  312. /* Need an operand of type ACPI_TYPE_EVENT */
  313. type_needed = ACPI_TYPE_EVENT;
  314. break;
  315. case ARGI_PACKAGE: /* Package */
  316. /* Need an operand of type ACPI_TYPE_PACKAGE */
  317. type_needed = ACPI_TYPE_PACKAGE;
  318. break;
  319. case ARGI_ANYTYPE:
  320. /* Any operand type will do */
  321. type_needed = ACPI_TYPE_ANY;
  322. break;
  323. case ARGI_DDBHANDLE:
  324. /* Need an operand of type ACPI_TYPE_DDB_HANDLE */
  325. type_needed = ACPI_TYPE_LOCAL_REFERENCE;
  326. break;
  327. /*
  328. * The more complex cases allow multiple resolved object types
  329. */
  330. case ARGI_INTEGER:
  331. /*
  332. * Need an operand of type ACPI_TYPE_INTEGER, but we can
  333. * implicitly convert from a STRING or BUFFER.
  334. *
  335. * Known as "Implicit Source Operand Conversion"
  336. */
  337. status = acpi_ex_convert_to_integer(obj_desc, stack_ptr,
  338. ACPI_STRTOUL_BASE16);
  339. if (ACPI_FAILURE(status)) {
  340. if (status == AE_TYPE) {
  341. ACPI_ERROR((AE_INFO,
  342. "Needed [Integer/String/Buffer], found [%s] %p",
  343. acpi_ut_get_object_type_name
  344. (obj_desc), obj_desc));
  345. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  346. }
  347. return_ACPI_STATUS(status);
  348. }
  349. if (obj_desc != *stack_ptr) {
  350. acpi_ut_remove_reference(obj_desc);
  351. }
  352. goto next_operand;
  353. case ARGI_BUFFER:
  354. /*
  355. * Need an operand of type ACPI_TYPE_BUFFER,
  356. * But we can implicitly convert from a STRING or INTEGER
  357. * aka - "Implicit Source Operand Conversion"
  358. */
  359. status = acpi_ex_convert_to_buffer(obj_desc, stack_ptr);
  360. if (ACPI_FAILURE(status)) {
  361. if (status == AE_TYPE) {
  362. ACPI_ERROR((AE_INFO,
  363. "Needed [Integer/String/Buffer], found [%s] %p",
  364. acpi_ut_get_object_type_name
  365. (obj_desc), obj_desc));
  366. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  367. }
  368. return_ACPI_STATUS(status);
  369. }
  370. if (obj_desc != *stack_ptr) {
  371. acpi_ut_remove_reference(obj_desc);
  372. }
  373. goto next_operand;
  374. case ARGI_STRING:
  375. /*
  376. * Need an operand of type ACPI_TYPE_STRING,
  377. * But we can implicitly convert from a BUFFER or INTEGER
  378. * aka - "Implicit Source Operand Conversion"
  379. */
  380. status =
  381. acpi_ex_convert_to_string(obj_desc, stack_ptr,
  382. ACPI_IMPLICIT_CONVERT_HEX);
  383. if (ACPI_FAILURE(status)) {
  384. if (status == AE_TYPE) {
  385. ACPI_ERROR((AE_INFO,
  386. "Needed [Integer/String/Buffer], found [%s] %p",
  387. acpi_ut_get_object_type_name
  388. (obj_desc), obj_desc));
  389. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  390. }
  391. return_ACPI_STATUS(status);
  392. }
  393. if (obj_desc != *stack_ptr) {
  394. acpi_ut_remove_reference(obj_desc);
  395. }
  396. goto next_operand;
  397. case ARGI_COMPUTEDATA:
  398. /* Need an operand of type INTEGER, STRING or BUFFER */
  399. switch (obj_desc->common.type) {
  400. case ACPI_TYPE_INTEGER:
  401. case ACPI_TYPE_STRING:
  402. case ACPI_TYPE_BUFFER:
  403. /* Valid operand */
  404. break;
  405. default:
  406. ACPI_ERROR((AE_INFO,
  407. "Needed [Integer/String/Buffer], found [%s] %p",
  408. acpi_ut_get_object_type_name
  409. (obj_desc), obj_desc));
  410. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  411. }
  412. goto next_operand;
  413. case ARGI_BUFFER_OR_STRING:
  414. /* Need an operand of type STRING or BUFFER */
  415. switch (obj_desc->common.type) {
  416. case ACPI_TYPE_STRING:
  417. case ACPI_TYPE_BUFFER:
  418. /* Valid operand */
  419. break;
  420. case ACPI_TYPE_INTEGER:
  421. /* Highest priority conversion is to type Buffer */
  422. status =
  423. acpi_ex_convert_to_buffer(obj_desc,
  424. stack_ptr);
  425. if (ACPI_FAILURE(status)) {
  426. return_ACPI_STATUS(status);
  427. }
  428. if (obj_desc != *stack_ptr) {
  429. acpi_ut_remove_reference(obj_desc);
  430. }
  431. break;
  432. default:
  433. ACPI_ERROR((AE_INFO,
  434. "Needed [Integer/String/Buffer], found [%s] %p",
  435. acpi_ut_get_object_type_name
  436. (obj_desc), obj_desc));
  437. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  438. }
  439. goto next_operand;
  440. case ARGI_DATAOBJECT:
  441. /*
  442. * ARGI_DATAOBJECT is only used by the size_of operator.
  443. * Need a buffer, string, package, or ref_of reference.
  444. *
  445. * The only reference allowed here is a direct reference to
  446. * a namespace node.
  447. */
  448. switch (obj_desc->common.type) {
  449. case ACPI_TYPE_PACKAGE:
  450. case ACPI_TYPE_STRING:
  451. case ACPI_TYPE_BUFFER:
  452. case ACPI_TYPE_LOCAL_REFERENCE:
  453. /* Valid operand */
  454. break;
  455. default:
  456. ACPI_ERROR((AE_INFO,
  457. "Needed [Buffer/String/Package/Reference], found [%s] %p",
  458. acpi_ut_get_object_type_name
  459. (obj_desc), obj_desc));
  460. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  461. }
  462. goto next_operand;
  463. case ARGI_COMPLEXOBJ:
  464. /* Need a buffer or package or (ACPI 2.0) String */
  465. switch (obj_desc->common.type) {
  466. case ACPI_TYPE_PACKAGE:
  467. case ACPI_TYPE_STRING:
  468. case ACPI_TYPE_BUFFER:
  469. /* Valid operand */
  470. break;
  471. default:
  472. ACPI_ERROR((AE_INFO,
  473. "Needed [Buffer/String/Package], found [%s] %p",
  474. acpi_ut_get_object_type_name
  475. (obj_desc), obj_desc));
  476. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  477. }
  478. goto next_operand;
  479. case ARGI_REGION_OR_BUFFER: /* Used by Load() only */
  480. /*
  481. * Need an operand of type REGION or a BUFFER
  482. * (which could be a resolved region field)
  483. */
  484. switch (obj_desc->common.type) {
  485. case ACPI_TYPE_BUFFER:
  486. case ACPI_TYPE_REGION:
  487. /* Valid operand */
  488. break;
  489. default:
  490. ACPI_ERROR((AE_INFO,
  491. "Needed [Region/Buffer], found [%s] %p",
  492. acpi_ut_get_object_type_name
  493. (obj_desc), obj_desc));
  494. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  495. }
  496. goto next_operand;
  497. case ARGI_DATAREFOBJ:
  498. /* Used by the Store() operator only */
  499. switch (obj_desc->common.type) {
  500. case ACPI_TYPE_INTEGER:
  501. case ACPI_TYPE_PACKAGE:
  502. case ACPI_TYPE_STRING:
  503. case ACPI_TYPE_BUFFER:
  504. case ACPI_TYPE_BUFFER_FIELD:
  505. case ACPI_TYPE_LOCAL_REFERENCE:
  506. case ACPI_TYPE_LOCAL_REGION_FIELD:
  507. case ACPI_TYPE_LOCAL_BANK_FIELD:
  508. case ACPI_TYPE_LOCAL_INDEX_FIELD:
  509. case ACPI_TYPE_DDB_HANDLE:
  510. /* Valid operand */
  511. break;
  512. default:
  513. if (acpi_gbl_enable_interpreter_slack) {
  514. /*
  515. * Enable original behavior of Store(), allowing any
  516. * and all objects as the source operand. The ACPI
  517. * spec does not allow this, however.
  518. */
  519. break;
  520. }
  521. if (target_op == AML_DEBUG_OP) {
  522. /* Allow store of any object to the Debug object */
  523. break;
  524. }
  525. ACPI_ERROR((AE_INFO,
  526. "Needed Integer/Buffer/String/Package/Ref/Ddb]"
  527. ", found [%s] %p",
  528. acpi_ut_get_object_type_name
  529. (obj_desc), obj_desc));
  530. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  531. }
  532. goto next_operand;
  533. default:
  534. /* Unknown type */
  535. ACPI_ERROR((AE_INFO,
  536. "Internal - Unknown ARGI (required operand) type 0x%X",
  537. this_arg_type));
  538. return_ACPI_STATUS(AE_BAD_PARAMETER);
  539. }
  540. /*
  541. * Make sure that the original object was resolved to the
  542. * required object type (Simple cases only).
  543. */
  544. status =
  545. acpi_ex_check_object_type(type_needed,
  546. (*stack_ptr)->common.type,
  547. *stack_ptr);
  548. if (ACPI_FAILURE(status)) {
  549. return_ACPI_STATUS(status);
  550. }
  551. next_operand:
  552. /*
  553. * If more operands needed, decrement stack_ptr to point
  554. * to next operand on stack
  555. */
  556. if (GET_CURRENT_ARG_TYPE(arg_types)) {
  557. stack_ptr--;
  558. }
  559. }
  560. ACPI_DUMP_OPERANDS(walk_state->operands,
  561. acpi_ps_get_opcode_name(opcode),
  562. walk_state->num_operands);
  563. return_ACPI_STATUS(status);
  564. }