diff options
author | njl <njl@FreeBSD.org> | 2003-10-22 22:30:57 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2003-10-22 22:30:57 +0000 |
commit | 18bf90d7da26a56d1f5713c0c4ad4c05ccda3497 (patch) | |
tree | 57a37ed2a41bd40db45bafd86027010b0072d154 /sys | |
parent | 67f989102eee011901934c1698e4acd52f868f95 (diff) | |
download | FreeBSD-src-18bf90d7da26a56d1f5713c0c4ad4c05ccda3497.zip FreeBSD-src-18bf90d7da26a56d1f5713c0c4ad4c05ccda3497.tar.gz |
Allow access to the field if it is within the region size rounded up
to a multiple of the access byte width. This overcomes errors in the
AML often found in Toshiba laptops. These errors were allowed by
the Microsoft ASL compiler and interpreter. This will NOT be imported
by ACPI-CA so make the change on our local branch. File was already off
the vendor branch.
Submitted by: blaz
Original idea: Rick Richardson for Linux
Diffstat (limited to 'sys')
-rw-r--r-- | sys/contrib/dev/acpica/exfldio.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/contrib/dev/acpica/exfldio.c b/sys/contrib/dev/acpica/exfldio.c index 1cc535d..1eda818 100644 --- a/sys/contrib/dev/acpica/exfldio.c +++ b/sys/contrib/dev/acpica/exfldio.c @@ -220,6 +220,25 @@ AcpiExSetupRegion ( FieldDatumByteOffset, ObjDesc->CommonField.AccessByteWidth, RgnDesc->Region.Node->Name.Ascii, 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); } |