ia64/xen-unstable

changeset 5340:095b99f7c9c6

bitkeeper revision 1.1684 (42a468f4PvUu-iWAyhHxfE-JnhHVYw)

Remove strrchr/strnlen/memscan from x86-specific string.h. They are not
used so not worth optimising (strnlen is used only in vsprintf which is
not performance critical).
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Jun 06 15:17:08 2005 +0000 (2005-06-06)
parents 7385718ad7c0
children 4221215e1366
files xen/include/asm-x86/string.h
line diff
     1.1 --- a/xen/include/asm-x86/string.h	Mon Jun 06 14:48:14 2005 +0000
     1.2 +++ b/xen/include/asm-x86/string.h	Mon Jun 06 15:17:08 2005 +0000
     1.3 @@ -136,23 +136,6 @@ static inline char *strchr(const char *s
     1.4      return __res;
     1.5  }
     1.6  
     1.7 -#define __HAVE_ARCH_STRRCHR
     1.8 -static inline char *strrchr(const char *s, int c)
     1.9 -{
    1.10 -    long d0, d1;
    1.11 -    register char *__res;
    1.12 -    __asm__ __volatile__ (
    1.13 -        "   mov  %%al,%%ah  \n"
    1.14 -        "1: lodsb           \n"
    1.15 -        "   cmp  %%ah,%%al  \n"
    1.16 -        "   jne  2f         \n"
    1.17 -        "   lea  -1(%1),%0  \n"
    1.18 -        "2: test %%al,%%al  \n"
    1.19 -        "   jne  1b         \n"
    1.20 -        : "=g" (__res), "=&S" (d0), "=&a" (d1) : "0" (0), "1" (s), "2" (c) );
    1.21 -    return __res;
    1.22 -}
    1.23 -
    1.24  #define __HAVE_ARCH_STRLEN
    1.25  static inline size_t strlen(const char *s)
    1.26  {
    1.27 @@ -321,24 +304,6 @@ static inline void *__constant_c_memset(
    1.28      return s; 
    1.29  }
    1.30  
    1.31 -#define __HAVE_ARCH_STRNLEN
    1.32 -static inline size_t strnlen(const char *s, size_t count)
    1.33 -{
    1.34 -    long d0;
    1.35 -    register int __res;
    1.36 -    __asm__ __volatile__ (
    1.37 -        "   jmp  2f       \n"
    1.38 -        "1: cmpb $0,(%3)  \n"
    1.39 -        "   je   3f       \n"
    1.40 -        "   inc  %3       \n"
    1.41 -        "2: dec  %1       \n"
    1.42 -        "   jns  1b       \n"
    1.43 -        "3: subl %2,%0    \n"
    1.44 -        : "=a" (__res), "=&d" (d0)
    1.45 -        : "c" ((int)(long)s), "0" (s), "1" (count) );
    1.46 -    return __res;
    1.47 -}
    1.48 -
    1.49  /*
    1.50   * This looks horribly ugly, but the compiler can optimize it totally,
    1.51   * as we by now know that both pattern and count is constant..
    1.52 @@ -427,19 +392,4 @@ static always_inline void *__constant_c_
    1.53   __constant_c_x_memset((s),(MEMSET_PATTERN_MUL*(unsigned char)(c)),(count)) : \
    1.54   __var_x_memset((s),(c),(count)))
    1.55  
    1.56 -#define __HAVE_ARCH_MEMSCAN
    1.57 -static inline void *memscan(void *addr, int c, size_t size)
    1.58 -{
    1.59 -    if ( size == 0 )
    1.60 -        return addr;
    1.61 -    __asm__ (
    1.62 -        "   repnz; scasb \n"
    1.63 -        "   jnz  1f      \n"
    1.64 -        "   dec  %0      \n"
    1.65 -        "1:              \n"
    1.66 -        : "=D" (addr), "=c" (size)
    1.67 -        : "0" (addr), "1" (size), "a" (c) );
    1.68 -    return addr;
    1.69 -}
    1.70 -
    1.71  #endif /* __X86_STRING_H__ */