i386: prepare shared lib/memcpy.c
authorThomas Gleixner <tglx@linutronix.de>
Thu, 11 Oct 2007 09:13:26 +0000 (11:13 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 11 Oct 2007 09:13:26 +0000 (11:13 +0200)
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/i386/lib/Makefile
arch/i386/lib/memcpy.c [deleted file]
arch/i386/lib/memcpy_32.c [new file with mode: 0644]

index dce510d443aaa466fb9e156e05cc0fa293ceb047..af7f9435d203dde18fd5cbf6965828f7ff4f72fe 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 
-lib-y = checksum_32.o delay.o usercopy.o getuser.o putuser.o memcpy.o strstr_32.o \
+lib-y = checksum_32.o delay.o usercopy.o getuser.o putuser.o memcpy_32.o strstr_32.o \
        bitops.o semaphore_32.o string_32.o
 
 lib-$(CONFIG_X86_USE_3DNOW) += mmx.o
diff --git a/arch/i386/lib/memcpy.c b/arch/i386/lib/memcpy.c
deleted file mode 100644 (file)
index 8ac51b8..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#include <linux/string.h>
-#include <linux/module.h>
-
-#undef memcpy
-#undef memset
-
-void *memcpy(void *to, const void *from, size_t n)
-{
-#ifdef CONFIG_X86_USE_3DNOW
-       return __memcpy3d(to, from, n);
-#else
-       return __memcpy(to, from, n);
-#endif
-}
-EXPORT_SYMBOL(memcpy);
-
-void *memset(void *s, int c, size_t count)
-{
-       return __memset(s, c, count);
-}
-EXPORT_SYMBOL(memset);
-
-void *memmove(void *dest, const void *src, size_t n)
-{
-       int d0, d1, d2;
-
-       if (dest < src) {
-               memcpy(dest,src,n);
-       } else {
-               __asm__ __volatile__(
-                       "std\n\t"
-                       "rep\n\t"
-                       "movsb\n\t"
-                       "cld"
-                       : "=&c" (d0), "=&S" (d1), "=&D" (d2)
-                       :"0" (n),
-                        "1" (n-1+(const char *)src),
-                        "2" (n-1+(char *)dest)
-                       :"memory");
-       }
-       return dest;
-}
-EXPORT_SYMBOL(memmove);
diff --git a/arch/i386/lib/memcpy_32.c b/arch/i386/lib/memcpy_32.c
new file mode 100644 (file)
index 0000000..8ac51b8
--- /dev/null
@@ -0,0 +1,43 @@
+#include <linux/string.h>
+#include <linux/module.h>
+
+#undef memcpy
+#undef memset
+
+void *memcpy(void *to, const void *from, size_t n)
+{
+#ifdef CONFIG_X86_USE_3DNOW
+       return __memcpy3d(to, from, n);
+#else
+       return __memcpy(to, from, n);
+#endif
+}
+EXPORT_SYMBOL(memcpy);
+
+void *memset(void *s, int c, size_t count)
+{
+       return __memset(s, c, count);
+}
+EXPORT_SYMBOL(memset);
+
+void *memmove(void *dest, const void *src, size_t n)
+{
+       int d0, d1, d2;
+
+       if (dest < src) {
+               memcpy(dest,src,n);
+       } else {
+               __asm__ __volatile__(
+                       "std\n\t"
+                       "rep\n\t"
+                       "movsb\n\t"
+                       "cld"
+                       : "=&c" (d0), "=&S" (d1), "=&D" (d2)
+                       :"0" (n),
+                        "1" (n-1+(const char *)src),
+                        "2" (n-1+(char *)dest)
+                       :"memory");
+       }
+       return dest;
+}
+EXPORT_SYMBOL(memmove);