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 make these more amenable to being cop...



details:   https://anonhg.NetBSD.org/src/rev/b8d3f416afdb
branches:  trunk
changeset: 504339:b8d3f416afdb
user:      cgd <cgd%NetBSD.org@localhost>
date:      Tue Feb 27 19:44:54 2001 +0000

description:
make these more amenable to being copied into libkern.  (Gee, why wasn't
this done before?  it's not like it was hard...)

diffstat:

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

diffs (88 lines):

diff -r 8a1d56bde8f0 -r b8d3f416afdb lib/libc/arch/mips/gen/byte_swap_2.S
--- a/lib/libc/arch/mips/gen/byte_swap_2.S      Tue Feb 27 19:04:39 2001 +0000
+++ b/lib/libc/arch/mips/gen/byte_swap_2.S      Tue Feb 27 19:44:54 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: byte_swap_2.S,v 1.2 2001/02/27 18:59:16 cgd Exp $      */
+/*     $NetBSD: byte_swap_2.S,v 1.3 2001/02/27 19:44:54 cgd Exp $      */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -40,17 +40,23 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
        ASMSTR("from: @(#)htons.s       8.1 (Berkeley) 6/4/93")
-       ASMSTR("$NetBSD: byte_swap_2.S,v 1.2 2001/02/27 18:59:16 cgd Exp $")
+       ASMSTR("$NetBSD: byte_swap_2.S,v 1.3 2001/02/27 19:44:54 cgd Exp $")
 #endif /* LIBC_SCCS and not lint */
 
+#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)
+NLEAF(BSWAP16_NAME)
 #if BYTE_ORDER == LITTLE_ENDIAN
 ALEAF(htons)
 ALEAF(ntohs)
@@ -61,7 +67,7 @@
        and     v1, v1, 0xff00
        or      v0, v0, v1
        j       ra
-END(__bswap16)
+END(BSWAP16_NAME)
 
 #if BYTE_ORDER == BIG_ENDIAN
 NLEAF(htons)
diff -r 8a1d56bde8f0 -r b8d3f416afdb lib/libc/arch/mips/gen/byte_swap_4.S
--- a/lib/libc/arch/mips/gen/byte_swap_4.S      Tue Feb 27 19:04:39 2001 +0000
+++ b/lib/libc/arch/mips/gen/byte_swap_4.S      Tue Feb 27 19:44:54 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: byte_swap_4.S,v 1.3 2001/02/27 18:59:16 cgd Exp $      */
+/*     $NetBSD: byte_swap_4.S,v 1.4 2001/02/27 19:44:54 cgd Exp $      */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -40,17 +40,23 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
        ASMSTR("from: @(#)htonl.s       8.1 (Berkeley) 6/4/93")
-       ASMSTR("$NetBSD: byte_swap_4.S,v 1.3 2001/02/27 18:59:16 cgd Exp $")
+       ASMSTR("$NetBSD: byte_swap_4.S,v 1.4 2001/02/27 19:44:54 cgd Exp $")
 #endif /* LIBC_SCCS and not lint */
 
+#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
+NLEAF(BSWAP32_NAME)                    # a0 = 0x11223344, return 0x44332211
 #if BYTE_ORDER == LITTLE_ENDIAN
 ALEAF(htonl)                           # a0 = 0x11223344, return 0x44332211
 ALEAF(ntohl)
@@ -65,7 +71,7 @@
        and     v1, v1, 0xff00          # v1 = 0x00002200
        or      v0, v0, v1
        j       ra
-END(__bswap32)
+END(BSWAP32_NAME)
 
 #if BYTE_ORDER == BIG_ENDIAN
 NLEAF(htonl)                           # a0 = 0x11223344, return 0x44332211



Home | Main Index | Thread Index | Old Index