Non inlined memcpy for ia32

From: Philipp Thomas (pthomas@suse.de)
Date: Sat Jun 17 2000 - 14:36:53 EST


Alan,

here's a patch to provide a non inlined memcpy for ia32 for those cases
where gcc 2.96 will issue libcalls. Linus already wrote me that he'd accept
a patch providing this.

Philipp

--- linux/arch/i386/lib/Makefile.original Sat Jun 17 21:22:53 2000
+++ linux/arch/i386/lib/Makefile Fri Jun 2 02:42:21 2000
@@ -7,7 +7,7 @@
 
 L_TARGET = lib.a
 L_OBJS = checksum.o old-checksum.o delay.o \
- usercopy.o getuser.o putuser.o iodebug.o
+ usercopy.o getuser.o putuser.o iodebug.o memcpy.o
 
 ifdef CONFIG_X86_USE_3DNOW
 L_OBJS += mmx.o

--- linux/arch/i386/lib/memcpy.c Fri Jun 2 10:53:43 2000
+++ linux/arch/i386/lib/memcpy.c Sat Jun 17 21:22:01 2000
@@ -0,0 +1,18 @@
+/* Non inlined version of memcpy for those cases where gcc will issue a
+ * libcall instead of generating inline code. This of cause can only use the
+ * non const versions of __memcpy.
+ */
+
+#include <linux/types.h>
+#include <linux/string.h>
+
+#undef memcpy
+
+void *memcpy(void * to, const void * from, size_t len)
+{
+#ifdef CONFIG_X86_USE_3DNOW
+ return __memcpy3d(to, from, len);
+#else
+ return __memcpy(to, from, len);
+#endif
+}

-- 
Philipp Thomas <pthomas@suse.de>
Development, SuSE GmbH, Schanzaecker Str. 10, D-90443 Nuremberg, Germany

#define NINODE 50 /* number of in core inodes */ #define NPROC 30 /* max number of processes */ -- Version 7 UNIX for PDP 11, /usr/include/sys/param.h

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:14 EST