Mailing List Archive

Remove broken inline-asm string functions from Xen/x86. The
# HG changeset patch
# User kaf24@firebug.cl.cam.ac.uk
# Node ID 1345b20cca565950c0209971a0a71d19498cc765
# Parent 187180382772582f075d0e0f9da23843e0c9e2dd
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>
---
xen/include/asm-x86/string.h | 146 -------------------------------------------
1 files changed, 146 deletions(-)

diff -r 187180382772 -r 1345b20cca56 xen/include/asm-x86/string.h
--- a/xen/include/asm-x86/string.h Tue May 23 16:23:10 2006 +0100
+++ b/xen/include/asm-x86/string.h Wed May 24 11:52:25 2006 +0100
@@ -2,152 +2,6 @@
#define __X86_STRING_H__

#include <xen/config.h>
-
-#define __HAVE_ARCH_STRCPY
-static inline char *strcpy(char *dest, const char *src)
-{
- long d0, d1, d2;
- __asm__ __volatile__ (
- "1: lodsb \n"
- " stosb \n"
- " test %%al,%%al \n"
- " jne 1b \n"
- : "=&S" (d0), "=&D" (d1), "=&a" (d2)
- : "0" (src), "1" (dest) : "memory" );
- return dest;
-}
-
-#define __HAVE_ARCH_STRNCPY
-static inline char *strncpy(char *dest, const char *src, size_t count)
-{
- long d0, d1, d2, d3;
- __asm__ __volatile__ (
- "1: dec %2 \n"
- " js 2f \n"
- " lodsb \n"
- " stosb \n"
- " test %%al,%%al \n"
- " jne 1b \n"
- " rep ; stosb \n"
- "2: \n"
- : "=&S" (d0), "=&D" (d1), "=&c" (d2), "=&a" (d3)
- : "0" (src), "1" (dest), "2" (count) : "memory" );
- return dest;
-}
-
-#define __HAVE_ARCH_STRCAT
-static inline char *strcat(char *dest, const char *src)
-{
- long d0, d1, d2, d3;
- __asm__ __volatile__ (
- " repne ; scasb \n"
- " dec %1 \n"
- "1: lodsb \n"
- " stosb \n"
- " test %%al,%%al \n"
- " jne 1b \n"
- : "=&S" (d0), "=&D" (d1), "=&a" (d2), "=&c" (d3)
- : "0" (src), "1" (dest), "2" (0UL), "3" (0xffffffffUL) : "memory" );
- return dest;
-}
-
-#define __HAVE_ARCH_STRNCAT
-static inline char *strncat(char *dest, const char *src, size_t count)
-{
- long d0, d1, d2, d3;
- __asm__ __volatile__ (
- " repne ; scasb \n"
- " dec %1 \n"
- " mov %8,%3 \n"
- "1: dec %3 \n"
- " js 2f \n"
- " lodsb \n"
- " stosb \n"
- " test %%al,%%al \n"
- " jne 1b \n"
- "2: xor %%eax,%%eax\n"
- " stosb"
- : "=&S" (d0), "=&D" (d1), "=&a" (d2), "=&c" (d3)
- : "0" (src), "1" (dest), "2" (0UL), "3" (0xffffffffUL), "g" (count)
- : "memory" );
- return dest;
-}
-
-#define __HAVE_ARCH_STRCMP
-static inline int strcmp(const char *cs, const char *ct)
-{
- long d0, d1;
- register int __res;
- __asm__ __volatile__ (
- "1: lodsb \n"
- " scasb \n"
- " jne 2f \n"
- " test %%al,%%al \n"
- " jne 1b \n"
- " xor %%eax,%%eax\n"
- " jmp 3f \n"
- "2: sbb %%eax,%%eax\n"
- " or $1,%%al \n"
- "3: \n"
- : "=a" (__res), "=&S" (d0), "=&D" (d1)
- : "1" (cs), "2" (ct) );
- return __res;
-}
-
-#define __HAVE_ARCH_STRNCMP
-static inline int strncmp(const char *cs, const char *ct, size_t count)
-{
- long d0, d1, d2;
- register int __res;
- __asm__ __volatile__ (
- "1: dec %3 \n"
- " js 2f \n"
- " lodsb \n"
- " scasb \n"
- " jne 3f \n"
- " test %%al,%%al \n"
- " jne 1b \n"
- "2: xor %%eax,%%eax\n"
- " jmp 4f \n"
- "3: sbb %%eax,%%eax\n"
- " or $1,%%al \n"
- "4: \n"
- : "=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
- : "1" (cs), "2" (ct), "3" (count) );
- return __res;
-}
-
-#define __HAVE_ARCH_STRCHR
-static inline char *strchr(const char *s, int c)
-{
- long d0;
- register char *__res;
- __asm__ __volatile__ (
- " mov %%al,%%ah \n"
- "1: lodsb \n"
- " cmp %%ah,%%al \n"
- " je 2f \n"
- " test %%al,%%al \n"
- " jne 1b \n"
- " mov $1,%1 \n"
- "2: mov %1,%0 \n"
- " dec %0 \n"
- : "=a" (__res), "=&S" (d0) : "1" (s), "0" (c) );
- return __res;
-}
-
-#define __HAVE_ARCH_STRLEN
-static inline size_t strlen(const char *s)
-{
- long d0;
- register int __res;
- __asm__ __volatile__ (
- " repne ; scasb \n"
- " notl %0 \n"
- " decl %0 \n"
- : "=c" (__res), "=&D" (d0) : "1" (s), "a" (0), "0" (0xffffffffUL) );
- return __res;
-}

