blob: 5c49b0f009b72dea958dd6ca5911fee9839427ca [file] [log] [blame]
wdenk591dda52002-11-18 00:14:45 +00001#ifndef __ASM_I386_STRING_H
2#define __ASM_I386_STRING_H
3
4/*
5 * We don't do inline string functions, since the
6 * optimised inline asm versions are not small.
7 */
Graeme Russ2fe2a972008-09-07 07:08:42 +10008#undef __HAVE_ARCH_STRNCPY
9extern char *strncpy(char *__dest, __const__ char *__src, __kernel_size_t __n);
wdenk591dda52002-11-18 00:14:45 +000010
wdenk67ff36c2002-11-19 23:01:07 +000011#undef __HAVE_ARCH_STRRCHR
Heinrich Schuchardt72454762019-01-23 02:42:39 +010012extern char *strrchr(const char *s, int c);
wdenk591dda52002-11-18 00:14:45 +000013
wdenk67ff36c2002-11-19 23:01:07 +000014#undef __HAVE_ARCH_STRCHR
Heinrich Schuchardt72454762019-01-23 02:42:39 +010015extern char *strchr(const char *s, int c);
16
Simon Glass200626c2023-05-04 16:50:52 -060017/*
18 * Our assembly routines do not work on in 64-bit mode and we don't do a lot of
19 * copying in SPL, so code size is more important there.
20 */
21#if defined(CONFIG_SPL_BUILD) || !IS_ENABLED(CONFIG_X86_32BIT_INIT)
Heinrich Schuchardt72454762019-01-23 02:42:39 +010022
23#undef __HAVE_ARCH_MEMCPY
24extern void *memcpy(void *, const void *, __kernel_size_t);
25
26#undef __HAVE_ARCH_MEMMOVE
27extern void *memmove(void *, const void *, __kernel_size_t);
28
29#undef __HAVE_ARCH_MEMSET
30extern void *memset(void *, int, __kernel_size_t);
31
32#else
wdenk591dda52002-11-18 00:14:45 +000033
Graeme Russ1dd0b702011-12-27 22:46:39 +110034#define __HAVE_ARCH_MEMCPY
Heinrich Schuchardt72454762019-01-23 02:42:39 +010035extern void *memcpy(void *, const void *, __kernel_size_t);
wdenk591dda52002-11-18 00:14:45 +000036
Simon Glass889111c2016-10-05 20:42:10 -060037#define __HAVE_ARCH_MEMMOVE
Heinrich Schuchardt72454762019-01-23 02:42:39 +010038extern void *memmove(void *, const void *, __kernel_size_t);
wdenk591dda52002-11-18 00:14:45 +000039
Gabe Black0e499052011-11-14 14:47:18 +000040#define __HAVE_ARCH_MEMSET
Heinrich Schuchardt72454762019-01-23 02:42:39 +010041extern void *memset(void *, int, __kernel_size_t);
42
43#endif /* CONFIG_X86_64 */
44
45#undef __HAVE_ARCH_MEMCHR
46extern void *memchr(const void *, int, __kernel_size_t);
wdenk591dda52002-11-18 00:14:45 +000047
wdenk67ff36c2002-11-19 23:01:07 +000048#undef __HAVE_ARCH_MEMZERO
wdenk591dda52002-11-18 00:14:45 +000049extern void memzero(void *ptr, __kernel_size_t n);
50
51#endif