summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2000-04-30 18:48:59 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2000-04-30 18:48:59 +0000
commit1ed239e88a57ca7211745ceff4e0d6e365ca1426 (patch)
treec1a2ebb50773755a13d3b9c4a71f74a6caaff422 /sys/arch
parent314bee8994b145d5f603c50e93ebc9e623d1e038 (diff)
Add memcpy() and memcmp() emulation by swapping the first 2 args
and then calling the b* routine. This code only gets call when the kernel is build w/o -O* since otherwise gcc uses its own inline routines.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/i386/i386/locore.s28
1 files changed, 27 insertions, 1 deletions
diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s
index 78ff759f110..d02dfe137aa 100644
--- a/sys/arch/i386/i386/locore.s
+++ b/sys/arch/i386/i386/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.48 1999/03/08 23:47:26 downsj Exp $ */
+/* $OpenBSD: locore.s,v 1.49 2000/04/30 18:48:58 millert Exp $ */
/* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */
/*-
@@ -891,6 +891,32 @@ ENTRY(bcopy)
cld
ret
+/*
+ * Emulate memcpy() by swapping the first two arguments and calling bcopy()
+ */
+ENTRY(memcpy)
+ pushl %esi
+ movl 12(%esp),%ecx
+ movl 16(%esp),%esi
+ movl %esi,12(%esp)
+ movl %ecx,16(%esp)
+ call _bcopy
+ popl %esi
+ ret
+
+/*
+ * Emulate memcmp() by swapping the first two arguments and calling bcmp()
+ */
+ENTRY(memcmp)
+ pushl %esi
+ movl 12(%esp),%ecx
+ movl 16(%esp),%esi
+ movl %esi,12(%esp)
+ movl %ecx,16(%esp)
+ call _bcmp
+ popl %esi
+ ret
+
/*****************************************************************************/
/*