Page MenuHomeFreeBSD

D46417.id142370.diff
No OneTemporary

D46417.id142370.diff

diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc
--- a/lib/libc/aarch64/string/Makefile.inc
+++ b/lib/libc/aarch64/string/Makefile.inc
@@ -20,6 +20,8 @@
strnlen \
strrchr
+MDSRCS+= strcat.S
+
#
# Add the above functions. Generate an asm file that includes the needed
# Arm Optimized Routines file defining the function name to the libc name.
diff --git a/lib/libc/aarch64/string/strcat.S b/lib/libc/aarch64/string/strcat.S
new file mode 100644
--- /dev/null
+++ b/lib/libc/aarch64/string/strcat.S
@@ -0,0 +1,29 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2024 Getz Mikalsen <getz@FreeBSD.org>
+*/
+
+#include <machine/asm.h>
+
+ .weak strcat
+ .set strcat, __strcat
+ .text
+
+ENTRY(__strcat)
+ stp x29, x30, [sp, #-16]!
+ str x19, [sp, #-16]! // store preserved registers
+
+ mov x19, x0 // stash dest for later
+ bl strlen // strlen(dest)
+
+ add x0, x19, x0 // dest + (strlen(dest))
+ bl stpcpy // stpcpy(dest + strlen(dest), src)
+
+ mov x0, x19 // return dest
+
+ ldr x19, [sp], #16 // load preserved registers
+ ldp x29, x30, [sp], #16
+ ret
+
+END(__strcat)

File Metadata

Mime Type
text/plain
Expires
Tue, Feb 24, 9:51 AM (10 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28971879
Default Alt Text
D46417.id142370.diff (1 KB)

Event Timeline