summaryrefslogtreecommitdiff
path: root/arch/microblaze/include
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2022-02-25 14:55:34 +0100
committerMichal Simek <michal.simek@xilinx.com>2022-04-21 10:54:20 +0200
commit8f0f265e6cf5b6d99a5a5d01b36985bc1131183e (patch)
tree8e9696d5655f2b8d8e8b2c730172e4d7a73de4e5 /arch/microblaze/include
parent3123109284176b1532874591f7c81f3837bbdc17 (diff)
microblaze: Use simple memset implementation from lib/string.c
On microblaze systems which are not using OPT_LIB_FUNCTION only simple memset is used. This function is already implemented in lib/string.c that's why it should be used instead. This change is done in respect of issue fixed by commit 33d0f96ffd73 ("lib/string.c: Use freestanding environment") where gcc-10.x moved -ftree-loop-distribute-patterns optimization is to O2 optimization level. This optimization causes GCC to convert the while loop in memset.c into a call to memset. So This optimization is transforming a loop in a memset/memcpy into a call to the function itself. This makes the memset implementation as recursive. Based on fix above -ffreestanding was used and it needs to be used on Microblaze too but the patch is not adding this flag it removes simple implementation to cause that generic implementation is used where this flag is already setup. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com> Link: https://lore.kernel.org/r/4a143e7654f72ee893dcea9769946e17d3570b16.1645797329.git.michal.simek@xilinx.com
Diffstat (limited to 'arch/microblaze/include')
-rw-r--r--arch/microblaze/include/asm/string.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/microblaze/include/asm/string.h b/arch/microblaze/include/asm/string.h
index 34071a848b6a..dbdb9eb4a733 100644
--- a/arch/microblaze/include/asm/string.h
+++ b/arch/microblaze/include/asm/string.h
@@ -8,7 +8,9 @@
#ifdef __KERNEL__
+#ifdef CONFIG_OPT_LIB_FUNCTION
#define __HAVE_ARCH_MEMSET
+#endif
#define __HAVE_ARCH_MEMCPY
#define __HAVE_ARCH_MEMMOVE