lib/libc/aarch64/string: add bcopy & bzero wrapper

This patch enabled usage of SIMD enhanced functions to implement
bcopy and bzero.

Tested by:	fuz (exprun)
Reviewed by:	fuz, emaste
Sponsored by:	Google LLC (GSoC 2024)
PR:		281175
Differential Revision: https://reviews.freebsd.org/D46459
This commit is contained in:
Getz Mikalsen 2024-08-28 15:13:45 +02:00 committed by Robert Clausecker
parent 3863fec1ce
commit 79e01e7e64
3 changed files with 31 additions and 1 deletions

View file

@ -30,7 +30,9 @@ MDSRCS+= \
memccpy.S \
strncat.c \
strlcat.c \
strlen.S
strlen.S \
bcopy.c \
bzero.c
#
# Add the above functions. Generate an asm file that includes the needed

View file

@ -0,0 +1,14 @@
/*-
* Public domain.
*/
#include <string.h>
#undef bcopy /* _FORTIFY_SOURCE */
void
bcopy(const void *src, void *dst, size_t len)
{
memmove(dst, src, len);
}

View file

@ -0,0 +1,14 @@
/*-
* Public domain.
*/
#include <string.h>
#undef bzero /* _FORTIFY_SOURCE */
void
bzero(void *b, size_t len)
{
memset(b, 0, len);
}