According to ACPICA User Guide and Programmer Reference, the read data must

be zero extended to fill the 32-bit return value even if the bit width of
the port is less than 32.
This commit is contained in:
jkim 2010-07-13 02:45:44 +00:00
parent 14d1adbf2c
commit 68aeab54db

View File

@ -71,16 +71,13 @@ AcpiOsReadPort(ACPI_IO_ADDRESS InPort, UINT32 *Value, UINT32 Width)
switch (Width) {
case 8:
*(u_int8_t *)Value = bus_space_read_1(ACPI_BUS_SPACE_IO,
ACPI_BUS_HANDLE, InPort);
*Value = bus_space_read_1(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, InPort);
break;
case 16:
*(u_int16_t *)Value = bus_space_read_2(ACPI_BUS_SPACE_IO,
ACPI_BUS_HANDLE, InPort);
*Value = bus_space_read_2(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, InPort);
break;
case 32:
*(u_int32_t *)Value = bus_space_read_4(ACPI_BUS_SPACE_IO,
ACPI_BUS_HANDLE, InPort);
*Value = bus_space_read_4(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, InPort);
break;
default:
/* debug trap goes here */