Get rid of pointer wraparound check. Ok'ed by TAMURA Kent.

This commit is contained in:
junyoung 2002-10-29 06:35:17 +00:00
parent 34c993950b
commit 7f21deb763

View File

@ -36,7 +36,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS)
RCSID("$NetBSD: bcopy.S,v 1.8 2002/07/10 06:01:51 kent Exp $")
RCSID("$NetBSD: bcopy.S,v 1.9 2002/10/29 06:35:17 junyoung Exp $")
#endif
/*
@ -83,42 +83,6 @@ ENTRY(bcopy)
1:
addl %ecx,%edi /* copy backwards. */
addl %ecx,%esi
#ifdef _DIAGNOSTIC
/* check pointer wraparound */
#if defined(MEMCOPY) || defined(MEMMOVE)
cmpl 12(%esp),%edi
#else
cmpl 16(%esp),%edi
#endif
jae 2f
pushl $diagmes1
pushl $func
pushl $__LINE__-4
jmp 4f
2:
#if defined(MEMCOPY) || defined(MEMMOVE)
cmpl 16(%esp),%esi
#else
cmpl 12(%esp),%esi
#endif
jae 3f
pushl $diagmes2
pushl $func
pushl $__LINE__-4
4:
pushl $file
call _C_LABEL(__diagassert13)
addl $16,%esp
#if defined(MEMCOPY) || defined(MEMMOVE)
movl 12(%esp),%eax
#endif
popl %edi
popl %esi
ret
3:
#endif /* _DIAGNOSTIC */
std
andl $3,%ecx /* any fractional bytes? */
decl %edi
@ -135,20 +99,3 @@ ENTRY(bcopy)
popl %esi
cld
ret
#ifdef _DIAGNOSTIC
file:
.asciz __FILE__
func:
#if defined(MEMCOPY)
.asciz "memcpy"
#elseif defined(MEMMOVE)
.asciz "memmove"
#else
.asciz "bcopy"
#endif
diagmes1:
.asciz "src + length > src"
diagmes2:
.asciz "dst + length > dst"
#endif /* _DIAGNOSTIC */