Skip to content

Commit e4df2d5

Browse files
teknoraverguoren83
authored andcommitted
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 <[email protected]> Co-developed-by: Guo Ren <[email protected]> Signed-off-by: Guo Ren <[email protected]>
1 parent cfb2446 commit e4df2d5

File tree

8 files changed

+150
-356
lines changed

8 files changed

+150
-356
lines changed

arch/csky/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,14 @@ config HOTPLUG_CPU
320320
controlled through /sys/devices/system/cpu/cpu1/hotplug/target.
321321

322322
Say N if you want to disable CPU hotplug.
323+
324+
config HAVE_EFFICIENT_UNALIGNED_STRING_OPS
325+
bool "Enable EFFICIENT_UNALIGNED_STRING_OPS for abiv2"
326+
depends on CPU_CK807 || CPU_CK810 || CPU_CK860
327+
help
328+
Say Y here to enable EFFICIENT_UNALIGNED_STRING_OPS. Some CPU models could
329+
deal with unaligned access by hardware.
330+
323331
endmenu
324332

325333
source "arch/csky/Kconfig.platforms"

arch/csky/abiv1/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@ obj-y += bswapdi.o
44
obj-y += bswapsi.o
55
obj-y += cacheflush.o
66
obj-y += mmap.o
7-
obj-y += memcpy.o
8-
obj-y += strksyms.o

arch/csky/abiv1/memcpy.S

Lines changed: 0 additions & 347 deletions
This file was deleted.

arch/csky/abiv1/strksyms.c

Lines changed: 0 additions & 6 deletions
This file was deleted.

arch/csky/abiv2/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
obj-y += cacheflush.o
33
obj-$(CONFIG_CPU_HAS_FPU) += fpu.o
44
obj-y += memcmp.o
5+
ifeq ($(CONFIG_HAVE_EFFICIENT_UNALIGNED_STRING_OPS), y)
56
obj-y += memcpy.o
67
obj-y += memmove.o
78
obj-y += memset.o
9+
endif
810
obj-y += strcmp.o
911
obj-y += strcpy.o
1012
obj-y += strlen.o

0 commit comments

Comments
 (0)