libc/riscv64: implement bcopy() and bzero() through memcpy() and memset()

This picks up the accelerated string functions written by
strajabot@.

Event:		Google Summer of Code 2024
MFC after:	1 month
MFC to:		stable/15
See also:	79e01e7e64
Approved by:	markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D53248
This commit is contained in:
Robert Clausecker 2025-10-21 20:55:41 +02:00
parent 39fef5b9fa
commit b5dbf3de56
3 changed files with 30 additions and 0 deletions

View file

@ -1,4 +1,6 @@
MDSRCS+= \
bcopy.c \
bzero.c \
memchr.S \
memcpy.S \
memset.S \

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);
}