Re: [PATCH 13/19] LoongArch: Add some library functions

From
Arnd Bergmann <arnd@arndb.de>
Date
2021-07-06 11:00:46
Reply to
Arnd Bergmann, 2021-07-06
On Tue, Jul 6, 2021 at 6:18 AM Huacai Chen [off-list ref] wrote:
quoted hunk ↗ jump to hunk

+/*
+ * long __strncpy_from_user(char *to, const char *from, long len)
+ *
+ * a0: to
+ * a1: from
+ * a2: len
+ */
+SYM_FUNC_START(__strncpy_from_user)
+       move    a3, zero
+
I doubt this is better than the C version in lib/strncpy_from_user.c
quoted hunk ↗ jump to hunk
diff --git a/arch/loongarch/lib/strnlen_user.S b/arch/loongarch/lib/strnlen_user.S
new file mode 100644
index 000000000000..9288a5ad294e
--- /dev/null
+++ b/arch/loongarch/lib/strnlen_user.S
@@ -0,0 +1,47 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020-2021 Loongson Technology Corporation Limited
+ */
Same here.

Have you done any measurement to show that the asm version actually helps
here? If not, just use the generic version.


       Arnd
Thread (110 messages) 110 messages, 12 authors, last reply 2021-08-27
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help