Source-Changes-HG archive

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

[src/trunk]: src/common/lib/libc/arch/arm/string No need to include namespace...



details:   https://anonhg.NetBSD.org/src/rev/5b87a30a5e49
branches:  trunk
changeset: 820674:5b87a30a5e49
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jan 13 13:14:54 2017 +0000

description:
No need to include namespace.h; no other assembly code does.

diffstat:

 common/lib/libc/arch/arm/string/strcpy_arm.S   |  12 ++++--------
 common/lib/libc/arch/arm/string/strcpy_naive.S |  15 +++++++--------
 common/lib/libc/arch/arm/string/strcpy_thumb.S |  15 +++++++--------
 common/lib/libc/arch/arm/string/strlcat.S      |   3 +--
 4 files changed, 19 insertions(+), 26 deletions(-)

diffs (163 lines):

diff -r 2d9b8feefe55 -r 5b87a30a5e49 common/lib/libc/arch/arm/string/strcpy_arm.S
--- a/common/lib/libc/arch/arm/string/strcpy_arm.S      Fri Jan 13 13:01:13 2017 +0000
+++ b/common/lib/libc/arch/arm/string/strcpy_arm.S      Fri Jan 13 13:14:54 2017 +0000
@@ -29,21 +29,17 @@
 
 #include <machine/asm.h>
 
-RCSID("$NetBSD: strcpy_arm.S,v 1.3 2013/08/11 04:56:32 matt Exp $")
+RCSID("$NetBSD: strcpy_arm.S,v 1.4 2017/01/13 13:14:54 christos Exp $")
 
 #ifdef STRLCPY
 #ifdef _LIBC
 WEAK_ALIAS(strlcpy, _strlcpy)
 #endif
-#define        FUNCNAME        strlcpy
+#define        FUNCNAME        _strlcpy
 #elif defined(STRNCPY)
-#define        FUNCNAME        strncpy
+#define        FUNCNAME        _strncpy
 #else
-#define        FUNCNAME        strcpy
-#endif
-
-#ifdef _LIBC
-#include "namespace.h"
+#define        FUNCNAME        _strcpy
 #endif
 
 #ifdef __ARMEL__
diff -r 2d9b8feefe55 -r 5b87a30a5e49 common/lib/libc/arch/arm/string/strcpy_naive.S
--- a/common/lib/libc/arch/arm/string/strcpy_naive.S    Fri Jan 13 13:01:13 2017 +0000
+++ b/common/lib/libc/arch/arm/string/strcpy_naive.S    Fri Jan 13 13:14:54 2017 +0000
@@ -28,13 +28,12 @@
  */
 #include <machine/asm.h>
 
-RCSID("$NetBSD: strcpy_naive.S,v 1.4 2013/08/20 21:37:39 matt Exp $")
+RCSID("$NetBSD: strcpy_naive.S,v 1.5 2017/01/13 13:14:54 christos Exp $")
 
 #ifdef _LIBC
 #ifdef STRLCPY
 WEAK_ALIAS(strlcpy, _strlcpy)           
 #endif
-#include "namespace.h"
 #endif
 
 /*
@@ -44,7 +43,7 @@
 
 #if defined(STRLCPY)
 /* LINTSTUB: size_t strlcpy(char *, const char *, size_t) */
-ENTRY(strlcpy)
+ENTRY(_strlcpy)
        add     ip, r1, #1              /* save src pointer (+ NUL) */
        subs    r2, r2, #1              /* make sure there's room for a NUL */
        blt     3f                      /*   no room, do the strlen */
@@ -63,10 +62,10 @@
        bne     3b                      /*   no, get next byte */
 4:     sub     r0, r1, ip              /* return length of src string */
        RET
-END(strlcpy)
+END(_strlcpy)
 #elif defined(STRNCPY)
 /* LINTSTUB: char * strncpy(char *, const char *, size_t) */
-ENTRY(strncpy)
+ENTRY(_strncpy)
        mov     ip, r0                  /* we want to preserve r0 */
        add     r2, r2, r0              /* get end of dst buffer */
 1:     cmp     ip, r2                  /* are at the end of dst already? */
@@ -79,15 +78,15 @@
        strblt  r3, [ip], #1            /*   no, write a NUL */
        blt     2b                      /*       until dst is filled */
 3:     RET                             /* return dst pointer */
