ia64/xen-unstable

changeset 10164:1345b20cca56

Remove broken inline-asm string functions from Xen/x86. The
generic implementations in string.c are quite sufficient.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed May 24 11:52:25 2006 +0100 (2006-05-24)
parents 187180382772
children 84dd753a9247
files xen/include/asm-x86/string.h
line diff
     1.1 --- a/xen/include/asm-x86/string.h	Tue May 23 16:23:10 2006 +0100
     1.2 +++ b/xen/include/asm-x86/string.h	Wed May 24 11:52:25 2006 +0100
     1.3 @@ -3,152 +3,6 @@
     1.4  
     1.5  #include <xen/config.h>
     1.6  
     1.7 -#define __HAVE_ARCH_STRCPY
     1.8 -static inline char *strcpy(char *dest, const char *src)
     1.9 -{
    1.10 -    long d0, d1, d2;
    1.11 -    __asm__ __volatile__ (
    1.12 -        "1: lodsb          \n"
    1.13 -        "   stosb          \n"
    1.14 -        "   test %%al,%%al \n"
    1.15 -        "   jne  1b        \n"
    1.16 -        : "=&S" (d0), "=&D" (d1), "=&a" (d2)
    1.17 -        : "0" (src), "1" (dest) : "memory" );
    1.18 -    return dest;
    1.19 -}
    1.20 -
    1.21 -#define __HAVE_ARCH_STRNCPY
    1.22 -static inline char *strncpy(char *dest, const char *src, size_t count)
    1.23 -{
    1.24 -    long d0, d1, d2, d3;
    1.25 -    __asm__ __volatile__ (
    1.26 -        "1: dec  %2        \n"
    1.27 -        "   js   2f        \n"
    1.28 -        "   lodsb          \n"
    1.29 -        "   stosb          \n"
    1.30 -        "   test %%al,%%al \n"
    1.31 -        "   jne  1b        \n"
    1.32 -        "   rep ; stosb    \n"
    1.33 -        "2:                \n"
    1.34 -        : "=&S" (d0), "=&D" (d1), "=&c" (d2), "=&a" (d3)
    1.35 -        : "0" (src), "1" (dest), "2" (count) : "memory" );
    1.36 -    return dest;
    1.37 -}
    1.38 -
    1.39 -#define __HAVE_ARCH_STRCAT
    1.40 -static inline char *strcat(char *dest, const char *src)
    1.41 -{
    1.42 -    long d0, d1, d2, d3;
    1.43 -    __asm__ __volatile__ (
    1.44 -        "   repne ; scasb  \n"
    1.45 -        "   dec  %1        \n"
    1.46 -        "1: lodsb          \n"
    1.47 -        "   stosb          \n"
    1.48 -        "   test %%al,%%al \n"
    1.49 -        "   jne  1b        \n"
    1.50 -        : "=&S" (d0), "=&D" (d1), "=&a" (d2), "=&c" (d3)
    1.51 -        : "0" (src), "1" (dest), "2" (0UL), "3" (0xffffffffUL) : "memory" );
    1.52 -    return dest;
    1.53 -}
    1.54 -
    1.55 -#define __HAVE_ARCH_STRNCAT
    1.56 -static inline char *strncat(char *dest, const char *src, size_t count)
    1.57 -{
    1.58 -    long d0, d1, d2, d3;
    1.59 -    __asm__ __volatile__ (
    1.60 -        "   repne ; scasb   \n"
    1.61 -        "   dec  %1         \n"
    1.62 -        "   mov  %8,%3      \n"
    1.63 -        "1: dec  %3         \n"
    1.64 -        "   js   2f         \n"
    1.65 -        "   lodsb           \n"
    1.66 -        "   stosb           \n"
    1.67 -        "   test %%al,%%al  \n"
    1.68 -        "   jne  1b         \n"
    1.69 -        "2: xor  %%eax,%%eax\n"
    1.70 -        "   stosb"
    1.71 -        : "=&S" (d0), "=&D" (d1), "=&a" (d2), "=&c" (d3)
    1.72 -        : "0" (src), "1" (dest), "2" (0UL), "3" (0xffffffffUL), "g" (count)
    1.73 -        : "memory" );
    1.74 -    return dest;
    1.75 -}
    1.76 -
    1.77 -#define __HAVE_ARCH_STRCMP
    1.78 -static inline int strcmp(const char *cs, const char *ct)
    1.79 -{
    1.80 -    long d0, d1;
    1.81 -    register int __res;
    1.82 -    __asm__ __volatile__ (
    1.83 -        "1: lodsb           \n"
    1.84 -        "   scasb           \n"
    1.85 -        "   jne  2f         \n"
    1.86 -        "   test %%al,%%al  \n"
    1.87 -        "   jne  1b         \n"
    1.88 -        "   xor  %%eax,%%eax\n"
    1.89 -        "   jmp  3f         \n"
    1.90 -        "2: sbb  %%eax,%%eax\n"
    1.91 -        "   or   $1,%%al    \n"
    1.92 -        "3:                 \n"
    1.93 -        : "=a" (__res), "=&S" (d0), "=&D" (d1)
    1.94 -        : "1" (cs), "2" (ct) );
    1.95 -    return __res;
    1.96 -}
    1.97 -
    1.98 -#define __HAVE_ARCH_STRNCMP
    1.99 -static inline int strncmp(const char *cs, const char *ct, size_t count)
   1.100 -{
   1.101 -    long d0, d1, d2;
   1.102 -    register int __res;
   1.103 -    __asm__ __volatile__ (
   1.104 -        "1: dec  %3         \n"
   1.105 -        "   js   2f         \n"
   1.106 -        "   lodsb           \n"
   1.107 -        "   scasb           \n"
   1.108 -        "   jne  3f         \n"
   1.109 -        "   test %%al,%%al  \n"
   1.110 -        "   jne  1b         \n"
   1.111 -        "2: xor  %%eax,%%eax\n"
   1.112 -        "   jmp  4f         \n"
   1.113 -        "3: sbb  %%eax,%%eax\n"
   1.114 -        "   or   $1,%%al    \n"
   1.115 -        "4:                 \n"
   1.116 -        : "=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
   1.117 -        : "1" (cs), "2" (ct), "3" (count) );
   1.118 -    return __res;
   1.119 -}
   1.120 -
   1.121 -#define __HAVE_ARCH_STRCHR
   1.122 -static inline char *strchr(const char *s, int c)
   1.123 -{
   1.124 -    long d0;
   1.125 -    register char *__res;
   1.126 -    __asm__ __volatile__ (
   1.127 -        "   mov  %%al,%%ah  \n"
   1.128 -        "1: lodsb           \n"
   1.129 -        "   cmp  %%ah,%%al  \n"
   1.130 -        "   je   2f         \n"
   1.131 -        "   test %%al,%%al  \n"
   1.132 -        "   jne  1b         \n"
   1.133 -        "   mov  $1,%1      \n"
   1.134 -        "2: mov  %1,%0      \n"
   1.135 -        "   dec  %0         \n"
   1.136 -        : "=a" (__res), "=&S" (d0) : "1" (s), "0" (c) );
   1.137 -    return __res;
   1.138 -}
   1.139 -
   1.140 -#define __HAVE_ARCH_STRLEN
   1.141 -static inline size_t strlen(const char *s)
   1.142 -{
   1.143 -    long d0;
   1.144 -    register int __res;
   1.145 -    __asm__ __volatile__ (
   1.146 -        "   repne ; scasb  \n"
   1.147 -        "   notl %0        \n"
   1.148 -        "   decl %0        \n"
   1.149 -        : "=c" (__res), "=&D" (d0) : "1" (s), "a" (0), "0" (0xffffffffUL) );
   1.150 -    return __res;
   1.151 -}
   1.152 -
   1.153  static inline void *__variable_memcpy(void *to, const void *from, size_t n)
   1.154  {
   1.155      long d0, d1, d2;