- AcpiOsReadMemory() needs similar fixes as r209965. [1]

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.
- Remove 64-bit read/write from AcpiOsReadMemory() and AcpiOsWriteMemory().
These functions do not support 64-bit access (yet).  Clean up style nits
and unnecessary bit masking while I am here.

Reported by:	Liu, Jinsong (jinsong dot liu at intel dot com) via
		Lin Ming (ming dot m dot lin at intel dot com) [1]
This commit is contained in:
Jung-uk Kim 2010-07-15 17:11:49 +00:00
parent 068c7ecd98
commit 89339b38d8

View File

@ -103,19 +103,13 @@ AcpiOsReadMemory(ACPI_PHYSICAL_ADDRESS Address, UINT32 *Value, UINT32 Width)
switch (Width) {
case 8:
*(u_int8_t *)Value = (*(volatile u_int8_t *)LogicalAddress);
*Value = *(volatile uint8_t *)LogicalAddress;
break;
case 16:
*(u_int16_t *)Value = (*(volatile u_int16_t *)LogicalAddress);
*Value = *(volatile uint16_t *)LogicalAddress;
break;
case 32:
*(u_int32_t *)Value = (*(volatile u_int32_t *)LogicalAddress);
break;
case 64:
*(u_int64_t *)Value = (*(volatile u_int64_t *)LogicalAddress);
break;
default:
/* debug trap goes here */
*Value = *(volatile uint32_t *)LogicalAddress;
break;
}
@ -135,19 +129,13 @@ AcpiOsWriteMemory(ACPI_PHYSICAL_ADDRESS Address, UINT32 Value, UINT32 Width)
switch (Width) {
case 8:
(*(volatile u_int8_t *)LogicalAddress) = Value & 0xff;
*(volatile uint8_t *)LogicalAddress = Value;
break;
case 16:
(*(volatile u_int16_t *)LogicalAddress) = Value & 0xffff;
*(volatile uint16_t *)LogicalAddress = Value;
break;
case 32:
(*(volatile u_int32_t *)LogicalAddress) = Value & 0xffffffff;
break;
case 64:
(*(volatile u_int64_t *)LogicalAddress) = Value;
break;
default:
/* debug trap goes here */
*(volatile uint32_t *)LogicalAddress = Value;
break;
}