Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi/acpica/Subsystem Make ACPI interpreter a bit pe...



details:   https://anonhg.NetBSD.org/src/rev/68d9370b5e7a
branches:  trunk
changeset: 556582:68d9370b5e7a
user:      kochi <kochi%NetBSD.org@localhost>
date:      Sun Dec 21 07:50:26 2003 +0000

description:
Make ACPI interpreter a bit permissive:
   * allow access beyond limit of a region
     (which is found in some buggy firmwares)
from FreeBSD's local changes

diffstat:

 sys/dev/acpi/acpica/Subsystem/exfldio.c |  21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diffs (38 lines):

diff -r 307d2ce7a020 -r 68d9370b5e7a sys/dev/acpi/acpica/Subsystem/exfldio.c
--- a/sys/dev/acpi/acpica/Subsystem/exfldio.c   Sun Dec 21 07:42:11 2003 +0000
+++ b/sys/dev/acpi/acpica/Subsystem/exfldio.c   Sun Dec 21 07:50:26 2003 +0000
@@ -116,7 +116,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exfldio.c,v 1.9 2003/12/13 18:11:01 kochi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exfldio.c,v 1.10 2003/12/21 07:50:26 kochi Exp $");
 
 #define __EXFLDIO_C__
 
@@ -240,6 +240,25 @@
             FieldDatumByteOffset, ObjDesc->CommonField.AccessByteWidth,
             AcpiUtGetNodeName (RgnDesc->Region.Node), RgnDesc->Region.Length));
 
+#ifndef ACPICA_PEDANTIC
+        {
+            /*
+             * Allow access to the field if it is within the region size
+             * rounded up to a multiple of the access byte width. This
+             * overcomes "off-by-one" programming errors in the AML often
+             * found in Toshiba laptops.  These errors were allowed by
+             * the Microsoft ASL compiler.
+             */
+            UINT32 rounded_length = ACPI_ROUND_UP(RgnDesc->Region.Length,
+              ObjDesc->CommonField.AccessByteWidth);
+
+            if (rounded_length >= (ObjDesc->CommonField.BaseByteOffset +
+                                   FieldDatumByteOffset +
+                                   ObjDesc->CommonField.AccessByteWidth)) {
+                return_ACPI_STATUS (AE_OK);
+            }
+        }
+#endif
         return_ACPI_STATUS (AE_AML_REGION_LIMIT);
     }
 



Home | Main Index | Thread Index | Old Index