exmisc.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  1. /******************************************************************************
  2. *
  3. * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes
  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/acinterp.h>
  44. #include <acpi/amlcode.h>
  45. #define _COMPONENT ACPI_EXECUTER
  46. ACPI_MODULE_NAME("exmisc")
  47. /*******************************************************************************
  48. *
  49. * FUNCTION: acpi_ex_get_object_reference
  50. *
  51. * PARAMETERS: obj_desc - Create a reference to this object
  52. * return_desc - Where to store the reference
  53. * walk_state - Current state
  54. *
  55. * RETURN: Status
  56. *
  57. * DESCRIPTION: Obtain and return a "reference" to the target object
  58. * Common code for the ref_of_op and the cond_ref_of_op.
  59. *
  60. ******************************************************************************/
  61. acpi_status
  62. acpi_ex_get_object_reference(union acpi_operand_object *obj_desc,
  63. union acpi_operand_object **return_desc,
  64. struct acpi_walk_state *walk_state)
  65. {
  66. union acpi_operand_object *reference_obj;
  67. union acpi_operand_object *referenced_obj;
  68. ACPI_FUNCTION_TRACE_PTR("ex_get_object_reference", obj_desc);
  69. *return_desc = NULL;
  70. switch (ACPI_GET_DESCRIPTOR_TYPE(obj_desc)) {
  71. case ACPI_DESC_TYPE_OPERAND:
  72. if (ACPI_GET_OBJECT_TYPE(obj_desc) != ACPI_TYPE_LOCAL_REFERENCE) {
  73. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  74. }
  75. /*
  76. * Must be a reference to a Local or Arg
  77. */
  78. switch (obj_desc->reference.opcode) {
  79. case AML_LOCAL_OP:
  80. case AML_ARG_OP:
  81. case AML_DEBUG_OP:
  82. /* The referenced object is the pseudo-node for the local/arg */
  83. referenced_obj = obj_desc->reference.object;
  84. break;
  85. default:
  86. ACPI_REPORT_ERROR(("Unknown Reference opcode in get_reference %X\n", obj_desc->reference.opcode));
  87. return_ACPI_STATUS(AE_AML_INTERNAL);
  88. }
  89. break;
  90. case ACPI_DESC_TYPE_NAMED:
  91. /*
  92. * A named reference that has already been resolved to a Node
  93. */
  94. referenced_obj = obj_desc;
  95. break;
  96. default:
  97. ACPI_REPORT_ERROR(("Invalid descriptor type in get_reference: %X\n", ACPI_GET_DESCRIPTOR_TYPE(obj_desc)));
  98. return_ACPI_STATUS(AE_TYPE);
  99. }
  100. /* Create a new reference object */
  101. reference_obj =
  102. acpi_ut_create_internal_object(ACPI_TYPE_LOCAL_REFERENCE);
  103. if (!reference_obj) {
  104. return_ACPI_STATUS(AE_NO_MEMORY);
  105. }
  106. reference_obj->reference.opcode = AML_REF_OF_OP;
  107. reference_obj->reference.object = referenced_obj;
  108. *return_desc = reference_obj;
  109. ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
  110. "Object %p Type [%s], returning Reference %p\n",
  111. obj_desc, acpi_ut_get_object_type_name(obj_desc),
  112. *return_desc));
  113. return_ACPI_STATUS(AE_OK);
  114. }
  115. /*******************************************************************************
  116. *
  117. * FUNCTION: acpi_ex_concat_template
  118. *
  119. * PARAMETERS: Operand0 - First source object
  120. * Operand1 - Second source object
  121. * actual_return_desc - Where to place the return object
  122. * walk_state - Current walk state
  123. *
  124. * RETURN: Status
  125. *
  126. * DESCRIPTION: Concatenate two resource templates
  127. *
  128. ******************************************************************************/
  129. acpi_status
  130. acpi_ex_concat_template(union acpi_operand_object *operand0,
  131. union acpi_operand_object *operand1,
  132. union acpi_operand_object **actual_return_desc,
  133. struct acpi_walk_state *walk_state)
  134. {
  135. union acpi_operand_object *return_desc;
  136. u8 *new_buf;
  137. u8 *end_tag1;
  138. u8 *end_tag2;
  139. acpi_size length1;
  140. acpi_size length2;
  141. ACPI_FUNCTION_TRACE("ex_concat_template");
  142. /* Find the end_tags in each resource template */
  143. end_tag1 = acpi_ut_get_resource_end_tag(operand0);
  144. end_tag2 = acpi_ut_get_resource_end_tag(operand1);
  145. if (!end_tag1 || !end_tag2) {
  146. return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
  147. }
  148. /* Compute the length of each part */
  149. length1 = ACPI_PTR_DIFF(end_tag1, operand0->buffer.pointer);
  150. length2 = ACPI_PTR_DIFF(end_tag2, operand1->buffer.pointer) + 2; /* Size of END_TAG */
  151. /* Create a new buffer object for the result */
  152. return_desc = acpi_ut_create_buffer_object(length1 + length2);
  153. if (!return_desc) {
  154. return_ACPI_STATUS(AE_NO_MEMORY);
  155. }
  156. /* Copy the templates to the new descriptor */
  157. new_buf = return_desc->buffer.pointer;
  158. ACPI_MEMCPY(new_buf, operand0->buffer.pointer, length1);
  159. ACPI_MEMCPY(new_buf + length1, operand1->buffer.pointer, length2);
  160. /* Compute the new checksum */
  161. new_buf[return_desc->buffer.length - 1] =
  162. acpi_ut_generate_checksum(return_desc->buffer.pointer,
  163. (return_desc->buffer.length - 1));
  164. /* Return the completed template descriptor */
  165. *actual_return_desc = return_desc;
  166. return_ACPI_STATUS(AE_OK);
  167. }
  168. /*******************************************************************************
  169. *
  170. * FUNCTION: acpi_ex_do_concatenate
  171. *
  172. * PARAMETERS: Operand0 - First source object
  173. * Operand1 - Second source object
  174. * actual_return_desc - Where to place the return object
  175. * walk_state - Current walk state
  176. *
  177. * RETURN: Status
  178. *
  179. * DESCRIPTION: Concatenate two objects OF THE SAME TYPE.
  180. *
  181. ******************************************************************************/
  182. acpi_status
  183. acpi_ex_do_concatenate(union acpi_operand_object *operand0,
  184. union acpi_operand_object *operand1,
  185. union acpi_operand_object **actual_return_desc,
  186. struct acpi_walk_state *walk_state)
  187. {
  188. union acpi_operand_object *local_operand1 = operand1;
  189. union acpi_operand_object *return_desc;
  190. char *new_buf;
  191. acpi_status status;
  192. acpi_size new_length;
  193. ACPI_FUNCTION_TRACE("ex_do_concatenate");
  194. /*
  195. * Convert the second operand if necessary. The first operand
  196. * determines the type of the second operand, (See the Data Types
  197. * section of the ACPI specification.) Both object types are
  198. * guaranteed to be either Integer/String/Buffer by the operand
  199. * resolution mechanism.
  200. */
  201. switch (ACPI_GET_OBJECT_TYPE(operand0)) {
  202. case ACPI_TYPE_INTEGER:
  203. status =
  204. acpi_ex_convert_to_integer(operand1, &local_operand1, 16);
  205. break;
  206. case ACPI_TYPE_STRING:
  207. status = acpi_ex_convert_to_string(operand1, &local_operand1,
  208. ACPI_IMPLICIT_CONVERT_HEX);
  209. break;
  210. case ACPI_TYPE_BUFFER:
  211. status = acpi_ex_convert_to_buffer(operand1, &local_operand1);
  212. break;
  213. default:
  214. ACPI_REPORT_ERROR(("Concat - invalid obj type: %X\n",
  215. ACPI_GET_OBJECT_TYPE(operand0)));
  216. status = AE_AML_INTERNAL;
  217. }
  218. if (ACPI_FAILURE(status)) {
  219. goto cleanup;
  220. }
  221. /*
  222. * Both operands are now known to be the same object type
  223. * (Both are Integer, String, or Buffer), and we can now perform the
  224. * concatenation.
  225. */
  226. /*
  227. * There are three cases to handle:
  228. *
  229. * 1) Two Integers concatenated to produce a new Buffer
  230. * 2) Two Strings concatenated to produce a new String
  231. * 3) Two Buffers concatenated to produce a new Buffer
  232. */
  233. switch (ACPI_GET_OBJECT_TYPE(operand0)) {
  234. case ACPI_TYPE_INTEGER:
  235. /* Result of two Integers is a Buffer */
  236. /* Need enough buffer space for two integers */
  237. return_desc = acpi_ut_create_buffer_object((acpi_size)
  238. ACPI_MUL_2
  239. (acpi_gbl_integer_byte_width));
  240. if (!return_desc) {
  241. status = AE_NO_MEMORY;
  242. goto cleanup;
  243. }
  244. new_buf = (char *)return_desc->buffer.pointer;
  245. /* Copy the first integer, LSB first */
  246. ACPI_MEMCPY(new_buf,
  247. &operand0->integer.value,
  248. acpi_gbl_integer_byte_width);
  249. /* Copy the second integer (LSB first) after the first */
  250. ACPI_MEMCPY(new_buf + acpi_gbl_integer_byte_width,
  251. &local_operand1->integer.value,
  252. acpi_gbl_integer_byte_width);
  253. break;
  254. case ACPI_TYPE_STRING:
  255. /* Result of two Strings is a String */
  256. new_length = (acpi_size) operand0->string.length +
  257. (acpi_size) local_operand1->string.length;
  258. if (new_length > ACPI_MAX_STRING_CONVERSION) {
  259. status = AE_AML_STRING_LIMIT;
  260. goto cleanup;
  261. }
  262. return_desc = acpi_ut_create_string_object(new_length);
  263. if (!return_desc) {
  264. status = AE_NO_MEMORY;
  265. goto cleanup;
  266. }
  267. new_buf = return_desc->string.pointer;
  268. /* Concatenate the strings */
  269. ACPI_STRCPY(new_buf, operand0->string.pointer);
  270. ACPI_STRCPY(new_buf + operand0->string.length,
  271. local_operand1->string.pointer);
  272. break;
  273. case ACPI_TYPE_BUFFER:
  274. /* Result of two Buffers is a Buffer */
  275. return_desc = acpi_ut_create_buffer_object((acpi_size)
  276. operand0->buffer.
  277. length +
  278. (acpi_size)
  279. local_operand1->
  280. buffer.length);
  281. if (!return_desc) {
  282. status = AE_NO_MEMORY;
  283. goto cleanup;
  284. }
  285. new_buf = (char *)return_desc->buffer.pointer;
  286. /* Concatenate the buffers */
  287. ACPI_MEMCPY(new_buf,
  288. operand0->buffer.pointer, operand0->buffer.length);
  289. ACPI_MEMCPY(new_buf + operand0->buffer.length,
  290. local_operand1->buffer.pointer,
  291. local_operand1->buffer.length);
  292. break;
  293. default:
  294. /* Invalid object type, should not happen here */
  295. ACPI_REPORT_ERROR(("Concatenate - Invalid object type: %X\n",
  296. ACPI_GET_OBJECT_TYPE(operand0)));
  297. status = AE_AML_INTERNAL;
  298. goto cleanup;
  299. }
  300. *actual_return_desc = return_desc;
  301. cleanup:
  302. if (local_operand1 != operand1) {
  303. acpi_ut_remove_reference(local_operand1);
  304. }
  305. return_ACPI_STATUS(status);
  306. }
  307. /*******************************************************************************
  308. *
  309. * FUNCTION: acpi_ex_do_math_op
  310. *
  311. * PARAMETERS: Opcode - AML opcode
  312. * Integer0 - Integer operand #0
  313. * Integer1 - Integer operand #1
  314. *
  315. * RETURN: Integer result of the operation
  316. *
  317. * DESCRIPTION: Execute a math AML opcode. The purpose of having all of the
  318. * math functions here is to prevent a lot of pointer dereferencing
  319. * to obtain the operands.
  320. *
  321. ******************************************************************************/
  322. acpi_integer
  323. acpi_ex_do_math_op(u16 opcode, acpi_integer integer0, acpi_integer integer1)
  324. {
  325. ACPI_FUNCTION_ENTRY();
  326. switch (opcode) {
  327. case AML_ADD_OP: /* Add (Integer0, Integer1, Result) */
  328. return (integer0 + integer1);
  329. case AML_BIT_AND_OP: /* And (Integer0, Integer1, Result) */
  330. return (integer0 & integer1);
  331. case AML_BIT_NAND_OP: /* NAnd (Integer0, Integer1, Result) */
  332. return (~(integer0 & integer1));
  333. case AML_BIT_OR_OP: /* Or (Integer0, Integer1, Result) */
  334. return (integer0 | integer1);
  335. case AML_BIT_NOR_OP: /* NOr (Integer0, Integer1, Result) */
  336. return (~(integer0 | integer1));
  337. case AML_BIT_XOR_OP: /* XOr (Integer0, Integer1, Result) */
  338. return (integer0 ^ integer1);
  339. case AML_MULTIPLY_OP: /* Multiply (Integer0, Integer1, Result) */
  340. return (integer0 * integer1);
  341. case AML_SHIFT_LEFT_OP: /* shift_left (Operand, shift_count, Result) */
  342. return (integer0 << integer1);
  343. case AML_SHIFT_RIGHT_OP: /* shift_right (Operand, shift_count, Result) */
  344. return (integer0 >> integer1);
  345. case AML_SUBTRACT_OP: /* Subtract (Integer0, Integer1, Result) */
  346. return (integer0 - integer1);
  347. default:
  348. return (0);
  349. }
  350. }
  351. /*******************************************************************************
  352. *
  353. * FUNCTION: acpi_ex_do_logical_numeric_op
  354. *
  355. * PARAMETERS: Opcode - AML opcode
  356. * Integer0 - Integer operand #0
  357. * Integer1 - Integer operand #1
  358. * logical_result - TRUE/FALSE result of the operation
  359. *
  360. * RETURN: Status
  361. *
  362. * DESCRIPTION: Execute a logical "Numeric" AML opcode. For these Numeric
  363. * operators (LAnd and LOr), both operands must be integers.
  364. *
  365. * Note: cleanest machine code seems to be produced by the code
  366. * below, rather than using statements of the form:
  367. * Result = (Integer0 && Integer1);
  368. *
  369. ******************************************************************************/
  370. acpi_status
  371. acpi_ex_do_logical_numeric_op(u16 opcode,
  372. acpi_integer integer0,
  373. acpi_integer integer1, u8 * logical_result)
  374. {
  375. acpi_status status = AE_OK;
  376. u8 local_result = FALSE;
  377. ACPI_FUNCTION_TRACE("ex_do_logical_numeric_op");
  378. switch (opcode) {
  379. case AML_LAND_OP: /* LAnd (Integer0, Integer1) */
  380. if (integer0 && integer1) {
  381. local_result = TRUE;
  382. }
  383. break;
  384. case AML_LOR_OP: /* LOr (Integer0, Integer1) */
  385. if (integer0 || integer1) {
  386. local_result = TRUE;
  387. }
  388. break;
  389. default:
  390. status = AE_AML_INTERNAL;
  391. break;
  392. }
  393. /* Return the logical result and status */
  394. *logical_result = local_result;
  395. return_ACPI_STATUS(status);
  396. }
  397. /*******************************************************************************
  398. *
  399. * FUNCTION: acpi_ex_do_logical_op
  400. *
  401. * PARAMETERS: Opcode - AML opcode
  402. * Operand0 - operand #0
  403. * Operand1 - operand #1
  404. * logical_result - TRUE/FALSE result of the operation
  405. *
  406. * RETURN: Status
  407. *
  408. * DESCRIPTION: Execute a logical AML opcode. The purpose of having all of the
  409. * functions here is to prevent a lot of pointer dereferencing
  410. * to obtain the operands and to simplify the generation of the
  411. * logical value. For the Numeric operators (LAnd and LOr), both
  412. * operands must be integers. For the other logical operators,
  413. * operands can be any combination of Integer/String/Buffer. The
  414. * first operand determines the type to which the second operand
  415. * will be converted.
  416. *
  417. * Note: cleanest machine code seems to be produced by the code
  418. * below, rather than using statements of the form:
  419. * Result = (Operand0 == Operand1);
  420. *
  421. ******************************************************************************/
  422. acpi_status
  423. acpi_ex_do_logical_op(u16 opcode,
  424. union acpi_operand_object *operand0,
  425. union acpi_operand_object *operand1, u8 * logical_result)
  426. {
  427. union acpi_operand_object *local_operand1 = operand1;
  428. acpi_integer integer0;
  429. acpi_integer integer1;
  430. u32 length0;
  431. u32 length1;
  432. acpi_status status = AE_OK;
  433. u8 local_result = FALSE;
  434. int compare;
  435. ACPI_FUNCTION_TRACE("ex_do_logical_op");
  436. /*
  437. * Convert the second operand if necessary. The first operand
  438. * determines the type of the second operand, (See the Data Types
  439. * section of the ACPI 3.0+ specification.) Both object types are
  440. * guaranteed to be either Integer/String/Buffer by the operand
  441. * resolution mechanism.
  442. */
  443. switch (ACPI_GET_OBJECT_TYPE(operand0)) {
  444. case ACPI_TYPE_INTEGER:
  445. status =
  446. acpi_ex_convert_to_integer(operand1, &local_operand1, 16);
  447. break;
  448. case ACPI_TYPE_STRING:
  449. status = acpi_ex_convert_to_string(operand1, &local_operand1,
  450. ACPI_IMPLICIT_CONVERT_HEX);
  451. break;
  452. case ACPI_TYPE_BUFFER:
  453. status = acpi_ex_convert_to_buffer(operand1, &local_operand1);
  454. break;
  455. default:
  456. status = AE_AML_INTERNAL;
  457. break;
  458. }
  459. if (ACPI_FAILURE(status)) {
  460. goto cleanup;
  461. }
  462. /*
  463. * Two cases: 1) Both Integers, 2) Both Strings or Buffers
  464. */
  465. if (ACPI_GET_OBJECT_TYPE(operand0) == ACPI_TYPE_INTEGER) {
  466. /*
  467. * 1) Both operands are of type integer
  468. * Note: local_operand1 may have changed above
  469. */
  470. integer0 = operand0->integer.value;
  471. integer1 = local_operand1->integer.value;
  472. switch (opcode) {
  473. case AML_LEQUAL_OP: /* LEqual (Operand0, Operand1) */
  474. if (integer0 == integer1) {
  475. local_result = TRUE;
  476. }
  477. break;
  478. case AML_LGREATER_OP: /* LGreater (Operand0, Operand1) */
  479. if (integer0 > integer1) {
  480. local_result = TRUE;
  481. }
  482. break;
  483. case AML_LLESS_OP: /* LLess (Operand0, Operand1) */
  484. if (integer0 < integer1) {
  485. local_result = TRUE;
  486. }
  487. break;
  488. default:
  489. status = AE_AML_INTERNAL;
  490. break;
  491. }
  492. } else {
  493. /*
  494. * 2) Both operands are Strings or both are Buffers
  495. * Note: Code below takes advantage of common Buffer/String
  496. * object fields. local_operand1 may have changed above. Use
  497. * memcmp to handle nulls in buffers.
  498. */
  499. length0 = operand0->buffer.length;
  500. length1 = local_operand1->buffer.length;
  501. /* Lexicographic compare: compare the data bytes */
  502. compare = ACPI_MEMCMP((const char *)operand0->buffer.pointer,
  503. (const char *)local_operand1->buffer.
  504. pointer,
  505. (length0 > length1) ? length1 : length0);
  506. switch (opcode) {
  507. case AML_LEQUAL_OP: /* LEqual (Operand0, Operand1) */
  508. /* Length and all bytes must be equal */
  509. if ((length0 == length1) && (compare == 0)) {
  510. /* Length and all bytes match ==> TRUE */
  511. local_result = TRUE;
  512. }
  513. break;
  514. case AML_LGREATER_OP: /* LGreater (Operand0, Operand1) */
  515. if (compare > 0) {
  516. local_result = TRUE;
  517. goto cleanup; /* TRUE */
  518. }
  519. if (compare < 0) {
  520. goto cleanup; /* FALSE */
  521. }
  522. /* Bytes match (to shortest length), compare lengths */
  523. if (length0 > length1) {
  524. local_result = TRUE;
  525. }
  526. break;
  527. case AML_LLESS_OP: /* LLess (Operand0, Operand1) */
  528. if (compare > 0) {
  529. goto cleanup; /* FALSE */
  530. }
  531. if (compare < 0) {
  532. local_result = TRUE;
  533. goto cleanup; /* TRUE */
  534. }
  535. /* Bytes match (to shortest length), compare lengths */
  536. if (length0 < length1) {
  537. local_result = TRUE;
  538. }
  539. break;
  540. default:
  541. status = AE_AML_INTERNAL;
  542. break;
  543. }
  544. }
  545. cleanup:
  546. /* New object was created if implicit conversion performed - delete */
  547. if (local_operand1 != operand1) {
  548. acpi_ut_remove_reference(local_operand1);
  549. }
  550. /* Return the logical result and status */
  551. *logical_result = local_result;
  552. return_ACPI_STATUS(status);
  553. }