PageRenderTime 64ms CodeModel.GetById 32ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/acpi/acpica/nsrepair.c

https://github.com/dmitriy103/bravo_kernel-2.6.35
C | 733 lines | 349 code | 113 blank | 271 comment | 51 complexity | 9c5b42b324f2ec8e5fab257fac7313d4 MD5 | raw file
  1. /******************************************************************************
  2. *
  3. * Module Name: nsrepair - Repair for objects returned by predefined methods
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2010, 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 "acnamesp.h"
  45. #include "acinterp.h"
  46. #include "acpredef.h"
  47. #define _COMPONENT ACPI_NAMESPACE
  48. ACPI_MODULE_NAME("nsrepair")
  49. /*******************************************************************************
  50. *
  51. * This module attempts to repair or convert objects returned by the
  52. * predefined methods to an object type that is expected, as per the ACPI
  53. * specification. The need for this code is dictated by the many machines that
  54. * return incorrect types for the standard predefined methods. Performing these
  55. * conversions here, in one place, eliminates the need for individual ACPI
  56. * device drivers to do the same. Note: Most of these conversions are different
  57. * than the internal object conversion routines used for implicit object
  58. * conversion.
  59. *
  60. * The following conversions can be performed as necessary:
  61. *
  62. * Integer -> String
  63. * Integer -> Buffer
  64. * String -> Integer
  65. * String -> Buffer
  66. * Buffer -> Integer
  67. * Buffer -> String
  68. * Buffer -> Package of Integers
  69. * Package -> Package of one Package
  70. *
  71. * Additional possible repairs:
  72. *
  73. * Optional/unnecessary NULL package elements removed
  74. * Required package elements that are NULL replaced by Integer/String/Buffer
  75. * Incorrect standalone package wrapped with required outer package
  76. *
  77. ******************************************************************************/
  78. /* Local prototypes */
  79. static acpi_status
  80. acpi_ns_convert_to_integer(union acpi_operand_object *original_object,
  81. union acpi_operand_object **return_object);
  82. static acpi_status
  83. acpi_ns_convert_to_string(union acpi_operand_object *original_object,
  84. union acpi_operand_object **return_object);
  85. static acpi_status
  86. acpi_ns_convert_to_buffer(union acpi_operand_object *original_object,
  87. union acpi_operand_object **return_object);
  88. static acpi_status
  89. acpi_ns_convert_to_package(union acpi_operand_object *original_object,
  90. union acpi_operand_object **return_object);
  91. /*******************************************************************************
  92. *
  93. * FUNCTION: acpi_ns_repair_object
  94. *
  95. * PARAMETERS: Data - Pointer to validation data structure
  96. * expected_btypes - Object types expected
  97. * package_index - Index of object within parent package (if
  98. * applicable - ACPI_NOT_PACKAGE_ELEMENT
  99. * otherwise)
  100. * return_object_ptr - Pointer to the object returned from the
  101. * evaluation of a method or object
  102. *
  103. * RETURN: Status. AE_OK if repair was successful.
  104. *
  105. * DESCRIPTION: Attempt to repair/convert a return object of a type that was
  106. * not expected.
  107. *
  108. ******************************************************************************/
  109. acpi_status
  110. acpi_ns_repair_object(struct acpi_predefined_data *data,
  111. u32 expected_btypes,
  112. u32 package_index,
  113. union acpi_operand_object **return_object_ptr)
  114. {
  115. union acpi_operand_object *return_object = *return_object_ptr;
  116. union acpi_operand_object *new_object;
  117. acpi_status status;
  118. ACPI_FUNCTION_NAME(ns_repair_object);
  119. /*
  120. * At this point, we know that the type of the returned object was not
  121. * one of the expected types for this predefined name. Attempt to
  122. * repair the object by converting it to one of the expected object
  123. * types for this predefined name.
  124. */
  125. if (expected_btypes & ACPI_RTYPE_INTEGER) {
  126. status = acpi_ns_convert_to_integer(return_object, &new_object);
  127. if (ACPI_SUCCESS(status)) {
  128. goto object_repaired;
  129. }
  130. }
  131. if (expected_btypes & ACPI_RTYPE_STRING) {
  132. status = acpi_ns_convert_to_string(return_object, &new_object);
  133. if (ACPI_SUCCESS(status)) {
  134. goto object_repaired;
  135. }
  136. }
  137. if (expected_btypes & ACPI_RTYPE_BUFFER) {
  138. status = acpi_ns_convert_to_buffer(return_object, &new_object);
  139. if (ACPI_SUCCESS(status)) {
  140. goto object_repaired;
  141. }
  142. }
  143. if (expected_btypes & ACPI_RTYPE_PACKAGE) {
  144. status = acpi_ns_convert_to_package(return_object, &new_object);
  145. if (ACPI_SUCCESS(status)) {
  146. goto object_repaired;
  147. }
  148. }
  149. /* We cannot repair this object */
  150. return (AE_AML_OPERAND_TYPE);
  151. object_repaired:
  152. /* Object was successfully repaired */
  153. /*
  154. * If the original object is a package element, we need to:
  155. * 1. Set the reference count of the new object to match the
  156. * reference count of the old object.
  157. * 2. Decrement the reference count of the original object.
  158. */
  159. if (package_index != ACPI_NOT_PACKAGE_ELEMENT) {
  160. new_object->common.reference_count =
  161. return_object->common.reference_count;
  162. if (return_object->common.reference_count > 1) {
  163. return_object->common.reference_count--;
  164. }
  165. ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
  166. "%s: Converted %s to expected %s at index %u\n",
  167. data->pathname,
  168. acpi_ut_get_object_type_name(return_object),
  169. acpi_ut_get_object_type_name(new_object),
  170. package_index));
  171. } else {
  172. ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
  173. "%s: Converted %s to expected %s\n",
  174. data->pathname,
  175. acpi_ut_get_object_type_name(return_object),
  176. acpi_ut_get_object_type_name(new_object)));
  177. }
  178. /* Delete old object, install the new return object */
  179. acpi_ut_remove_reference(return_object);
  180. *return_object_ptr = new_object;
  181. data->flags |= ACPI_OBJECT_REPAIRED;
  182. return (AE_OK);
  183. }
  184. /*******************************************************************************
  185. *
  186. * FUNCTION: acpi_ns_convert_to_integer
  187. *
  188. * PARAMETERS: original_object - Object to be converted
  189. * return_object - Where the new converted object is returned
  190. *
  191. * RETURN: Status. AE_OK if conversion was successful.
  192. *
  193. * DESCRIPTION: Attempt to convert a String/Buffer object to an Integer.
  194. *
  195. ******************************************************************************/
  196. static acpi_status
  197. acpi_ns_convert_to_integer(union acpi_operand_object *original_object,
  198. union acpi_operand_object **return_object)
  199. {
  200. union acpi_operand_object *new_object;
  201. acpi_status status;
  202. u64 value = 0;
  203. u32 i;
  204. switch (original_object->common.type) {
  205. case ACPI_TYPE_STRING:
  206. /* String-to-Integer conversion */
  207. status = acpi_ut_strtoul64(original_object->string.pointer,
  208. ACPI_ANY_BASE, &value);
  209. if (ACPI_FAILURE(status)) {
  210. return (status);
  211. }
  212. break;
  213. case ACPI_TYPE_BUFFER:
  214. /* Buffer-to-Integer conversion. Max buffer size is 64 bits. */
  215. if (original_object->buffer.length > 8) {
  216. return (AE_AML_OPERAND_TYPE);
  217. }
  218. /* Extract each buffer byte to create the integer */
  219. for (i = 0; i < original_object->buffer.length; i++) {
  220. value |=
  221. ((u64) original_object->buffer.
  222. pointer[i] << (i * 8));
  223. }
  224. break;
  225. default:
  226. return (AE_AML_OPERAND_TYPE);
  227. }
  228. new_object = acpi_ut_create_integer_object(value);
  229. if (!new_object) {
  230. return (AE_NO_MEMORY);
  231. }
  232. *return_object = new_object;
  233. return (AE_OK);
  234. }
  235. /*******************************************************************************
  236. *
  237. * FUNCTION: acpi_ns_convert_to_string
  238. *
  239. * PARAMETERS: original_object - Object to be converted
  240. * return_object - Where the new converted object is returned
  241. *
  242. * RETURN: Status. AE_OK if conversion was successful.
  243. *
  244. * DESCRIPTION: Attempt to convert a Integer/Buffer object to a String.
  245. *
  246. ******************************************************************************/
  247. static acpi_status
  248. acpi_ns_convert_to_string(union acpi_operand_object *original_object,
  249. union acpi_operand_object **return_object)
  250. {
  251. union acpi_operand_object *new_object;
  252. acpi_size length;
  253. acpi_status status;
  254. switch (original_object->common.type) {
  255. case ACPI_TYPE_INTEGER:
  256. /*
  257. * Integer-to-String conversion. Commonly, convert
  258. * an integer of value 0 to a NULL string. The last element of
  259. * _BIF and _BIX packages occasionally need this fix.
  260. */
  261. if (original_object->integer.value == 0) {
  262. /* Allocate a new NULL string object */
  263. new_object = acpi_ut_create_string_object(0);
  264. if (!new_object) {
  265. return (AE_NO_MEMORY);
  266. }
  267. } else {
  268. status =
  269. acpi_ex_convert_to_string(original_object,
  270. &new_object,
  271. ACPI_IMPLICIT_CONVERT_HEX);
  272. if (ACPI_FAILURE(status)) {
  273. return (status);
  274. }
  275. }
  276. break;
  277. case ACPI_TYPE_BUFFER:
  278. /*
  279. * Buffer-to-String conversion. Use a to_string
  280. * conversion, no transform performed on the buffer data. The best
  281. * example of this is the _BIF method, where the string data from
  282. * the battery is often (incorrectly) returned as buffer object(s).
  283. */
  284. length = 0;
  285. while ((length < original_object->buffer.length) &&
  286. (original_object->buffer.pointer[length])) {
  287. length++;
  288. }
  289. /* Allocate a new string object */
  290. new_object = acpi_ut_create_string_object(length);
  291. if (!new_object) {
  292. return (AE_NO_MEMORY);
  293. }
  294. /*
  295. * Copy the raw buffer data with no transform. String is already NULL
  296. * terminated at Length+1.
  297. */
  298. ACPI_MEMCPY(new_object->string.pointer,
  299. original_object->buffer.pointer, length);
  300. break;
  301. default:
  302. return (AE_AML_OPERAND_TYPE);
  303. }
  304. *return_object = new_object;
  305. return (AE_OK);
  306. }
  307. /*******************************************************************************
  308. *
  309. * FUNCTION: acpi_ns_convert_to_buffer
  310. *
  311. * PARAMETERS: original_object - Object to be converted
  312. * return_object - Where the new converted object is returned
  313. *
  314. * RETURN: Status. AE_OK if conversion was successful.
  315. *
  316. * DESCRIPTION: Attempt to convert a Integer/String/Package object to a Buffer.
  317. *
  318. ******************************************************************************/
  319. static acpi_status
  320. acpi_ns_convert_to_buffer(union acpi_operand_object *original_object,
  321. union acpi_operand_object **return_object)
  322. {
  323. union acpi_operand_object *new_object;
  324. acpi_status status;
  325. union acpi_operand_object **elements;
  326. u32 *dword_buffer;
  327. u32 count;
  328. u32 i;
  329. switch (original_object->common.type) {
  330. case ACPI_TYPE_INTEGER:
  331. /*
  332. * Integer-to-Buffer conversion.
  333. * Convert the Integer to a packed-byte buffer. _MAT and other
  334. * objects need this sometimes, if a read has been performed on a
  335. * Field object that is less than or equal to the global integer
  336. * size (32 or 64 bits).
  337. */
  338. status =
  339. acpi_ex_convert_to_buffer(original_object, &new_object);
  340. if (ACPI_FAILURE(status)) {
  341. return (status);
  342. }
  343. break;
  344. case ACPI_TYPE_STRING:
  345. /* String-to-Buffer conversion. Simple data copy */
  346. new_object =
  347. acpi_ut_create_buffer_object(original_object->string.
  348. length);
  349. if (!new_object) {
  350. return (AE_NO_MEMORY);
  351. }
  352. ACPI_MEMCPY(new_object->buffer.pointer,
  353. original_object->string.pointer,
  354. original_object->string.length);
  355. break;
  356. case ACPI_TYPE_PACKAGE:
  357. /*
  358. * This case is often seen for predefined names that must return a
  359. * Buffer object with multiple DWORD integers within. For example,
  360. * _FDE and _GTM. The Package can be converted to a Buffer.
  361. */
  362. /* All elements of the Package must be integers */
  363. elements = original_object->package.elements;
  364. count = original_object->package.count;
  365. for (i = 0; i < count; i++) {
  366. if ((!*elements) ||
  367. ((*elements)->common.type != ACPI_TYPE_INTEGER)) {
  368. return (AE_AML_OPERAND_TYPE);
  369. }
  370. elements++;
  371. }
  372. /* Create the new buffer object to replace the Package */
  373. new_object = acpi_ut_create_buffer_object(ACPI_MUL_4(count));
  374. if (!new_object) {
  375. return (AE_NO_MEMORY);
  376. }
  377. /* Copy the package elements (integers) to the buffer as DWORDs */
  378. elements = original_object->package.elements;
  379. dword_buffer = ACPI_CAST_PTR(u32, new_object->buffer.pointer);
  380. for (i = 0; i < count; i++) {
  381. *dword_buffer = (u32) (*elements)->integer.value;
  382. dword_buffer++;
  383. elements++;
  384. }
  385. break;
  386. default:
  387. return (AE_AML_OPERAND_TYPE);
  388. }
  389. *return_object = new_object;
  390. return (AE_OK);
  391. }
  392. /*******************************************************************************
  393. *
  394. * FUNCTION: acpi_ns_convert_to_package
  395. *
  396. * PARAMETERS: original_object - Object to be converted
  397. * return_object - Where the new converted object is returned
  398. *
  399. * RETURN: Status. AE_OK if conversion was successful.
  400. *
  401. * DESCRIPTION: Attempt to convert a Buffer object to a Package. Each byte of
  402. * the buffer is converted to a single integer package element.
  403. *
  404. ******************************************************************************/
  405. static acpi_status
  406. acpi_ns_convert_to_package(union acpi_operand_object *original_object,
  407. union acpi_operand_object **return_object)
  408. {
  409. union acpi_operand_object *new_object;
  410. union acpi_operand_object **elements;
  411. u32 length;
  412. u8 *buffer;
  413. switch (original_object->common.type) {
  414. case ACPI_TYPE_BUFFER:
  415. /* Buffer-to-Package conversion */
  416. length = original_object->buffer.length;
  417. new_object = acpi_ut_create_package_object(length);
  418. if (!new_object) {
  419. return (AE_NO_MEMORY);
  420. }
  421. /* Convert each buffer byte to an integer package element */
  422. elements = new_object->package.elements;
  423. buffer = original_object->buffer.pointer;
  424. while (length--) {
  425. *elements =
  426. acpi_ut_create_integer_object((u64) *buffer);
  427. if (!*elements) {
  428. acpi_ut_remove_reference(new_object);
  429. return (AE_NO_MEMORY);
  430. }
  431. elements++;
  432. buffer++;
  433. }
  434. break;
  435. default:
  436. return (AE_AML_OPERAND_TYPE);
  437. }
  438. *return_object = new_object;
  439. return (AE_OK);
  440. }
  441. /*******************************************************************************
  442. *
  443. * FUNCTION: acpi_ns_repair_null_element
  444. *
  445. * PARAMETERS: Data - Pointer to validation data structure
  446. * expected_btypes - Object types expected
  447. * package_index - Index of object within parent package (if
  448. * applicable - ACPI_NOT_PACKAGE_ELEMENT
  449. * otherwise)
  450. * return_object_ptr - Pointer to the object returned from the
  451. * evaluation of a method or object
  452. *
  453. * RETURN: Status. AE_OK if repair was successful.
  454. *
  455. * DESCRIPTION: Attempt to repair a NULL element of a returned Package object.
  456. *
  457. ******************************************************************************/
  458. acpi_status
  459. acpi_ns_repair_null_element(struct acpi_predefined_data *data,
  460. u32 expected_btypes,
  461. u32 package_index,
  462. union acpi_operand_object **return_object_ptr)
  463. {
  464. union acpi_operand_object *return_object = *return_object_ptr;
  465. union acpi_operand_object *new_object;
  466. ACPI_FUNCTION_NAME(ns_repair_null_element);
  467. /* No repair needed if return object is non-NULL */
  468. if (return_object) {
  469. return (AE_OK);
  470. }
  471. /*
  472. * Attempt to repair a NULL element of a Package object. This applies to
  473. * predefined names that return a fixed-length package and each element
  474. * is required. It does not apply to variable-length packages where NULL
  475. * elements are allowed, especially at the end of the package.
  476. */
  477. if (expected_btypes & ACPI_RTYPE_INTEGER) {
  478. /* Need an Integer - create a zero-value integer */
  479. new_object = acpi_ut_create_integer_object(0);
  480. } else if (expected_btypes & ACPI_RTYPE_STRING) {
  481. /* Need a String - create a NULL string */
  482. new_object = acpi_ut_create_string_object(0);
  483. } else if (expected_btypes & ACPI_RTYPE_BUFFER) {
  484. /* Need a Buffer - create a zero-length buffer */
  485. new_object = acpi_ut_create_buffer_object(0);
  486. } else {
  487. /* Error for all other expected types */
  488. return (AE_AML_OPERAND_TYPE);
  489. }
  490. if (!new_object) {
  491. return (AE_NO_MEMORY);
  492. }
  493. /* Set the reference count according to the parent Package object */
  494. new_object->common.reference_count =
  495. data->parent_package->common.reference_count;
  496. ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
  497. "%s: Converted NULL package element to expected %s at index %u\n",
  498. data->pathname,
  499. acpi_ut_get_object_type_name(new_object),
  500. package_index));
  501. *return_object_ptr = new_object;
  502. data->flags |= ACPI_OBJECT_REPAIRED;
  503. return (AE_OK);
  504. }
  505. /******************************************************************************
  506. *
  507. * FUNCTION: acpi_ns_remove_null_elements
  508. *
  509. * PARAMETERS: Data - Pointer to validation data structure
  510. * package_type - An acpi_return_package_types value
  511. * obj_desc - A Package object
  512. *
  513. * RETURN: None.
  514. *
  515. * DESCRIPTION: Remove all NULL package elements from packages that contain
  516. * a variable number of sub-packages. For these types of
  517. * packages, NULL elements can be safely removed.
  518. *
  519. *****************************************************************************/
  520. void
  521. acpi_ns_remove_null_elements(struct acpi_predefined_data *data,
  522. u8 package_type,
  523. union acpi_operand_object *obj_desc)
  524. {
  525. union acpi_operand_object **source;
  526. union acpi_operand_object **dest;
  527. u32 count;
  528. u32 new_count;
  529. u32 i;
  530. ACPI_FUNCTION_NAME(ns_remove_null_elements);
  531. /*
  532. * PTYPE1 packages contain no subpackages.
  533. * PTYPE2 packages contain a variable number of sub-packages. We can
  534. * safely remove all NULL elements from the PTYPE2 packages.
  535. */
  536. switch (package_type) {
  537. case ACPI_PTYPE1_FIXED:
  538. case ACPI_PTYPE1_VAR:
  539. case ACPI_PTYPE1_OPTION:
  540. return;
  541. case ACPI_PTYPE2:
  542. case ACPI_PTYPE2_COUNT:
  543. case ACPI_PTYPE2_PKG_COUNT:
  544. case ACPI_PTYPE2_FIXED:
  545. case ACPI_PTYPE2_MIN:
  546. case ACPI_PTYPE2_REV_FIXED:
  547. break;
  548. default:
  549. return;
  550. }
  551. count = obj_desc->package.count;
  552. new_count = count;
  553. source = obj_desc->package.elements;
  554. dest = source;
  555. /* Examine all elements of the package object, remove nulls */
  556. for (i = 0; i < count; i++) {
  557. if (!*source) {
  558. new_count--;
  559. } else {
  560. *dest = *source;
  561. dest++;
  562. }
  563. source++;
  564. }
  565. /* Update parent package if any null elements were removed */
  566. if (new_count < count) {
  567. ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
  568. "%s: Found and removed %u NULL elements\n",
  569. data->pathname, (count - new_count)));
  570. /* NULL terminate list and update the package count */
  571. *dest = NULL;
  572. obj_desc->package.count = new_count;
  573. }
  574. }
  575. /*******************************************************************************
  576. *
  577. * FUNCTION: acpi_ns_repair_package_list
  578. *
  579. * PARAMETERS: Data - Pointer to validation data structure
  580. * obj_desc_ptr - Pointer to the object to repair. The new
  581. * package object is returned here,
  582. * overwriting the old object.
  583. *
  584. * RETURN: Status, new object in *obj_desc_ptr
  585. *
  586. * DESCRIPTION: Repair a common problem with objects that are defined to return
  587. * a variable-length Package of Packages. If the variable-length
  588. * is one, some BIOS code mistakenly simply declares a single
  589. * Package instead of a Package with one sub-Package. This
  590. * function attempts to repair this error by wrapping a Package
  591. * object around the original Package, creating the correct
  592. * Package with one sub-Package.
  593. *
  594. * Names that can be repaired in this manner include:
  595. * _ALR, _CSD, _HPX, _MLS, _PRT, _PSS, _TRT, TSS
  596. *
  597. ******************************************************************************/
  598. acpi_status
  599. acpi_ns_repair_package_list(struct acpi_predefined_data *data,
  600. union acpi_operand_object **obj_desc_ptr)
  601. {
  602. union acpi_operand_object *pkg_obj_desc;
  603. ACPI_FUNCTION_NAME(ns_repair_package_list);
  604. /*
  605. * Create the new outer package and populate it. The new package will
  606. * have a single element, the lone subpackage.
  607. */
  608. pkg_obj_desc = acpi_ut_create_package_object(1);
  609. if (!pkg_obj_desc) {
  610. return (AE_NO_MEMORY);
  611. }
  612. pkg_obj_desc->package.elements[0] = *obj_desc_ptr;
  613. /* Return the new object in the object pointer */
  614. *obj_desc_ptr = pkg_obj_desc;
  615. data->flags |= ACPI_OBJECT_REPAIRED;
  616. ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
  617. "%s: Repaired incorrectly formed Package\n",
  618. data->pathname));
  619. return (AE_OK);
  620. }