]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - arch/arm/include/asm/string.h
Improve __copy_to_user and __copy_from_user performance
[mirror_ubuntu-zesty-kernel.git] / arch / arm / include / asm / string.h
1 #ifndef __ASM_ARM_STRING_H
2 #define __ASM_ARM_STRING_H
3
4 /*
5 * We don't do inline string functions, since the
6 * optimised inline asm versions are not small.
7 */
8
9 #define __HAVE_ARCH_STRRCHR
10 extern char * strrchr(const char * s, int c);
11
12 #define __HAVE_ARCH_STRCHR
13 extern char * strchr(const char * s, int c);
14
15 #define __HAVE_ARCH_MEMCPY
16 extern void * memcpy(void *, const void *, __kernel_size_t);
17
18 #define __HAVE_ARCH_MEMMOVE
19 extern void * memmove(void *, const void *, __kernel_size_t);
20
21 #define __HAVE_ARCH_MEMCHR
22 extern void * memchr(const void *, int, __kernel_size_t);
23
24 #define __HAVE_ARCH_MEMSET
25 extern void * memset(void *, int, __kernel_size_t);
26
27 #ifdef CONFIG_BCM2835_FAST_MEMCPY
28 #define __HAVE_ARCH_MEMCMP
29 extern int memcmp(const void *, const void *, size_t);
30 #endif
31
32 extern void __memzero(void *ptr, __kernel_size_t n);
33
34 #define memset(p,v,n) \
35 ({ \
36 void *__p = (p); size_t __n = n; \
37 if ((__n) != 0) { \
38 if (__builtin_constant_p((v)) && (v) == 0) \
39 __memzero((__p),(__n)); \
40 else \
41 memset((__p),(v),(__n)); \
42 } \
43 (__p); \
44 })
45
46 #endif