[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] ACPI cpufreq fix 1/2



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1222344372 -3600
# Node ID 28419b05401ca2cb00908f9d527f76644523e032
# Parent  916aae9cc11a68c6d92086c89df3c1eeb0805c14
ACPI cpufreq fix 1/2

commit 24058054d781934df526be114c612cf2b29cf4e7
Author: Bob Moore <robert.moore@xxxxxxxxx>
Date:   Fri Feb 2 19:48:18 2007 +0300

    ACPICA: Handle mis-matched package length

    Implement support within the AML interpreter for
    package objects that contain a mismatch between the AML
    length and package element count. In this case, the lesser
    of the two is used. Some BIOS code apparently modifies
    the package length on the fly, and this change supports
    this. Provides compatibility with the MS AML interpreter.

    Signed-off-by: Alexey Starikovskiy
    <alexey.y.starikovskiy@xxxxxxxxx>
    Signed-off-by: Len Brown <len.brown@xxxxxxxxx>
---
 drivers/acpi/dispatcher/dsobject.c |   29 ++++++++++++++++++++---------
 1 files changed, 20 insertions(+), 9 deletions(-)

diff -r 916aae9cc11a -r 28419b05401c drivers/acpi/dispatcher/dsobject.c
--- a/drivers/acpi/dispatcher/dsobject.c        Mon Sep 22 16:08:10 2008 +0100
+++ b/drivers/acpi/dispatcher/dsobject.c        Thu Sep 25 13:06:12 2008 +0100
@@ -384,9 +384,7 @@ acpi_ds_build_internal_package_obj(struc
                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;
@@ -395,11 +393,24 @@ acpi_ds_build_internal_package_obj(struc
        }
 
        /*
-        * The package length (number of elements) will be the greater
-        * of the specified length and the length of the initializer list
-        */
-       if (package_list_length > package_length) {
-               obj_desc->package.count = package_list_length;
+        * 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.
+        */
+       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;
+               }
        }
 
        /*
@@ -422,7 +433,7 @@ acpi_ds_build_internal_package_obj(struc
         */
        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) {
                        if (arg->common.node->type == ACPI_TYPE_METHOD) {
                                /*

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.