summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--memdisk/memcpy.S29
1 files changed, 29 insertions, 0 deletions
diff --git a/memdisk/memcpy.S b/memdisk/memcpy.S
new file mode 100644
index 00000000..61c35b9b
--- /dev/null
+++ b/memdisk/memcpy.S
@@ -0,0 +1,29 @@
+# $Id$
+#
+# memcpy.S
+#
+# Simple memcpy() implementation
+#
+
+ .text
+ .globl memcpy
+ .type memcpy, @function
+memcpy:
+ cld
+ pushl %edi
+ pushl %esi
+ movl 12(%esp),%edi
+ movl 16(%esp),%esi
+ movl 20(%esp),%eax
+ movl %eax,%ecx
+ shrl $2,%ecx
+ rep ; movsl
+ movl %eax,%ecx
+ andl $3,%ecx
+ rep ; movsb
+ movl 12(%esp),%eax
+ popl %esi
+ popl %edi
+ ret
+
+ .size memcpy,.-memcpy