diff options
author | njl <njl@FreeBSD.org> | 2005-02-23 03:20:00 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2005-02-23 03:20:00 +0000 |
commit | c07d5a705db7d468fa898d5665005efb99543bfd (patch) | |
tree | 4f70fabc1a3350ba746c30a132e967e86c97aa92 /sys/dev/acpica | |
parent | d838320b8a048866309d45ac98ad4feb0fc10ae2 (diff) | |
download | FreeBSD-src-c07d5a705db7d468fa898d5665005efb99543bfd.zip FreeBSD-src-c07d5a705db7d468fa898d5665005efb99543bfd.tar.gz |
If a register width is less than 8, assume the BIOS author thought it was
in units of bytes and adjust accordingly. This is found at least on the
Sony PCG-505BX.
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r-- | sys/dev/acpica/acpi.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 57f663e..2b48b52 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1095,6 +1095,18 @@ acpi_bus_alloc_gas(device_t dev, int *type, int *rid, ACPI_GENERIC_ADDRESS *gas, return (EOPNOTSUPP); } + /* + * If the register width is less than 4, assume the BIOS author made a + * mistake and assumed the width is in units of bytes not bits. Ugh. + */ + switch (gas->RegisterBitWidth) { + case 1: + case 2: + case 4: + gas->RegisterBitWidth *= 8; + break; + } + /* Validate the address after we're sure we support the space. */ if (!ACPI_VALID_ADDRESS(gas->Address) || gas->RegisterBitWidth < 8) return (EINVAL); |