exresop.c 17 KB

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