Merge tag 'v3.3.7' into 3.3/master
[zen-stable.git] / arch / sparc / include / asm / string_64.h
blob9623bc2131584adec146d807c0229bfe80f7252f
1 /*
2 * string.h: External definitions for optimized assembly string
3 * routines for the Linux Kernel.
5 * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu)
6 * Copyright (C) 1996,1997,1999 Jakub Jelinek (jakub@redhat.com)
7 */
9 #ifndef __SPARC64_STRING_H__
10 #define __SPARC64_STRING_H__
12 /* Really, userland/ksyms should not see any of this stuff. */
14 #ifdef __KERNEL__
16 #include <asm/asi.h>
18 #ifndef EXPORT_SYMTAB_STROPS
20 /* First the mem*() things. */
21 #define __HAVE_ARCH_MEMMOVE
22 extern void *memmove(void *, const void *, __kernel_size_t);
24 #define __HAVE_ARCH_MEMCPY
25 #define memcpy(t, f, n) __builtin_memcpy(t, f, n)
27 #define __HAVE_ARCH_MEMSET
28 #define memset(s, c, count) __builtin_memset(s, c, count)
30 #define __HAVE_ARCH_MEMSCAN
32 #undef memscan
33 #define memscan(__arg0, __char, __arg2) \
34 ({ \
35 extern void *__memscan_zero(void *, size_t); \
36 extern void *__memscan_generic(void *, int, size_t); \
37 void *__retval, *__addr = (__arg0); \
38 size_t __size = (__arg2); \
40 if(__builtin_constant_p(__char) && !(__char)) \
41 __retval = __memscan_zero(__addr, __size); \
42 else \
43 __retval = __memscan_generic(__addr, (__char), __size); \
45 __retval; \
48 #define __HAVE_ARCH_MEMCMP
49 extern int memcmp(const void *,const void *,__kernel_size_t);
51 /* Now the str*() stuff... */
52 #define __HAVE_ARCH_STRLEN
53 extern __kernel_size_t strlen(const char *);
55 #define __HAVE_ARCH_STRNCMP
56 extern int strncmp(const char *, const char *, __kernel_size_t);
58 #endif /* !EXPORT_SYMTAB_STROPS */
60 #endif /* __KERNEL__ */
62 #endif /* !(__SPARC64_STRING_H__) */