PERFORCE change 48115 for review

Peter Wemm peter at FreeBSD.org
Wed Mar 3 22:34:50 PST 2004


http://perforce.freebsd.org/chv.cgi?CH=48115

Change 48115 by peter at peter_daintree on 2004/03/03 22:34:36

	IFC @48108

Affected files ...

.. //depot/projects/hammer/sys/contrib/dev/acpica/acfreebsd.h#8 integrate
.. //depot/projects/hammer/sys/dev/acpica/acpi_ec.c#15 integrate

Differences ...

==== //depot/projects/hammer/sys/contrib/dev/acpica/acfreebsd.h#8 (text+ko) ====

@@ -119,10 +119,17 @@
 
 /*
  * Some systems' ASL may have problems because they look for names 
- * of Microsoft operating systems.  To override this, set hw.acpi.os_name
- * to the appropriate string.
+ * of Microsoft operating systems.  We default to "Microsoft Windows NT"
+ * (aka NT5 or Windows 2000) because it is most similar to our
+ * implementation and also most prevalent.
+ *
+ * To override this, set hw.acpi.os_name to the appropriate string.
  */
+#ifndef ACPICA_PEDANTIC
+#define ACPI_OS_NAME                "Microsoft Windows NT"
+#else
 #define ACPI_OS_NAME                "FreeBSD"
+#endif
 
 /* FreeBSD uses GCC */
 

==== //depot/projects/hammer/sys/dev/acpica/acpi_ec.c#15 (text+ko) ====

@@ -25,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.43 2004/03/03 18:34:42 njl Exp $
+ *	$FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.44 2004/03/04 05:58:50 njl Exp $
  */
 /******************************************************************************
  *
@@ -137,7 +137,7 @@
  *****************************************************************************/
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.43 2004/03/03 18:34:42 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.44 2004/03/04 05:58:50 njl Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
@@ -713,28 +713,33 @@
 	       ACPI_INTEGER *Value, void *Context, void *RegionContext)
 {
     struct acpi_ec_softc	*sc = (struct acpi_ec_softc *)Context;
-    ACPI_STATUS			Status = AE_OK;
+    ACPI_STATUS			Status;
     UINT8			EcAddr, EcData;
     int				i;
 
     ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, (UINT32)Address);
 
-    if (Address > 0xFF || width % 8 != 0 || Value == NULL || Context == NULL)
+    if (width % 8 != 0 || Value == NULL || Context == NULL)
 	return_ACPI_STATUS (AE_BAD_PARAMETER);
+    if (Address + (width / 8) - 1 > 0xFF)
+	return_ACPI_STATUS (AE_BAD_ADDRESS);
 
-    /*
-     * Perform the transaction.
-     */
+    if (Function == ACPI_READ)
+	*Value = 0;
     EcAddr = Address;
-    for (i = 0; i < width; i += 8) {
+    Status = AE_ERROR;
+
+    /* Perform the transaction(s), based on width. */
+    for (i = 0; i < width; i += 8, EcAddr++) {
 	Status = EcLock(sc);
 	if (ACPI_FAILURE(Status))
-	    return (Status);
+	    break;
 
 	switch (Function) {
 	case ACPI_READ:
-	    EcData = 0;
 	    Status = EcRead(sc, EcAddr, &EcData);
+	    if (ACPI_SUCCESS(Status))
+		*Value |= ((ACPI_INTEGER)EcData) << i;
 	    break;
 	case ACPI_WRITE:
 	    EcData = (UINT8)((*Value) >> i);
@@ -746,15 +751,11 @@
 	    Status = AE_BAD_PARAMETER;
 	    break;
 	}
-
 	EcUnlock(sc);
 	if (ACPI_FAILURE(Status))
-	    return (Status);
+	    break;
+    }
 
-	*Value |= (ACPI_INTEGER)EcData << i;
-	if (++EcAddr == 0)
-	    return_ACPI_STATUS (AE_BAD_PARAMETER);
-    }
     return_ACPI_STATUS (Status);
 }
 


More information about the p4-projects mailing list