Module Name:    src
Committed By:   msaitoh
Date:           Fri Feb  7 15:49:40 UTC 2014

Modified Files:
        src/sys/arch/mips/atheros/dev: com_arbus.c

Log Message:
Check _BYTE_ORDER.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mips/atheros/dev/com_arbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/atheros/dev/com_arbus.c
diff -u src/sys/arch/mips/atheros/dev/com_arbus.c:1.10 src/sys/arch/mips/atheros/dev/com_arbus.c:1.11
--- src/sys/arch/mips/atheros/dev/com_arbus.c:1.10	Thu Jul  7 05:06:44 2011
+++ src/sys/arch/mips/atheros/dev/com_arbus.c	Fri Feb  7 15:49:40 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: com_arbus.c,v 1.10 2011/07/07 05:06:44 matt Exp $ */
+/* $NetBSD: com_arbus.c,v 1.11 2014/02/07 15:49:40 msaitoh Exp $ */
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
  * Copyright (c) 2006 Garrett D'Amore.
@@ -101,7 +101,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com_arbus.c,v 1.10 2011/07/07 05:06:44 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_arbus.c,v 1.11 2014/02/07 15:49:40 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -223,10 +223,15 @@ com_arbus_attach(device_t parent, device
 void
 com_arbus_initmap(struct com_regs *regsp)
 {
+#if _BYTE_ORDER == _BIG_ENDIAN
+	int off = 3;
+#else
+	int off = 0;
+#endif;
 
 	/* rewrite the map to shift for alignment */
 	for (size_t i = 0; i < __arraycount(regsp->cr_map); i++) {
-		regsp->cr_map[i] = (com_std_map[i] * 4) + 3;
+		regsp->cr_map[i] = (com_std_map[i] * 4) + off;
 	}
 }
 

Reply via email to