string.h 797 Bytes
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1 2 3 4
#ifndef __ASM_ARM_STRING_H
#define __ASM_ARM_STRING_H

/*
Linus Torvalds's avatar
Linus Torvalds committed
5 6
 * We don't do inline string functions, since the
 * optimised inline asm versions are not small.
Linus Torvalds's avatar
Linus Torvalds committed
7 8 9 10 11 12 13 14 15 16
 */

#define __HAVE_ARCH_STRRCHR
extern char * strrchr(const char * s, int c);

#define __HAVE_ARCH_STRCHR
extern char * strchr(const char * s, int c);

#define __HAVE_ARCH_MEMCPY
#define __HAVE_ARCH_MEMMOVE
Linus Torvalds's avatar
Linus Torvalds committed
17
#define __HAVE_ARCH_MEMCHR
Linus Torvalds's avatar
Linus Torvalds committed
18
#define __HAVE_ARCH_MEMZERO
Linus Torvalds's avatar
Linus Torvalds committed
19 20 21 22 23 24 25 26 27 28
#define __HAVE_ARCH_MEMSET

extern void __memzero(void *ptr, __kernel_size_t n);

#define memset(p,v,n)							\
	({								\
		if ((n) != 0) {						\
			if (__builtin_constant_p((v)) && (v) == 0)	\
				__memzero((p),(n));			\
			else						\
Linus Torvalds's avatar
Linus Torvalds committed
29
				memset((p),(v),(n));			\
Linus Torvalds's avatar
Linus Torvalds committed
30 31 32
		}							\
		(p);							\
	})
Linus Torvalds's avatar
Linus Torvalds committed
33

Linus Torvalds's avatar
Linus Torvalds committed
34
#define memzero(p,n) ({ if ((n) != 0) __memzero((p),(n)); (p); })
Linus Torvalds's avatar
Linus Torvalds committed
35 36 37

#endif