PageRenderTime 50ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/acpi/acpica/nsrepair.c

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