x86/speculation/mds: Fix documentation typo
[linux/fpc-iii.git] / arch / arm / include / asm / string.h
blobf54a3136aac6e36efbc3a809c1937fa401b39a8f
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_ARM_STRING_H
3 #define __ASM_ARM_STRING_H
5 /*
6 * We don't do inline string functions, since the
7 * optimised inline asm versions are not small.
8 */
10 #define __HAVE_ARCH_STRRCHR
11 extern char * strrchr(const char * s, int c);
13 #define __HAVE_ARCH_STRCHR
14 extern char * strchr(const char * s, int c);
16 #define __HAVE_ARCH_MEMCPY
17 extern void * memcpy(void *, const void *, __kernel_size_t);
19 #define __HAVE_ARCH_MEMMOVE
20 extern void * memmove(void *, const void *, __kernel_size_t);
22 #define __HAVE_ARCH_MEMCHR
23 extern void * memchr(const void *, int, __kernel_size_t);
25 #define __HAVE_ARCH_MEMSET
26 extern void * memset(void *, int, __kernel_size_t);
28 #define __HAVE_ARCH_MEMSET32
29 extern void *__memset32(uint32_t *, uint32_t v, __kernel_size_t);
30 static inline void *memset32(uint32_t *p, uint32_t v, __kernel_size_t n)
32 return __memset32(p, v, n * 4);
35 #define __HAVE_ARCH_MEMSET64
36 extern void *__memset64(uint64_t *, uint32_t low, __kernel_size_t, uint32_t hi);
37 static inline void *memset64(uint64_t *p, uint64_t v, __kernel_size_t n)
39 return __memset64(p, v, n * 8, v >> 32);
42 extern void __memzero(void *ptr, __kernel_size_t n);
44 #define memset(p,v,n) \
45 ({ \
46 void *__p = (p); size_t __n = n; \
47 if ((__n) != 0) { \
48 if (__builtin_constant_p((v)) && (v) == 0) \
49 __memzero((__p),(__n)); \
50 else \
51 memset((__p),(v),(__n)); \
52 } \
53 (__p); \
56 #endif