1
2
3
4
5
6
7
8
9
10
11#ifndef __ASM_NDS_STRING_H
12#define __ASM_NDS_STRING_H
13
14
15
16
17
18
19#undef __HAVE_ARCH_STRRCHR
20extern char *strrchr(const char *s, int c);
21
22#undef __HAVE_ARCH_STRCHR
23extern char *strchr(const char *s, int c);
24
25#undef __HAVE_ARCH_MEMCPY
26extern void *memcpy(void *, const void *, __kernel_size_t);
27
28#undef __HAVE_ARCH_MEMMOVE
29extern void *memmove(void *, const void *, __kernel_size_t);
30
31#undef __HAVE_ARCH_MEMCHR
32extern void *memchr(const void *, int, __kernel_size_t);
33
34#undef __HAVE_ARCH_MEMZERO
35#undef __HAVE_ARCH_MEMSET
36extern void *memset(void *, int, __kernel_size_t);
37
38#ifdef CONFIG_MARCO_MEMSET
39extern void __memzero(void *ptr, __kernel_size_t n);
40
41#define memset(p, v, n) \
42 ({ \
43 if ((n) != 0) { \
44 if (__builtin_constant_p((v)) && (v) == 0) \
45 __memzero((p), (n)); \
46 else \
47 memset((p), (v), (n)); \
48 } \
49 (p); \
50 })
51
52#define memzero(p, n) ({ if ((n) != 0) __memzero((p), (n)); (p); })
53#else
54extern void memzero(void *ptr, __kernel_size_t n);
55#endif
56
57#endif
58