summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/Osd
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2010-07-15 17:11:49 +0000
committerjkim <jkim@FreeBSD.org>2010-07-15 17:11:49 +0000
commit8ff80a5cd734b43ca7cec38791a10201fd553fc4 (patch)
tree7547d2539aa725ef56f76bab18972bba6e0c84d3 /sys/dev/acpica/Osd
parenta8d4e4b4148d3af2b75cf0de9fdcc8d96a0766b8 (diff)
downloadFreeBSD-src-8ff80a5cd734b43ca7cec38791a10201fd553fc4.zip
FreeBSD-src-8ff80a5cd734b43ca7cec38791a10201fd553fc4.tar.gz
- 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]
Diffstat (limited to 'sys/dev/acpica/Osd')
-rw-r--r--sys/dev/acpica/Osd/OsdMemory.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/sys/dev/acpica/Osd/OsdMemory.c b/sys/dev/acpica/Osd/OsdMemory.c
index 8ed7a90..573fa0e 100644
--- a/sys/dev/acpica/Osd/OsdMemory.c
+++ b/sys/dev/acpica/Osd/OsdMemory.c
@@ -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;
}
OpenPOWER on IntegriCloud