mirror of
https://git.freebsd.org/src.git
synced 2026-01-12 06:54:03 +00:00
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:
parent
39fef5b9fa
commit
b5dbf3de56
3 changed files with 30 additions and 0 deletions
|
|
@ -1,4 +1,6 @@
|
|||
MDSRCS+= \
|
||||
bcopy.c \
|
||||
bzero.c \
|
||||
memchr.S \
|
||||
memcpy.S \
|
||||
memset.S \
|
||||
|
|
|
|||
14
lib/libc/riscv/string/bcopy.c
Normal file
14
lib/libc/riscv/string/bcopy.c
Normal 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);
|
||||
}
|
||||
14
lib/libc/riscv/string/bzero.c
Normal file
14
lib/libc/riscv/string/bzero.c
Normal 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);
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue