Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / powerpc / include / asm / string.h
blob9b8cedf618f470fad48e8f10f543326944302f38
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_POWERPC_STRING_H
3 #define _ASM_POWERPC_STRING_H
5 #ifdef __KERNEL__
7 #define __HAVE_ARCH_STRNCPY
8 #define __HAVE_ARCH_STRNCMP
9 #define __HAVE_ARCH_MEMSET
10 #define __HAVE_ARCH_MEMCPY
11 #define __HAVE_ARCH_MEMMOVE
12 #define __HAVE_ARCH_MEMCMP
13 #define __HAVE_ARCH_MEMCHR
14 #define __HAVE_ARCH_MEMSET16
15 #define __HAVE_ARCH_MEMCPY_FLUSHCACHE
17 extern char * strcpy(char *,const char *);
18 extern char * strncpy(char *,const char *, __kernel_size_t);
19 extern __kernel_size_t strlen(const char *);
20 extern int strcmp(const char *,const char *);
21 extern int strncmp(const char *, const char *, __kernel_size_t);
22 extern char * strcat(char *, const char *);
23 extern void * memset(void *,int,__kernel_size_t);
24 extern void * memcpy(void *,const void *,__kernel_size_t);
25 extern void * memmove(void *,const void *,__kernel_size_t);
26 extern int memcmp(const void *,const void *,__kernel_size_t);
27 extern void * memchr(const void *,int,__kernel_size_t);
28 extern void * memcpy_flushcache(void *,const void *,__kernel_size_t);
30 #ifdef CONFIG_PPC64
31 #define __HAVE_ARCH_MEMSET32
32 #define __HAVE_ARCH_MEMSET64
34 extern void *__memset16(uint16_t *, uint16_t v, __kernel_size_t);
35 extern void *__memset32(uint32_t *, uint32_t v, __kernel_size_t);
36 extern void *__memset64(uint64_t *, uint64_t v, __kernel_size_t);
38 static inline void *memset16(uint16_t *p, uint16_t v, __kernel_size_t n)
40 return __memset16(p, v, n * 2);
43 static inline void *memset32(uint32_t *p, uint32_t v, __kernel_size_t n)
45 return __memset32(p, v, n * 4);
48 static inline void *memset64(uint64_t *p, uint64_t v, __kernel_size_t n)
50 return __memset64(p, v, n * 8);
52 #else
53 extern void *memset16(uint16_t *, uint16_t, __kernel_size_t);
54 #endif
55 #endif /* __KERNEL__ */
57 #endif /* _ASM_POWERPC_STRING_H */