memcpy() and memmove() must return the first parameter.

Problem found by itohy, fixed by SHIMIZU Ryo.
This commit is contained in:
itohy 2002-11-20 09:50:37 +00:00
parent a0d341067e
commit 766d863c42
1 changed files with 11 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcopy.S,v 1.2 2000/06/09 04:42:46 msaitoh Exp $ */
/* $NetBSD: bcopy.S,v 1.3 2002/11/20 09:50:37 itohy Exp $ */
/*
* Copyright (c) 2000 SHIMIZU Ryo <ryo@misakimix.org>
@ -29,15 +29,17 @@
#include <machine/asm.h>
#define REG_SRC r4
#define REG_DST r5
#define REG_LEN r6
#define REG_DST0 r3
#define REG_SRC r4
#define REG_DST r5
#define REG_LEN r6
ENTRY(memcpy)
ALTENTRY(memmove)
mov r4,r0 /* memcpy(dst,src,len) -> bcopy(src,dst,len) */
mov r5,r4
mov r0,r5
/* memcpy(dst,src,len) -> bcopy(src,dst,len) */
mov r4,r3 /* dst0 = dst */
mov r5,r4 /* dst = src */
mov r3,r5 /* src = dst0 */
/* fall through */
ALTENTRY(bcopy)
@ -141,7 +143,7 @@ no_align_delay:
add #1,REG_DST /* } */
bcopy_return:
rts
nop
mov REG_DST0,r0
bcopy_overlap:
@ -243,5 +245,5 @@ ov_no_align_delay:
mov.b r0,@-REG_DST /* } */
9:
rts
nop
mov REG_DST0,r0