summaryrefslogtreecommitdiff
path: root/arch/x86/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-05-04 16:50:52 -0600
committerBin Meng <bmeng@tinylab.org>2023-05-11 10:25:29 +0800
commitb194e432c3d22bbeb6045b7f294c354d03ee95d3 (patch)
treeb406c2b8207b5527a4f37d83b8ba274b7194845a /arch/x86/include
parentafa3d90c08242790dad21ac27a412067bcbfcb49 (diff)
downloadu-boot-b194e432c3d22bbeb6045b7f294c354d03ee95d3.tar.gz
u-boot-b194e432c3d22bbeb6045b7f294c354d03ee95d3.tar.bz2
u-boot-b194e432c3d22bbeb6045b7f294c354d03ee95d3.zip
x86: Tidy up availability of string functions
For now, just enable the fast-but-large string functions in 32-boot U-Boot proper only. Avoid using them in SPL. We cannot use then in 64-bit builds since we only have 32-bit assembly. Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/string.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/include/asm/string.h b/arch/x86/include/asm/string.h
index c15b264a5c..5c49b0f009 100644
--- a/arch/x86/include/asm/string.h
+++ b/arch/x86/include/asm/string.h
@@ -14,7 +14,11 @@ extern char *strrchr(const char *s, int c);
#undef __HAVE_ARCH_STRCHR
extern char *strchr(const char *s, int c);
-#ifdef CONFIG_X86_64
+/*
+ * Our assembly routines do not work on in 64-bit mode and we don't do a lot of
+ * copying in SPL, so code size is more important there.
+ */
+#if defined(CONFIG_SPL_BUILD) || !IS_ENABLED(CONFIG_X86_32BIT_INIT)
#undef __HAVE_ARCH_MEMCPY
extern void *memcpy(void *, const void *, __kernel_size_t);