exmisc.c 20 KB

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