This commit is contained in:
christos 2017-01-14 03:35:21 +00:00
parent 53daaf6b96
commit 8787f9ad9e
2 changed files with 19 additions and 8 deletions

View File

@ -29,19 +29,29 @@
#include <machine/asm.h>
RCSID("$NetBSD: strcpy_arm.S,v 1.5 2017/01/14 03:00:13 christos Exp $")
RCSID("$NetBSD: strcpy_arm.S,v 1.6 2017/01/14 03:35:21 christos Exp $")
#ifdef STRLCPY
#ifdef _LIBC
WEAK_ALIAS(strlcpy, _strlcpy)
#endif
#define FUNCNAME _strlcpy
# define FUNCNAME _strlcpy
# else
# define FUNCNAME strlcpy
# endif
#elif defined(STRNCPY)
# ifdef _LIBC
WEAK_ALIAS(strncpy, _strncpy)
#define FUNCNAME _strncpy
# define FUNCNAME _strncpy
# else
# define FUNCNAME strncpy
# endif
#else
# ifdef _LIBC
WEAK_ALIAS(strcpy, _strcpy)
#define FUNCNAME _strcpy
# define FUNCNAME _strcpy
# else
# define FUNCNAME strcpy
# endif
#endif
#ifdef __ARMEL__

View File

@ -28,11 +28,12 @@
*/
#include <machine/asm.h>
RCSID("$NetBSD: strcpy_naive.S,v 1.5 2017/01/13 13:14:54 christos Exp $")
RCSID("$NetBSD: strcpy_naive.S,v 1.6 2017/01/14 03:35:21 christos Exp $")
#ifdef _LIBC
#ifdef STRLCPY
WEAK_ALIAS(strlcpy, _strlcpy)
#define strlcpy _strlcpy
#endif
#endif
@ -43,7 +44,7 @@ WEAK_ALIAS(strlcpy, _strlcpy)
#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 */
@ -62,7 +63,7 @@ ENTRY(_strlcpy)
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)