Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/lib/libkern/arch/sh3 support "big endian", too.



details:   https://anonhg.NetBSD.org/src/rev/1ba16884d613
branches:  trunk
changeset: 495090:1ba16884d613
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Jul 21 11:19:10 2000 +0000

description:
support "big endian", too.

diffstat:

 sys/lib/libkern/arch/sh3/byte_swap_2.S |  14 +++++++++++---
 sys/lib/libkern/arch/sh3/byte_swap_4.S |  11 ++++++++++-
 2 files changed, 21 insertions(+), 4 deletions(-)

diffs (60 lines):

diff -r f976251da4ae -r 1ba16884d613 sys/lib/libkern/arch/sh3/byte_swap_2.S
--- a/sys/lib/libkern/arch/sh3/byte_swap_2.S    Fri Jul 21 08:08:38 2000 +0000
+++ b/sys/lib/libkern/arch/sh3/byte_swap_2.S    Fri Jul 21 11:19:10 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: byte_swap_2.S,v 1.1 1999/09/13 10:31:37 itojun Exp $   */
+/*     $NetBSD: byte_swap_2.S,v 1.2 2000/07/21 11:19:10 msaitoh Exp $  */
 
 /*-
  * Copyright (C) 1999 SHIMIZU Ryo.  All rights reserved.
@@ -27,10 +27,18 @@
  */
 
 #include <machine/asm.h>
+#include <machine/endian.h>
 
 ENTRY(bswap16)
+#if BYTE_ORDER == LITTLE_ENDIAN
 ALTENTRY(ntohs)
 ALTENTRY(htons)
+#endif
        rts
-       swap.b  r4,r0
-
+       swap.b  r4, r0
+#if BYTE_ORDER == BIG_ENDIAN
+ALTENTRY(ntohs)
+ALTENTRY(htons)
+#endif
+       rts
+       mov     r4, r0
diff -r f976251da4ae -r 1ba16884d613 sys/lib/libkern/arch/sh3/byte_swap_4.S
--- a/sys/lib/libkern/arch/sh3/byte_swap_4.S    Fri Jul 21 08:08:38 2000 +0000
+++ b/sys/lib/libkern/arch/sh3/byte_swap_4.S    Fri Jul 21 11:19:10 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: byte_swap_4.S,v 1.1 1999/09/13 10:31:37 itojun Exp $   */
+/*     $NetBSD: byte_swap_4.S,v 1.2 2000/07/21 11:19:10 msaitoh Exp $  */
 
 /*-
  * Copyright (C) 1999 SHIMIZU Ryo.  All rights reserved.
@@ -27,11 +27,20 @@
  */
 
 #include <machine/asm.h>
+#include <machine/endian.h>
 
 ENTRY(bswap32)
+#if BYTE_ORDER == LITTLE_ENDIAN
 ALTENTRY(ntohl)
 ALTENTRY(htonl)
+#endif
        swap.b  r4,r0   
        swap.w  r0,r0
        rts
        swap.b  r0,r0
+#if BYTE_ORDER == BIG_ENDIAN
+ALTENTRY(ntohl)
+ALTENTRY(htonl)
+#endif
+       rts
+       mov     r4, r0



Home | Main Index | Thread Index | Old Index