svn commit: r210129 - head/sys/dev/acpica/Osd

Jung-uk Kim jkim at FreeBSD.org
Thu Jul 15 17:11:50 UTC 2010


Author: jkim
Date: Thu Jul 15 17:11:49 2010
New Revision: 210129
URL: http://svn.freebsd.org/changeset/base/210129

Log:
  - 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]

Modified:
  head/sys/dev/acpica/Osd/OsdMemory.c

Modified: head/sys/dev/acpica/Osd/OsdMemory.c
==============================================================================
--- head/sys/dev/acpica/Osd/OsdMemory.c	Thu Jul 15 17:07:12 2010	(r210128)
+++ head/sys/dev/acpica/Osd/OsdMemory.c	Thu Jul 15 17:11:49 2010	(r210129)
@@ -103,19 +103,13 @@ AcpiOsReadMemory(ACPI_PHYSICAL_ADDRESS A
 
     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 
 
     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;
     }
 


More information about the svn-src-all mailing list