ia64/xen-unstable

changeset 4597:159c47d556ef

bitkeeper revision 1.1342 (4266673eMuou_Ng4Ze7pzPUJ4IL7bg)

Fix memset/memcmp/memmove declaration/definition.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Apr 20 14:29:18 2005 +0000 (2005-04-20)
parents 4fa88763f2cc
children bfda446f80cb
files .rootkeys xen/arch/x86/string.c xen/include/asm-x86/x86_32/string.h xen/include/asm-x86/x86_64/string.h
line diff
     1.1 --- a/.rootkeys	Wed Apr 20 13:57:08 2005 +0000
     1.2 +++ b/.rootkeys	Wed Apr 20 14:29:18 2005 +0000
     1.3 @@ -1224,6 +1224,7 @@ 3ddb79bcrD6Z_rUvSDgrvjyb4846Eg xen/arch/
     1.4  405b8599xI_PoEr3zZoJ2on-jdn7iw xen/arch/x86/shadow.c
     1.5  3ddb79bcSx2e8JSR3pdSGa8x1ScYzA xen/arch/x86/smp.c
     1.6  3ddb79bcfUN3-UBCPzX26IU8bq-3aw xen/arch/x86/smpboot.c
     1.7 +4266673dBje6CS6CwQ3lEdvWbf5Dcw xen/arch/x86/string.c
     1.8  3ddb79bc-Udq7ol-NX4q9XsYnN7A2Q xen/arch/x86/time.c
     1.9  3ddb79bccYVzXZJyVaxuv5T42Z1Fsw xen/arch/x86/trampoline.S
    1.10  3ddb79bcOftONV9h4QCxXOfiT0h91w xen/arch/x86/traps.c
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/xen/arch/x86/string.c	Wed Apr 20 14:29:18 2005 +0000
     2.3 @@ -0,0 +1,27 @@
     2.4 +/******************************************************************************
     2.5 + * string.c
     2.6 + * 
     2.7 + * These provide something for compiler-emitted string operations to link
     2.8 + * against.
     2.9 + */
    2.10 +
    2.11 +#include <xen/config.h>
    2.12 +#include <xen/lib.h>
    2.13 +
    2.14 +#undef memmove
    2.15 +void *memmove(void *dest, const void *src, size_t count)
    2.16 +{
    2.17 +    return __memmove(dest, src, count);
    2.18 +}
    2.19 +
    2.20 +#undef memcpy
    2.21 +void *memcpy(void *dest, const void *src, size_t count)
    2.22 +{
    2.23 +    return __memcpy(dest, src, count);
    2.24 +}
    2.25 +
    2.26 +#undef memset
    2.27 +void *memset(void *s, int c, size_t count)
    2.28 +{
    2.29 +    return __memset(s, c, count);
    2.30 +}
     3.1 --- a/xen/include/asm-x86/x86_32/string.h	Wed Apr 20 13:57:08 2005 +0000
     3.2 +++ b/xen/include/asm-x86/x86_32/string.h	Wed Apr 20 14:29:18 2005 +0000
     3.3 @@ -184,7 +184,7 @@ register int __res;
     3.4  return __res;
     3.5  }
     3.6  
     3.7 -static inline void * __memcpy(void * to, const void * from, size_t n)
     3.8 +static inline void * __variable_memcpy(void * to, const void * from, size_t n)
     3.9  {
    3.10  int d0, d1, d2;
    3.11  __asm__ __volatile__(
    3.12 @@ -272,12 +272,13 @@ static always_inline void * __constant_m
    3.13  }
    3.14  
    3.15  #define __HAVE_ARCH_MEMCPY
    3.16 -static always_inline __attribute_used__
    3.17 -void memcpy(void *t, const void *f, size_t n)
    3.18 +#define memcpy(t,f,n) (__memcpy((t),(f),(n)))
    3.19 +static always_inline
    3.20 +void *__memcpy(void *t, const void *f, size_t n)
    3.21  {
    3.22 -	(__builtin_constant_p(n) ?
    3.23 +	return (__builtin_constant_p(n) ?
    3.24  	 __constant_memcpy((t),(f),(n)) :
    3.25 -	 __memcpy((t),(f),(n)));
    3.26 +	 __variable_memcpy((t),(f),(n)));
    3.27  }
    3.28  
    3.29  /*
    3.30 @@ -299,7 +300,8 @@ void memcpy(void *t, const void *f, size
    3.31  */
    3.32  
    3.33  #define __HAVE_ARCH_MEMMOVE
    3.34 -static inline void * memmove(void * dest,const void * src, size_t n)
    3.35 +#define memmove(dest,src,n) (__memmove((dest),(src),(n)))
    3.36 +static inline void *__memmove(void * dest,const void * src, size_t n)
    3.37  {
    3.38  int d0, d1, d2;
    3.39  if (dest<src)
    3.40 @@ -455,16 +457,17 @@ static always_inline void * __constant_c
    3.41   __constant_c_and_count_memset((s),(c),(count)) : \
    3.42   __constant_c_memset((s),(c),(count)))
    3.43  
    3.44 -#define __memset(s, c, count) \
    3.45 +#define __var_x_memset(s, c, count) \
    3.46  (__builtin_constant_p(count) ? \
    3.47   __constant_count_memset((s),(c),(count)) : \
    3.48   __memset_generic((s),(c),(count)))
    3.49  
    3.50  #define __HAVE_ARCH_MEMSET
    3.51 -#define memset(s, c, count) \
    3.52 +#define memset(s, c, count) (__memset((s),(c),(count)))
    3.53 +#define __memset(s, c, count) \
    3.54  (__builtin_constant_p(c) ? \
    3.55   __constant_c_x_memset((s),(0x01010101UL*(unsigned char)(c)),(count)) : \
    3.56 - __memset((s),(c),(count)))
    3.57 + __var_x_memset((s),(c),(count)))
    3.58  
    3.59  /*
    3.60   * find the first occurrence of byte 'c', or 1 past the area if none
     4.1 --- a/xen/include/asm-x86/x86_64/string.h	Wed Apr 20 13:57:08 2005 +0000
     4.2 +++ b/xen/include/asm-x86/x86_64/string.h	Wed Apr 20 14:29:18 2005 +0000
     4.3 @@ -1,6 +1,16 @@
     4.4  #ifndef _X86_64_STRING_H_
     4.5  #define _X86_64_STRING_H_
     4.6  
     4.7 -/* nothing */
     4.8 +#define __HAVE_ARCH_MEMMOVE
     4.9 +#define memmove(dest,src,n) (__memmove((dest),(src),(n)))
    4.10 +#define __memmove(dest,src,n) (__builtin_memmove((dest),(src),(n)))
    4.11 +
    4.12 +#define __HAVE_ARCH_MEMCPY
    4.13 +#define memcpy(t,f,n) (__memcpy((t),(f),(n)))
    4.14 +#define __memcpy(t,f,n) (__builtin_memcpy((t),(f),(n)))
    4.15 +
    4.16 +#define __HAVE_ARCH_MEMSET
    4.17 +#define memset(s, c, count) (__memset((s),(c),(count)))
    4.18 +#define __memset(s, c, count) (__builtin_memset((s),(c),(count)))
    4.19  
    4.20  #endif