diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2016-01-17 13:09:11 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-08-07 23:55:48 -0400 |
| commit | 70a6fcf3283a0ac1e11737c6d90c0753f9824e9d (patch) | |
| tree | ee248c87b1c28d9b713ced270373d7b213ed13e2 /arch/sparc/include | |
| parent | d3867f0483103b8ff7edfdea3ef1981c03d96891 (diff) | |
[sparc] unify 32bit and 64bit string.h
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/sparc/include')
| -rw-r--r-- | arch/sparc/include/asm/string.h | 34 | ||||
| -rw-r--r-- | arch/sparc/include/asm/string_32.h | 56 | ||||
| -rw-r--r-- | arch/sparc/include/asm/string_64.h | 44 |
3 files changed, 34 insertions, 100 deletions
diff --git a/arch/sparc/include/asm/string.h b/arch/sparc/include/asm/string.h index 98b72a0c8e6e..86f34be14ce0 100644 --- a/arch/sparc/include/asm/string.h +++ b/arch/sparc/include/asm/string.h | |||
| @@ -5,4 +5,38 @@ | |||
| 5 | #else | 5 | #else |
| 6 | #include <asm/string_32.h> | 6 | #include <asm/string_32.h> |
| 7 | #endif | 7 | #endif |
| 8 | |||
| 9 | /* First the mem*() things. */ | ||
| 10 | #define __HAVE_ARCH_MEMMOVE | ||
| 11 | void *memmove(void *, const void *, __kernel_size_t); | ||
| 12 | |||
| 13 | #define __HAVE_ARCH_MEMCPY | ||
| 14 | #define memcpy(t, f, n) __builtin_memcpy(t, f, n) | ||
| 15 | |||
| 16 | #define __HAVE_ARCH_MEMSET | ||
| 17 | #define memset(s, c, count) __builtin_memset(s, c, count) | ||
| 18 | |||
| 19 | #define __HAVE_ARCH_MEMSCAN | ||
| 20 | |||
| 21 | #define memscan(__arg0, __char, __arg2) \ | ||
| 22 | ({ \ | ||
| 23 | void *__memscan_zero(void *, size_t); \ | ||
| 24 | void *__memscan_generic(void *, int, size_t); \ | ||
| 25 | void *__retval, *__addr = (__arg0); \ | ||
| 26 | size_t __size = (__arg2); \ | ||
| 27 | \ | ||
| 28 | if(__builtin_constant_p(__char) && !(__char)) \ | ||
| 29 | __retval = __memscan_zero(__addr, __size); \ | ||
| 30 | else \ | ||
| 31 | __retval = __memscan_generic(__addr, (__char), __size); \ | ||
| 32 | \ | ||
| 33 | __retval; \ | ||
| 34 | }) | ||
| 35 | |||
| 36 | #define __HAVE_ARCH_MEMCMP | ||
| 37 | int memcmp(const void *,const void *,__kernel_size_t); | ||
| 38 | |||
| 39 | #define __HAVE_ARCH_STRNCMP | ||
| 40 | int strncmp(const char *, const char *, __kernel_size_t); | ||
| 41 | |||
| 8 | #endif | 42 | #endif |
diff --git a/arch/sparc/include/asm/string_32.h b/arch/sparc/include/asm/string_32.h index 69974e924611..649412476a69 100644 --- a/arch/sparc/include/asm/string_32.h +++ b/arch/sparc/include/asm/string_32.h | |||
| @@ -11,60 +11,4 @@ | |||
| 11 | 11 | ||
| 12 | #include <asm/page.h> | 12 | #include <asm/page.h> |
| 13 | 13 | ||
| 14 | /* Really, userland/ksyms should not see any of this stuff. */ | ||
| 15 | |||
| 16 | #ifdef __KERNEL__ | ||
| 17 | |||
| 18 | void __memmove(void *,const void *,__kernel_size_t); | ||
| 19 | |||
| 20 | #ifndef EXPORT_SYMTAB_STROPS | ||
| 21 | |||
| 22 | /* First the mem*() things. */ | ||
| 23 | #define __HAVE_ARCH_MEMMOVE | ||
| 24 | #undef memmove | ||
| 25 | #define memmove(_to, _from, _n) \ | ||
| 26 | ({ \ | ||
| 27 | void *_t = (_to); \ | ||
| 28 | __memmove(_t, (_from), (_n)); \ | ||
| 29 | _t; \ | ||
| 30 | }) | ||
| 31 | |||
| 32 | #define __HAVE_ARCH_MEMCPY | ||
| 33 | #define memcpy(t, f, n) __builtin_memcpy(t, f, n) | ||
| 34 | |||
| 35 | #define __HAVE_ARCH_MEMSET | ||
| 36 | #define memset(s, c, count) __builtin_memset(s, c, count) | ||
| 37 | |||
| 38 | #define __HAVE_ARCH_MEMSCAN | ||
| 39 | |||
| 40 | #undef memscan | ||
| 41 | #define memscan(__arg0, __char, __arg2) \ | ||
| 42 | ({ \ | ||
| 43 | void *__memscan_zero(void *, size_t); \ | ||
| 44 | void *__memscan_generic(void *, int, size_t); \ | ||
| 45 | void *__retval, *__addr = (__arg0); \ | ||
| 46 | size_t __size = (__arg2); \ | ||
| 47 | \ | ||
| 48 | if(__builtin_constant_p(__char) && !(__char)) \ | ||
| 49 | __retval = __memscan_zero(__addr, __size); \ | ||
| 50 | else \ | ||
| 51 | __retval = __memscan_generic(__addr, (__char), __size); \ | ||
| 52 | \ | ||
| 53 | __retval; \ | ||
| 54 | }) | ||
| 55 | |||
| 56 | #define __HAVE_ARCH_MEMCMP | ||
| 57 | int memcmp(const void *,const void *,__kernel_size_t); | ||
| 58 | |||
| 59 | /* Now the str*() stuff... */ | ||
| 60 | #define __HAVE_ARCH_STRLEN | ||
| 61 | __kernel_size_t strlen(const char *); | ||
| 62 | |||
| 63 | #define __HAVE_ARCH_STRNCMP | ||
| 64 | int strncmp(const char *, const char *, __kernel_size_t); | ||
| 65 | |||
| 66 | #endif /* !EXPORT_SYMTAB_STROPS */ | ||
| 67 | |||
| 68 | #endif /* __KERNEL__ */ | ||
| 69 | |||
| 70 | #endif /* !(__SPARC_STRING_H__) */ | 14 | #endif /* !(__SPARC_STRING_H__) */ |
diff --git a/arch/sparc/include/asm/string_64.h b/arch/sparc/include/asm/string_64.h index 5936b8ff3c05..6b9ccb308605 100644 --- a/arch/sparc/include/asm/string_64.h +++ b/arch/sparc/include/asm/string_64.h | |||
| @@ -9,54 +9,10 @@ | |||
| 9 | #ifndef __SPARC64_STRING_H__ | 9 | #ifndef __SPARC64_STRING_H__ |
| 10 | #define __SPARC64_STRING_H__ | 10 | #define __SPARC64_STRING_H__ |
| 11 | 11 | ||
| 12 | /* Really, userland/ksyms should not see any of this stuff. */ | ||
| 13 | |||
| 14 | #ifdef __KERNEL__ | ||
| 15 | |||
| 16 | #include <asm/asi.h> | 12 | #include <asm/asi.h> |
| 17 | 13 | ||
| 18 | #ifndef EXPORT_SYMTAB_STROPS | ||
| 19 | |||
| 20 | /* First the mem*() things. */ | ||
| 21 | #define __HAVE_ARCH_MEMMOVE | ||
| 22 | void *memmove(void *, const void *, __kernel_size_t); | ||
| 23 | |||
| 24 | #define __HAVE_ARCH_MEMCPY | ||
| 25 | #define memcpy(t, f, n) __builtin_memcpy(t, f, n) | ||
| 26 | |||
| 27 | #define __HAVE_ARCH_MEMSET | ||
| 28 | #define memset(s, c, count) __builtin_memset(s, c, count) | ||
| 29 | |||
| 30 | #define __HAVE_ARCH_MEMSCAN | ||
| 31 | |||
| 32 | #undef memscan | ||
| 33 | #define memscan(__arg0, __char, __arg2) \ | ||
| 34 | ({ \ | ||
| 35 | void *__memscan_zero(void *, size_t); \ | ||
| 36 | void *__memscan_generic(void *, int, size_t); \ | ||
| 37 | void *__retval, *__addr = (__arg0); \ | ||
| 38 | size_t __size = (__arg2); \ | ||
| 39 | \ | ||
| 40 | if(__builtin_constant_p(__char) && !(__char)) \ | ||
| 41 | __retval = __memscan_zero(__addr, __size); \ | ||
| 42 | else \ | ||
| 43 | __retval = __memscan_generic(__addr, (__char), __size); \ | ||
| 44 | \ | ||
| 45 | __retval; \ | ||
| 46 | }) | ||
| 47 | |||
| 48 | #define __HAVE_ARCH_MEMCMP | ||
| 49 | int memcmp(const void *,const void *,__kernel_size_t); | ||
| 50 | |||
| 51 | /* Now the str*() stuff... */ | 14 | /* Now the str*() stuff... */ |
| 52 | #define __HAVE_ARCH_STRLEN | 15 | #define __HAVE_ARCH_STRLEN |
| 53 | __kernel_size_t strlen(const char *); | 16 | __kernel_size_t strlen(const char *); |
| 54 | 17 | ||
| 55 | #define __HAVE_ARCH_STRNCMP | ||
| 56 | int strncmp(const char *, const char *, __kernel_size_t); | ||
| 57 | |||
| 58 | #endif /* !EXPORT_SYMTAB_STROPS */ | ||
| 59 | |||
| 60 | #endif /* __KERNEL__ */ | ||
| 61 | |||
| 62 | #endif /* !(__SPARC64_STRING_H__) */ | 18 | #endif /* !(__SPARC64_STRING_H__) */ |
