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/mips copy from lib/libc/arch/mips/gen



details:   https://anonhg.NetBSD.org/src/rev/6abc49abe7c3
branches:  trunk
changeset: 504340:6abc49abe7c3
user:      cgd <cgd%NetBSD.org@localhost>
date:      Tue Feb 27 19:45:26 2001 +0000

description:
copy from lib/libc/arch/mips/gen

diffstat:

 sys/lib/libkern/arch/mips/byte_swap_2.S |  24 +++++++++++++++++-------
 sys/lib/libkern/arch/mips/byte_swap_4.S |  24 +++++++++++++++++-------
 2 files changed, 34 insertions(+), 14 deletions(-)

diffs (100 lines):

diff -r b8d3f416afdb -r 6abc49abe7c3 sys/lib/libkern/arch/mips/byte_swap_2.S
--- a/sys/lib/libkern/arch/mips/byte_swap_2.S   Tue Feb 27 19:44:54 2001 +0000
+++ b/sys/lib/libkern/arch/mips/byte_swap_2.S   Tue Feb 27 19:45:26 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: byte_swap_2.S,v 1.3 1999/04/20 00:45:24 simonb Exp $   */
+/*     $NetBSD: byte_swap_2.S,v 1.4 2001/02/27 19:45:26 cgd Exp $      */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -40,15 +40,24 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
        ASMSTR("from: @(#)htons.s       8.1 (Berkeley) 6/4/93")
-       ASMSTR("$NetBSD: byte_swap_2.S,v 1.3 1999/04/20 00:45:24 simonb Exp $")
+       ASMSTR("$NetBSD: byte_swap_2.S,v 1.4 2001/02/27 19:45:26 cgd Exp $")
 #endif /* LIBC_SCCS and not lint */
 
-#if 0 && defined(ABICALLS)
+#undef _LOCORE
+#define _LOCORE                /* XXX not really, just assembly-code source */
+#include <machine/endian.h>
+
+#ifdef _KERNEL
+#define        BSWAP16_NAME    bswap16
+#else
+#ifdef ABICALLS
        .abicalls
 #endif
+#define        BSWAP16_NAME    __bswap16
+#endif
 
-NLEAF(bswap16)
-#ifdef MIPSEL
+NLEAF(BSWAP16_NAME)
+#if BYTE_ORDER == LITTLE_ENDIAN
 ALEAF(htons)
 ALEAF(ntohs)
 #endif
@@ -58,8 +67,9 @@
        and     v1, v1, 0xff00
        or      v0, v0, v1
        j       ra
-END(bswap16)
-#ifdef MIPSEB
+END(BSWAP16_NAME)
+
+#if BYTE_ORDER == BIG_ENDIAN
 NLEAF(htons)
 ALEAF(ntohs)
        move    v0, a0
diff -r b8d3f416afdb -r 6abc49abe7c3 sys/lib/libkern/arch/mips/byte_swap_4.S
--- a/sys/lib/libkern/arch/mips/byte_swap_4.S   Tue Feb 27 19:44:54 2001 +0000
+++ b/sys/lib/libkern/arch/mips/byte_swap_4.S   Tue Feb 27 19:45:26 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: byte_swap_4.S,v 1.4 1999/04/20 00:45:24 simonb Exp $   */
+/*     $NetBSD: byte_swap_4.S,v 1.5 2001/02/27 19:45:26 cgd Exp $      */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -40,15 +40,24 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
        ASMSTR("from: @(#)htonl.s       8.1 (Berkeley) 6/4/93")
-       ASMSTR("$NetBSD: byte_swap_4.S,v 1.4 1999/04/20 00:45:24 simonb Exp $")
+       ASMSTR("$NetBSD: byte_swap_4.S,v 1.5 2001/02/27 19:45:26 cgd Exp $")
 #endif /* LIBC_SCCS and not lint */
 
-#if 0 && defined(ABICALLS)
+#undef _LOCORE
+#define _LOCORE                /* XXX not really, just assembly-code source */
+#include <machine/endian.h>
+
+#ifdef _KERNEL
+#define        BSWAP32_NAME    bswap32
+#else
+#ifdef ABICALLS
        .abicalls
 #endif
+#define        BSWAP32_NAME    __bswap32
+#endif
 
-NLEAF(bswap32)                         # a0 = 0x11223344, return 0x44332211
-#ifdef MIPSEL
+NLEAF(BSWAP32_NAME)                    # a0 = 0x11223344, return 0x44332211
+#if BYTE_ORDER == LITTLE_ENDIAN
 ALEAF(htonl)                           # a0 = 0x11223344, return 0x44332211
 ALEAF(ntohl)
 #endif
@@ -62,8 +71,9 @@
        and     v1, v1, 0xff00          # v1 = 0x00002200
        or      v0, v0, v1
        j       ra
-END(bswap32)
-#ifdef MIPSEB
+END(BSWAP32_NAME)
+
+#if BYTE_ORDER == BIG_ENDIAN
 NLEAF(htonl)                           # a0 = 0x11223344, return 0x44332211
 ALEAF(ntohl)
        move    v0, a0



Home | Main Index | Thread Index | Old Index