1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-14 14:55:41 +00:00

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.
This commit is contained in:
Nate Lawson 2005-02-23 03:20:00 +00:00
parent 0e5d513b50
commit 2fe912df6b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=142278

View File

@ -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);