Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46339
b: refs/heads/master
c: 2405805
h: refs/heads/master
i:
  46337: f348984
  46335: 42a2349
v: v3
  • Loading branch information
Bob Moore authored and Len Brown committed Feb 3, 2007
1 parent ce53b66 commit 43f69f8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c9e3ba2c1d178195e17bb4f1d49c32e0be8dbb16
refs/heads/master: 24058054d781934df526be114c612cf2b29cf4e7
27 changes: 19 additions & 8 deletions trunk/drivers/acpi/dispatcher/dsobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,7 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
obj_desc->package.node = parent->common.node;
}

obj_desc->package.count = package_length;

/* Count the number of items in the package list */
/* Count the *actual* number of items in the package list */

arg = op->common.value.arg;
arg = arg->common.next;
Expand All @@ -329,11 +327,24 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
}

/*
* The package length (number of elements) will be the greater
* of the specified length and the length of the initializer list
* The number of elements in the package will be the lesser of the
* specified element count and the length of the initializer list.
*
* Even though the ASL compilers do not allow this to happen (for the
* fixed length package opcode), some BIOS code modifies the AML on the
* fly to adjust the package length, and this code compensates for that.
* This also provides compatibility with other AML interpreters.
*/
if (package_list_length > package_length) {
obj_desc->package.count = package_list_length;
obj_desc->package.count = package_length;

if (package_list_length != package_length) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Package length mismatch, using lesser of %X(Length Arg) and %X(AML Length)\n",
package_length, package_list_length));

if (package_list_length < package_length) {
obj_desc->package.count = package_list_length;
}
}

/*
Expand All @@ -356,7 +367,7 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
*/
arg = op->common.value.arg;
arg = arg->common.next;
for (i = 0; arg; i++) {
for (i = 0; i < obj_desc->package.count; i++) {
if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) {

/* Object (package or buffer) is already built */
Expand Down

0 comments on commit 43f69f8

Please sign in to comment.