diff options
author | Matteo Croce <mcroce@microsoft.com> | 2022-03-30 20:07:14 +0800 |
---|---|---|
committer | Guo Ren <guoren@linux.alibaba.com> | 2022-04-18 21:23:55 +0800 |
commit | e4df2d5e852a7d24df3672ae9951eb79e179be08 (patch) | |
tree | 304debe8a13e6d07a56b7f97ac9eb92d8ddd95d7 /arch/csky/abiv2 | |
parent | cfb24463a53edeb388f3563e166ad7f9591dad3d (diff) | |
download | lwn-e4df2d5e852a7d24df3672ae9951eb79e179be08.tar.gz lwn-e4df2d5e852a7d24df3672ae9951eb79e179be08.zip |
csky: Add C based string functions
Try to access RAM with the largest bit width possible, but without
doing unaligned accesses.
A further improvement could be to use multiple read and writes as the
assembly version was trying to do.
Tested on a BeagleV Starlight with a SiFive U74 core, where the
improvement is noticeable.
Signed-off-by: Matteo Croce <mcroce@microsoft.com>
Co-developed-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Diffstat (limited to 'arch/csky/abiv2')
-rw-r--r-- | arch/csky/abiv2/Makefile | 2 | ||||
-rw-r--r-- | arch/csky/abiv2/strksyms.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/arch/csky/abiv2/Makefile b/arch/csky/abiv2/Makefile index c561efa5533c..ea8005fe01a8 100644 --- a/arch/csky/abiv2/Makefile +++ b/arch/csky/abiv2/Makefile @@ -2,9 +2,11 @@ obj-y += cacheflush.o obj-$(CONFIG_CPU_HAS_FPU) += fpu.o obj-y += memcmp.o +ifeq ($(CONFIG_HAVE_EFFICIENT_UNALIGNED_STRING_OPS), y) obj-y += memcpy.o obj-y += memmove.o obj-y += memset.o +endif obj-y += strcmp.o obj-y += strcpy.o obj-y += strlen.o diff --git a/arch/csky/abiv2/strksyms.c b/arch/csky/abiv2/strksyms.c index 06da723d8202..8d1fd28c6cf9 100644 --- a/arch/csky/abiv2/strksyms.c +++ b/arch/csky/abiv2/strksyms.c @@ -3,10 +3,12 @@ #include <linux/module.h> +#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_STRING_OPS EXPORT_SYMBOL(memcpy); EXPORT_SYMBOL(memset); -EXPORT_SYMBOL(memcmp); EXPORT_SYMBOL(memmove); +#endif +EXPORT_SYMBOL(memcmp); EXPORT_SYMBOL(strcmp); EXPORT_SYMBOL(strcpy); EXPORT_SYMBOL(strlen); |