WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] x86_64 gcc sometimes doesn't have builtin memmove. Alway

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] x86_64 gcc sometimes doesn't have builtin memmove. Always use the
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Sat, 07 May 2005 10:14:55 +0000
Delivery-date: Sat, 07 May 2005 11:03:02 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1453, 2005/05/07 11:14:55+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        x86_64 gcc sometimes doesn't have builtin memmove. Always use the
        version we provide.
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 arch/x86/string.c               |   38 +++++++++++++++++++-------------------
 include/asm-x86/x86_64/string.h |    8 ++++----
 2 files changed, 23 insertions(+), 23 deletions(-)


diff -Nru a/xen/arch/x86/string.c b/xen/arch/x86/string.c
--- a/xen/arch/x86/string.c     2005-05-07 07:03:34 -04:00
+++ b/xen/arch/x86/string.c     2005-05-07 07:03:34 -04:00
@@ -8,25 +8,6 @@
 #include <xen/config.h>
 #include <xen/lib.h>
 
-#undef memmove
-void *memmove(void *dest, const void *src, size_t n)
-{
-    int d0, d1, d2;
- 
-    if ( dest < src )
-        return memcpy(dest, src, n);
-
-    __asm__ __volatile__ (
-        "   std         ; "
-        "   rep ; movsb ; "
-        "   cld           "
-        : "=&c" (d0), "=&S" (d1), "=&D" (d2)
-        : "0" (n), "1" (n-1+(const char *)src), "2" (n-1+(char *)dest)
-        : "memory");
-
-    return dest;
-}
-
 #undef memcpy
 void *memcpy(void *dest, const void *src, size_t n)
 {
@@ -60,4 +41,23 @@
         : "memory");
 
     return s;
+}
+
+#undef memmove
+void *memmove(void *dest, const void *src, size_t n)
+{
+    int d0, d1, d2;
+ 
+    if ( dest < src )
+        return memcpy(dest, src, n);
+
+    __asm__ __volatile__ (
+        "   std         ; "
+        "   rep ; movsb ; "
+        "   cld           "
+        : "=&c" (d0), "=&S" (d1), "=&D" (d2)
+        : "0" (n), "1" (n-1+(const char *)src), "2" (n-1+(char *)dest)
+        : "memory");
+
+    return dest;
 }
diff -Nru a/xen/include/asm-x86/x86_64/string.h 
b/xen/include/asm-x86/x86_64/string.h
--- a/xen/include/asm-x86/x86_64/string.h       2005-05-07 07:03:34 -04:00
+++ b/xen/include/asm-x86/x86_64/string.h       2005-05-07 07:03:34 -04:00
@@ -1,10 +1,6 @@
 #ifndef _X86_64_STRING_H_
 #define _X86_64_STRING_H_
 
-#define __HAVE_ARCH_MEMMOVE
-#define memmove(dest,src,n) (__memmove((dest),(src),(n)))
-#define __memmove(dest,src,n) (__builtin_memmove((dest),(src),(n)))
-
 #define __HAVE_ARCH_MEMCPY
 #define memcpy(t,f,n) (__memcpy((t),(f),(n)))
 #define __memcpy(t,f,n) (__builtin_memcpy((t),(f),(n)))
@@ -12,5 +8,9 @@
 #define __HAVE_ARCH_MEMSET
 #define memset(s, c, count) (__memset((s),(c),(count)))
 #define __memset(s, c, count) (__builtin_memset((s),(c),(count)))
+
+/* Some versions of 64-bit gcc don't have this built in. */
+#define __HAVE_ARCH_MEMMOVE
+extern void *memmove(void *dest, const void *src, size_t n);
 
 #endif

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] x86_64 gcc sometimes doesn't have builtin memmove. Always use the, BitKeeper Bot <=