Index: sys/conf/files.i386 =================================================================== --- sys/conf/files.i386 +++ sys/conf/files.i386 @@ -553,7 +553,6 @@ libkern/divdi3.c standard libkern/ffsll.c standard libkern/flsll.c standard -libkern/memmove.c standard libkern/memset.c standard libkern/moddi3.c standard libkern/qdivrem.c standard Index: sys/conf/files.mips =================================================================== --- sys/conf/files.mips +++ sys/conf/files.mips @@ -61,7 +61,6 @@ libkern/fls.c standard libkern/flsl.c standard libkern/flsll.c standard -libkern/memmove.c standard libkern/cmpdi2.c optional mips | mipshf | mipsel | mipselhf libkern/ucmpdi2.c optional mips | mipshf | mipsel | mipselhf libkern/ashldi3.c standard Index: sys/conf/files.sparc64 =================================================================== --- sys/conf/files.sparc64 +++ sys/conf/files.sparc64 @@ -71,7 +71,6 @@ libkern/fls.c standard libkern/flsl.c standard libkern/flsll.c standard -libkern/memmove.c standard sparc64/central/central.c optional central sparc64/ebus/ebus.c optional ebus sparc64/ebus/epic.c optional epic ebus Index: sys/i386/i386/support.s =================================================================== --- sys/i386/i386/support.s +++ sys/i386/i386/support.s @@ -146,6 +146,7 @@ END(fillw) /* + * memmove(dst, src, cnt) (return dst) * bcopy(src, dst, cnt) * ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800 */ @@ -156,6 +157,15 @@ pushl %edi movl 8(%ebp),%esi movl 12(%ebp),%edi + jmp 1f +ALTENTRY(memmove) + pushl %ebp + movl %esp,%ebp + pushl %esi + pushl %edi + movl 8(%ebp),%edi + movl 12(%ebp),%esi +1: movl 16(%ebp),%ecx movl %edi,%eax @@ -172,6 +182,7 @@ movsb popl %edi popl %esi + movl 8(%ebp),%eax /* return dst for memmove */ popl %ebp ret @@ -194,6 +205,7 @@ popl %edi popl %esi cld + movl 8(%ebp),%eax /* return dst for memmove */ popl %ebp ret END(bcopy) Index: sys/libkern/memmove.c =================================================================== --- sys/libkern/memmove.c +++ /dev/null @@ -1,40 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2009 Roman Divacky - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. -*/ - -#include -__FBSDID("$FreeBSD$"); - -#include - -void * -memmove(void *dest, const void *src, size_t n) -{ - - bcopy(src, dest, n); - return (dest); -} Index: sys/mips/mips/bcopy.S =================================================================== --- sys/mips/mips/bcopy.S +++ sys/mips/mips/bcopy.S @@ -65,6 +65,7 @@ #define SIZEREG a2 LEAF(memcpy) +XLEAF(memmove) .set noat .set noreorder Index: sys/sparc64/sparc64/support.S =================================================================== --- sys/sparc64/sparc64/support.S +++ sys/sparc64/sparc64/support.S @@ -265,9 +265,17 @@ END(bcmp) /* + * void *memmove(void *dst, const void *src, size_t len) * void bcopy(const void *src, void *dst, size_t len) */ -ENTRY(bcopy) +ENTRY(memmove) + /* + * Swap src/dst for memmove/bcopy differences + */ + mov %o0, %o6 + mov %o1, %o0 + mov %o6, %o1 +ALTENTRY(bcopy) /* * Check for overlap, and copy backwards if so. */ @@ -290,15 +298,15 @@ ba %xcc, 1b stb %g1, [%o1] 2: retl - nop + mov %o6, %o0 /* * Do the fast version. */ 3: _MEMCPY(%o1, %o0, %o2, EMPTY, EMPTY, EMPTY, EMPTY) retl - nop -END(bcopy) + mov %o6, %o0 +END(memmove) /* * void bzero(void *b, size_t len)