Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/arch/mips/gen pull up <machine/endian.h> and use BY...



details:   https://anonhg.NetBSD.org/src/rev/57b1f84b5cea
branches:  trunk
changeset: 504337:57b1f84b5cea
user:      cgd <cgd%NetBSD.org@localhost>
date:      Tue Feb 27 18:59:16 2001 +0000

description:
pull up <machine/endian.h> and use BYTE_ORDER to decide endianness,
rather than MIPSEL and MIPSEB definitions.

diffstat:

 lib/libc/arch/mips/gen/byte_swap_2.S |  12 ++++++++----
 lib/libc/arch/mips/gen/byte_swap_4.S |  13 +++++++++----
 2 files changed, 17 insertions(+), 8 deletions(-)

diffs (80 lines):

diff -r 71af35702944 -r 57b1f84b5cea lib/libc/arch/mips/gen/byte_swap_2.S
--- a/lib/libc/arch/mips/gen/byte_swap_2.S      Tue Feb 27 18:33:26 2001 +0000
+++ b/lib/libc/arch/mips/gen/byte_swap_2.S      Tue Feb 27 18:59:16 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: byte_swap_2.S,v 1.1 1999/01/15 13:31:19 bouyer Exp $   */
+/*     $NetBSD: byte_swap_2.S,v 1.2 2001/02/27 18:59:16 cgd Exp $      */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -40,15 +40,18 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
        ASMSTR("from: @(#)htons.s       8.1 (Berkeley) 6/4/93")
-       ASMSTR("$NetBSD: byte_swap_2.S,v 1.1 1999/01/15 13:31:19 bouyer Exp $")
+       ASMSTR("$NetBSD: byte_swap_2.S,v 1.2 2001/02/27 18:59:16 cgd Exp $")
 #endif /* LIBC_SCCS and not lint */
 
+#define _LOCORE                /* XXX not really, just assembly-code source */
+#include <machine/endian.h>
+
 #ifdef ABICALLS
        .abicalls
 #endif
 
 NLEAF(__bswap16)
-#ifdef MIPSEL
+#if BYTE_ORDER == LITTLE_ENDIAN
 ALEAF(htons)
 ALEAF(ntohs)
 #endif
@@ -59,7 +62,8 @@
        or      v0, v0, v1
        j       ra
 END(__bswap16)
-#ifdef MIPSEB
+
+#if BYTE_ORDER == BIG_ENDIAN
 NLEAF(htons)
 ALEAF(ntohs)
        move    v0, a0
diff -r 71af35702944 -r 57b1f84b5cea lib/libc/arch/mips/gen/byte_swap_4.S
--- a/lib/libc/arch/mips/gen/byte_swap_4.S      Tue Feb 27 18:33:26 2001 +0000
+++ b/lib/libc/arch/mips/gen/byte_swap_4.S      Tue Feb 27 18:59:16 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: byte_swap_4.S,v 1.2 1999/01/18 04:32:49 castor Exp $   */
+/*     $NetBSD: byte_swap_4.S,v 1.3 2001/02/27 18:59:16 cgd Exp $      */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -40,14 +40,18 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
        ASMSTR("from: @(#)htonl.s       8.1 (Berkeley) 6/4/93")
-       ASMSTR("$NetBSD: byte_swap_4.S,v 1.2 1999/01/18 04:32:49 castor Exp $")
+       ASMSTR("$NetBSD: byte_swap_4.S,v 1.3 2001/02/27 18:59:16 cgd Exp $")
 #endif /* LIBC_SCCS and not lint */
+
+#define _LOCORE                /* XXX not really, just assembly-code source */
+#include <machine/endian.h>
+
 #ifdef ABICALLS
        .abicalls
 #endif
 
 NLEAF(__bswap32)                       # a0 = 0x11223344, return 0x44332211
-#ifdef MIPSEL
+#if BYTE_ORDER == LITTLE_ENDIAN
 ALEAF(htonl)                           # a0 = 0x11223344, return 0x44332211
 ALEAF(ntohl)
 #endif
@@ -62,7 +66,8 @@
        or      v0, v0, v1
        j       ra
 END(__bswap32)
-#ifdef MIPSEB
+
+#if BYTE_ORDER == BIG_ENDIAN
 NLEAF(htonl)                           # a0 = 0x11223344, return 0x44332211
 ALEAF(ntohl)
        move    v0, a0



Home | Main Index | Thread Index | Old Index