aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--memdisk/memset.S30
1 files changed, 30 insertions, 0 deletions
diff --git a/memdisk/memset.S b/memdisk/memset.S
new file mode 100644
index 00000000..d7dabe12
--- /dev/null
+++ b/memdisk/memset.S
@@ -0,0 +1,30 @@
+# $Id$
+#
+# memset.S
+#
+# Simple memset() implementation
+#
+
+ .text
+ .globl memset
+ .type memset, @function
+memset:
+ cld
+ pushl %edi
+ pushl %esi
+ movl 12(%esp),%edi
+ movzbl 16(%esp),%eax
+ movl 20(%esp),%esi
+ imull $0x01010101,%eax
+ movl %esi,%ecx
+ shrl $2,%ecx
+ rep ; stosl
+ movl %esi,%ecx
+ andl $3,%ecx
+ rep ; stosb
+ movl 12(%esp),%eax
+ popl %esi
+ popl %edi
+ ret
+
+ .size memcpy,.-memcpy