-END(strncpy)
+END(_strncpy)
 #else
 /* LINTSTUB: char * strcpy(char *, const char *) */
-ENTRY(strcpy)
+ENTRY(_strcpy)
        mov     ip, r0                  /* we want to preserve r0 */
 1:     ldrb    r3, [r1], #1            /* read a byte */
        strb    r3, [ip], #1            /* write a byte */
        teq     r3, #0                  /* was it a NUL? */
        bne     1b                      /*   no, try next byte */
        RET                             /* return dst pointer */
-END(strcpy)
+END(_strcpy)
 #endif
diff -r 2d9b8feefe55 -r 5b87a30a5e49 common/lib/libc/arch/arm/string/strcpy_thumb.S
--- a/common/lib/libc/arch/arm/string/strcpy_thumb.S    Fri Jan 13 13:01:13 2017 +0000
+++ b/common/lib/libc/arch/arm/string/strcpy_thumb.S    Fri Jan 13 13:14:54 2017 +0000
@@ -28,13 +28,12 @@
  */
 #include <machine/asm.h>
 
-RCSID("$NetBSD: strcpy_thumb.S,v 1.1 2013/08/20 21:32:50 matt Exp $")
+RCSID("$NetBSD: strcpy_thumb.S,v 1.2 2017/01/13 13:14:54 christos Exp $")
 
 #ifdef _LIBC
 #ifdef STRLCPY
 WEAK_ALIAS(strlcpy, _strlcpy)           
 #endif
-#include "namespace.h"
 #endif
 
 /*
@@ -44,7 +43,7 @@
 
 #if defined(STRLCPY)
 /* LINTSTUB: size_t strlcpy(char *, const char *, size_t) */
-ENTRY(strlcpy)
+ENTRY(_strlcpy)
        adds    r3, r1, #1              /* save src pointer (+ NUL) */
        subs    r2, r2, #1              /* make sure there's room for a NUL */
        blt     3f                      /*   no room, do the strlen */
@@ -66,10 +65,10 @@
        bne     3b                      /*   no, get next byte */
 4:     subs    r0, r1, r3              /* return length of src string */
        RET
-END(strlcpy)
+END(_strlcpy)
 #elif defined(STRNCPY)
 /* LINTSTUB: char * strncpy(char *, const char *, size_t) */
-ENTRY(strncpy)
+ENTRY(_strncpy)
        mov     ip, r0                  /* we want to preserve r0 */
        adds    r2, r2, r0              /* get end of dst buffer */
        subs    r1, r1, r0              /* allows to only increment once */
@@ -87,10 +86,10 @@
        b       2b                      /* until dst is filled */
 3:     mov     r0, ip                  /* return dst pointer */
        RET
-END(strncpy)
+END(_strncpy)
 #else
 /* LINTSTUB: char * strcpy(char *, const char *) */
-ENTRY(strcpy)
+ENTRY(_strcpy)
        subs    r2, r0, r1              /* we want to preserve r0 */
 1:     ldrb    r3, [r1]                /* read a byte */
        strb    r3, [r2, r1]            /* write a byte */
@@ -98,5 +97,5 @@
        cmp     r3, #0                  /* was it a NUL? */
        bne     1b                      /*   no, try next byte */
        RET                             /* return dst pointer */
-END(strcpy)
+END(_strcpy)
 #endif
diff -r 2d9b8feefe55 -r 5b87a30a5e49 common/lib/libc/arch/arm/string/strlcat.S
--- a/common/lib/libc/arch/arm/string/strlcat.S Fri Jan 13 13:01:13 2017 +0000
+++ b/common/lib/libc/arch/arm/string/strlcat.S Fri Jan 13 13:14:54 2017 +0000
@@ -1,10 +1,9 @@
-/* $NetBSD: strlcat.S,v 1.2 2013/08/20 21:08:54 matt Exp $ */
+/* $NetBSD: strlcat.S,v 1.3 2017/01/13 13:14:54 christos Exp $ */
 
 #include <machine/asm.h>
 
 #ifdef _LIBC
 WEAK_ALIAS(strlcat, _strlcat)
-#include "namespace.h"
 #endif
 
 #if defined(_STANDALONE) && 0  /* arm version is always smaller */



Home | Main Index | Thread Index | Old Index