Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jul 2010 02:45:44 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209965 - head/sys/dev/acpica/Osd
Message-ID:  <201007130245.o6D2ji8Q092101@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Tue Jul 13 02:45:44 2010
New Revision: 209965
URL: http://svn.freebsd.org/changeset/base/209965

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

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

Modified: head/sys/dev/acpica/Osd/OsdHardware.c
==============================================================================
--- head/sys/dev/acpica/Osd/OsdHardware.c	Tue Jul 13 02:45:17 2010	(r209964)
+++ head/sys/dev/acpica/Osd/OsdHardware.c	Tue Jul 13 02:45:44 2010	(r209965)
@@ -71,16 +71,13 @@ AcpiOsReadPort(ACPI_IO_ADDRESS InPort, U
 
     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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007130245.o6D2ji8Q092101>