From fd78b0866fe95728b378cffba4f2f189c32a5ad0 Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Mon, 1 May 2000 00:43:42 +0000 Subject: cleaner and righter memcmp/memcpy --- sys/arch/i386/i386/locore.s | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'sys') diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s index d02dfe137aa..5600f8c33c3 100644 --- a/sys/arch/i386/i386/locore.s +++ b/sys/arch/i386/i386/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.49 2000/04/30 18:48:58 millert Exp $ */ +/* $OpenBSD: locore.s,v 1.50 2000/05/01 00:43:41 mickey Exp $ */ /* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */ /*- @@ -895,27 +895,19 @@ ENTRY(bcopy) * 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 + movl 4(%esp),%ecx + xchg 8(%esp),%ecx + movl %ecx,4(%esp) + jmp _bcopy /* * 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 + movl 4(%esp),%ecx + xchg 8(%esp),%ecx + movl %ecx,4(%esp) + jmp _bcmp /*****************************************************************************/ -- cgit v1.2.3