static inline void *__variable_memcpy(void *to, const void *from, size_t n)
{

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog
Remove broken inline-asm string functions from Xen/x86. The [ In reply to ]
# HG changeset patch
# User kaf24@firebug.cl.cam.ac.uk
# Node ID f75e01cfde7613b0fcd0a5dce41765df75af044f
# Parent 1405615a31d52bfcc75593bcad2ec8d4f21fff21
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>
xen-unstable changeset: 10144:1345b20cca565950c0209971a0a71d19498cc765
xen-unstable date: Wed May 24 11:52:25 2006 +0100
---
xen/include/asm-x86/string.h | 146 -------------------------------------------
1 files changed, 146 deletions(-)

diff -r 1405615a31d5 -r f75e01cfde76 xen/include/asm-x86/string.h
--- a/xen/include/asm-x86/string.h Fri May 19 16:14:54 2006 +0100
+++ b/xen/include/asm-x86/string.h Wed May 24 11:54:00 2006 +0100
@@ -2,152 +2,6 @@
#define __X86_STRING_H__

#include <xen/config.h>
-
-#define __HAVE_ARCH_STRCPY
-static inline char *strcpy(char *dest, const char *src)
-{
- long d0, d1, d2;
- __asm__ __volatile__ (
- "1: lodsb \n"
- " stosb \n"
- " test %%al,%%al \n"
- " jne 1b \n"
- : "=&S" (d0), "=&D" (d1), "=&a" (d2)
- : "0" (src), "1" (dest) : "memory" );
- return dest;
-}
-
-#define __HAVE_ARCH_STRNCPY
-static inline char *strncpy(char *dest, const char *src, size_t count)
-{
- long d0, d1, d2, d3;
- __asm__ __volatile__ (
- "1: dec %2 \n"
- " js 2f \n"
- " lodsb \n"
- " stosb \n"
- " test %%al,%%al \n"
- " jne 1b \n"
- " rep ; stosb \n"
- "2: \n"
- : "=&S" (d0), "=&D" (d1), "=&c" (d2), "=&a" (d3)
- : "0" (src), "1" (dest), "2" (count) : "memory" );
- return dest;
-}
-
-#define __HAVE_ARCH_STRCAT
-static inline char *strcat(char *dest, const char *src)
-{
- long d0, d1, d2, d3;
- __asm__ __volatile__ (
- " repne ; scasb \n"
- " dec %1 \n"
- "1: lodsb \n"
- " stosb \n"
- " test %%al,%%al \n"
- " jne 1b \n"
- : "=&S" (d0), "=&D" (d1), "=&a" (d2), "=&c" (d3)
- : "0" (src), "1" (dest), "2" (0UL), "3" (0xffffffffUL) : "memory" );
- return dest;
-}
-
-#define __HAVE_ARCH_STRNCAT
-static inline char *strncat(char *dest, const char *src, size_t count)
-{
- long d0, d1, d2, d3;
- __asm__ __volatile__ (
- " repne ; scasb \n"
- " dec %1 \n"
- " mov %8,%3 \n"
- "1: dec %3 \n"
- " js 2f \n"
- " lodsb \n"
- " stosb \n"
- " test %%al,%%al \n"
- " jne 1b \n"
- "2: xor %%eax,%%eax\n"
- " stosb"
- : "=&S" (d0), "=&D" (d1), "=&a" (d2), "=&c" (d3)
- : "0" (src), "1" (dest), "2" (0UL), "3" (0xffffffffUL), "g" (count)
- : "memory" );
- return dest;
-}
-
-#define __HAVE_ARCH_STRCMP
-static inline int strcmp(const char *cs, const char *ct)
-{
- long d0, d1;
- register int __res;
- __asm__ __volatile__ (
- "1: lodsb \n"
- " scasb \n"
- " jne 2f \n"
- " test %%al,%%al \n"
- " jne 1b \n"
- " xor %%eax,%%eax\n"
- " jmp 3f \n"
- "2: sbb %%eax,%%eax\n"
- " or $1,%%al \n"
- "3: \n"
- : "=a" (__res), "=&S" (d0), "=&D" (d1)
- : "1" (cs), "2" (ct) );
- return __res;
-}
-
-#define __HAVE_ARCH_STRNCMP
-static inline int strncmp(const char *cs, const char *ct, size_t count)
-{
- long d0, d1, d2;
- register int __res;
- __asm__ __volatile__ (
- "1: dec %3 \n"
- " js 2f \n"
- " lodsb \n"
- " scasb \n"
- " jne 3f \n"
- " test %%al,%%al \n"
- " jne 1b \n"
- "2: xor %%eax,%%eax\n"
- " jmp 4f \n"
- "3: sbb %%eax,%%eax\n"
- " or $1,%%al \n"
- "4: \n"
- : "=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
- : "1" (cs), "2" (ct), "3" (count) );
- return __res;
-}
-
-#define __HAVE_ARCH_STRCHR
-static inline char *strchr(const char *s, int c)
-{
- long d0;
- register char *__res;
- __asm__ __volatile__ (
- " mov %%al,%%ah \n"
- "1: lodsb \n"
- " cmp %%ah,%%al \n"
- " je 2f \n"
- " test %%al,%%al \n"
- " jne 1b \n"
- " mov $1,%1 \n"
- "2: mov %1,%0 \n"
- " dec %0 \n"
- : "=a" (__res), "=&S" (d0) : "1" (s), "0" (c) );
- return __res;
-}
-
-#define __HAVE_ARCH_STRLEN
-static inline size_t strlen(const char *s)
-{
- long d0;
- register int __res;
- __asm__ __volatile__ (
- " repne ; scasb \n"
- " notl %0 \n"
- " decl %0 \n"
- : "=c" (__res), "=&D" (d0) : "1" (s), "a" (0), "0" (0xffffffffUL) );
- return __res;
-}

static inline void *__variable_memcpy(void *to, const void *from, size_t n)
{

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog