blob: 38ad85fe3bb65c87498f750c44c45ff48e021e13 [file] [log] [blame]
Rick Chen76c0a242017-12-26 13:55:51 +08001/*
2 * Copyright (C) 2011 Andes Technology Corporation
3 * Copyright (C) 2010 Shawn Lin (nobuhiro@andestech.com)
4 * Copyright (C) 2011 Macpaul Lin (macpaul@andestech.com)
5 * Copyright (C) 2017 Rick Chen (rick@andestech.com)
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11
12#ifndef __ASM_RISCV_STRING_H
13#define __ASM_RISCV_STRING_H
14
15/*
16 * We don't do inline string functions, since the
17 * optimised inline asm versions are not small.
18 */
19
20#undef __HAVE_ARCH_STRRCHR
21#undef __HAVE_ARCH_STRCHR
Rick Chen76c0a242017-12-26 13:55:51 +080022#undef __HAVE_ARCH_MEMCHR
23#undef __HAVE_ARCH_MEMZERO
Heinrich Schuchardt23caf662021-03-27 12:37:04 +010024
25#undef __HAVE_ARCH_MEMCPY
26#if CONFIG_IS_ENABLED(USE_ARCH_MEMCPY)
27#define __HAVE_ARCH_MEMCPY
28#endif
29extern void *memcpy(void *, const void *, __kernel_size_t);
Rick Chen76c0a242017-12-26 13:55:51 +080030
Heinrich Schuchardt23caf662021-03-27 12:37:04 +010031#undef __HAVE_ARCH_MEMMOVE
32#if CONFIG_IS_ENABLED(USE_ARCH_MEMMOVE)
33#define __HAVE_ARCH_MEMMOVE
34#endif
35extern void *memmove(void *, const void *, __kernel_size_t);
Rick Chen76c0a242017-12-26 13:55:51 +080036
Heinrich Schuchardt23caf662021-03-27 12:37:04 +010037#undef __HAVE_ARCH_MEMZERO
38#if CONFIG_IS_ENABLED(USE_ARCH_MEMSET)
39#define __HAVE_ARCH_MEMSET
Rick Chen76c0a242017-12-26 13:55:51 +080040#endif
Heinrich Schuchardt23caf662021-03-27 12:37:04 +010041extern void *memset(void *, int, __kernel_size_t);
Rick Chen76c0a242017-12-26 13:55:51 +080042
Yu Chien Peter Lin60814cb2023-08-09 18:49:30 +080043#undef __HAVE_ARCH_STRLEN
44#if CONFIG_IS_ENABLED(USE_ARCH_STRLEN)
45#define __HAVE_ARCH_STRLEN
46#endif
47extern __kernel_size_t strlen(const char *);
48
49#undef __HAVE_ARCH_STRCMP
50#if CONFIG_IS_ENABLED(USE_ARCH_STRCMP)
51#define __HAVE_ARCH_STRCMP
52#endif
53extern int strcmp(const char *, const char *);
54
55#undef __HAVE_ARCH_STRNCMP
56#if CONFIG_IS_ENABLED(USE_ARCH_STRNCMP)
57#define __HAVE_ARCH_STRNCMP
58#endif
59extern int strncmp(const char *, const char *, size_t __kernel_size_t);
60
Rick Chen76c0a242017-12-26 13:55:51 +080061#endif /* __ASM_RISCV_STRING_H */