18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (C) 2013 ARM Ltd.
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci#ifndef __ASM_STRING_H
68c2ecf20Sopenharmony_ci#define __ASM_STRING_H
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef CONFIG_KASAN
98c2ecf20Sopenharmony_ci#define __HAVE_ARCH_STRRCHR
108c2ecf20Sopenharmony_ciextern char *strrchr(const char *, int c);
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#define __HAVE_ARCH_STRCHR
138c2ecf20Sopenharmony_ciextern char *strchr(const char *, int c);
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#define __HAVE_ARCH_STRCMP
168c2ecf20Sopenharmony_ciextern int strcmp(const char *, const char *);
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#define __HAVE_ARCH_STRNCMP
198c2ecf20Sopenharmony_ciextern int strncmp(const char *, const char *, __kernel_size_t);
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define __HAVE_ARCH_STRLEN
228c2ecf20Sopenharmony_ciextern __kernel_size_t strlen(const char *);
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#define __HAVE_ARCH_STRNLEN
258c2ecf20Sopenharmony_ciextern __kernel_size_t strnlen(const char *, __kernel_size_t);
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#define __HAVE_ARCH_MEMCMP
288c2ecf20Sopenharmony_ciextern int memcmp(const void *, const void *, size_t);
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#define __HAVE_ARCH_MEMCHR
318c2ecf20Sopenharmony_ciextern void *memchr(const void *, int, __kernel_size_t);
328c2ecf20Sopenharmony_ci#endif
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#define __HAVE_ARCH_MEMCPY
358c2ecf20Sopenharmony_ciextern void *memcpy(void *, const void *, __kernel_size_t);
368c2ecf20Sopenharmony_ciextern void *__memcpy(void *, const void *, __kernel_size_t);
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#define __HAVE_ARCH_MEMMOVE
398c2ecf20Sopenharmony_ciextern void *memmove(void *, const void *, __kernel_size_t);
408c2ecf20Sopenharmony_ciextern void *__memmove(void *, const void *, __kernel_size_t);
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#define __HAVE_ARCH_MEMSET
438c2ecf20Sopenharmony_ciextern void *memset(void *, int, __kernel_size_t);
448c2ecf20Sopenharmony_ciextern void *__memset(void *, int, __kernel_size_t);
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci#ifdef CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE
478c2ecf20Sopenharmony_ci#define __HAVE_ARCH_MEMCPY_FLUSHCACHE
488c2ecf20Sopenharmony_civoid memcpy_flushcache(void *dst, const void *src, size_t cnt);
498c2ecf20Sopenharmony_ci#endif
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci#if defined(CONFIG_KASAN) && !defined(__SANITIZE_ADDRESS__)
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci/*
548c2ecf20Sopenharmony_ci * For files that are not instrumented (e.g. mm/slub.c) we
558c2ecf20Sopenharmony_ci * should use not instrumented version of mem* functions.
568c2ecf20Sopenharmony_ci */
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#define memcpy(dst, src, len) __memcpy(dst, src, len)
598c2ecf20Sopenharmony_ci#define memmove(dst, src, len) __memmove(dst, src, len)
608c2ecf20Sopenharmony_ci#define memset(s, c, n) __memset(s, c, n)
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci#ifndef __NO_FORTIFY
638c2ecf20Sopenharmony_ci#define __NO_FORTIFY /* FORTIFY_SOURCE uses __builtin_memcpy, etc. */
648c2ecf20Sopenharmony_ci#endif
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci#endif
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci#endif
69