diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-04-29 21:13:14 +0000 |
---|---|---|
committer | <ralf@linux-mips.org> | 1997-04-29 21:13:14 +0000 |
commit | 19c9bba94152148523ba0f7ef7cffe3d45656b11 (patch) | |
tree | 40b1cb534496a7f1ca0f5c314a523c69f1fee464 /include/asm-sparc/string.h | |
parent | 7206675c40394c78a90e74812bbdbf8cf3cca1be (diff) |
Import of Linux/MIPS 2.1.36
Diffstat (limited to 'include/asm-sparc/string.h')
-rw-r--r-- | include/asm-sparc/string.h | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/include/asm-sparc/string.h b/include/asm-sparc/string.h index 856e96f6d..ca5dc4003 100644 --- a/include/asm-sparc/string.h +++ b/include/asm-sparc/string.h @@ -1,8 +1,9 @@ -/* $Id: string.h,v 1.27 1996/10/27 08:55:50 davem Exp $ +/* $Id: string.h,v 1.30 1997/03/03 17:11:12 jj Exp $ * string.h: External definitions for optimized assembly string * routines for the Linux Kernel. * - * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) + * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu) + * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ #ifndef __SPARC_STRING_H__ @@ -10,13 +11,26 @@ /* Really, userland/ksyms should not see any of this stuff. */ -#if defined(__KERNEL__) && !defined(EXPORT_SYMTAB) +#ifdef __KERNEL__ + +extern void __memmove(void *,const void *,__kernel_size_t); +extern __kernel_size_t __memcpy(void *,const void *,__kernel_size_t); +extern __kernel_size_t __memset(void *,int,__kernel_size_t); + +#ifndef EXPORT_SYMTAB /* First the mem*() things. */ #define __HAVE_ARCH_BCOPY #define __HAVE_ARCH_MEMMOVE +#undef memmove +#define memmove(_to, _from, _n) \ +({ \ + void *_t = (_to); \ + __memmove(_t, (_from), (_n)); \ + _t; \ +}) + #define __HAVE_ARCH_MEMCPY -extern void *__memcpy(void *,const void *,__kernel_size_t); extern inline void *__constant_memcpy(void *to, const void *from, __kernel_size_t n) { @@ -50,12 +64,11 @@ extern inline void *__nonconstant_memcpy(void *to, const void *from, __kernel_si __nonconstant_memcpy((t),(f),(n))) #define __HAVE_ARCH_MEMSET -extern void *__memset(void *,int,__kernel_size_t); -extern inline void *__constant_c_and_count_memset(void *s, char c, size_t count) +extern inline void *__constant_c_and_count_memset(void *s, char c, __kernel_size_t count) { extern void *bzero_1page(void *); - extern void *__bzero(void *, size_t); + extern __kernel_size_t __bzero(void *, __kernel_size_t); if(!c) { if(count == 4096) @@ -68,9 +81,9 @@ extern inline void *__constant_c_and_count_memset(void *s, char c, size_t count) return s; } -extern inline void *__constant_c_memset(void *s, char c, size_t count) +extern inline void *__constant_c_memset(void *s, char c, __kernel_size_t count) { - extern void *__bzero(void *, size_t); + extern __kernel_size_t __bzero(void *, __kernel_size_t); if(!c) __bzero(s, count); @@ -79,12 +92,18 @@ extern inline void *__constant_c_memset(void *s, char c, size_t count) return s; } +extern inline void *__nonconstant_memset(void *s, char c, __kernel_size_t count) +{ + __memset(s, c, count); + return s; +} + #undef memset #define memset(s, c, count) \ (__builtin_constant_p(c) ? (__builtin_constant_p(count) ? \ __constant_c_and_count_memset((s), (c), (count)) : \ __constant_c_memset((s), (c), (count))) \ - : __memset((s), (c), (count))) + : __nonconstant_memset((s), (c), (count))) #define __HAVE_ARCH_MEMSCAN @@ -172,7 +191,9 @@ extern inline int __constant_strncmp(const char *src, const char *dest, __kernel (__builtin_constant_p(__arg2) ? \ __constant_strncmp(__arg0, __arg1, __arg2) : \ __strncmp(__arg0, __arg1, __arg2)) + +#endif /* EXPORT_SYMTAB */ -#endif /* (__KERNEL__) && !(_KSYMS_INTERNEL) */ +#endif /* __KERNEL__ */ #endif /* !(__SPARC_STRING_H__) */ |