Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mips/atheros/dev Check _BYTE_ORDER.
details: https://anonhg.NetBSD.org/src/rev/7553228ec53b
branches: trunk
changeset: 326617:7553228ec53b
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Fri Feb 07 15:49:40 2014 +0000
description:
Check _BYTE_ORDER.
diffstat:
sys/arch/mips/atheros/dev/com_arbus.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diffs (35 lines):
diff -r 9d6b9429bda9 -r 7553228ec53b sys/arch/mips/atheros/dev/com_arbus.c
--- a/sys/arch/mips/atheros/dev/com_arbus.c Fri Feb 07 15:29:20 2014 +0000
+++ b/sys/arch/mips/atheros/dev/com_arbus.c Fri Feb 07 15:49:40 2014 +0000
@@ -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 @@
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;
}
}
Home |
Main Index |
Thread Index |
Old Index