From 0bfb069f8619a16b6d69657967d3a389af47a93d Mon Sep 17 00:00:00 2001 From: imp Date: Thu, 10 May 2018 02:31:48 +0000 Subject: [PATCH] Simplify things a little Rather than include a copy for memmove to call bcopy to call memcpy (which handles overlapping copies), make memmove a strong reference to memcpy to save the two calls. Differential Revision: https://reviews.freebsd.org/D15374 --- sys/conf/files.powerpc | 1 - sys/conf/files.riscv | 1 - sys/libkern/bcopy.c | 6 ++++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc index 4ecb62bbf881..47bb54ab9b34 100644 --- a/sys/conf/files.powerpc +++ b/sys/conf/files.powerpc @@ -95,7 +95,6 @@ libkern/fls.c standard libkern/flsl.c standard libkern/flsll.c standard libkern/lshrdi3.c optional powerpc | powerpcspe -libkern/memmove.c standard libkern/memset.c standard libkern/moddi3.c optional powerpc | powerpcspe libkern/qdivrem.c optional powerpc | powerpcspe diff --git a/sys/conf/files.riscv b/sys/conf/files.riscv index 24982606aadf..fef89ddec386 100644 --- a/sys/conf/files.riscv +++ b/sys/conf/files.riscv @@ -19,7 +19,6 @@ libkern/ffsll.c standard libkern/fls.c standard libkern/flsl.c standard libkern/flsll.c standard -libkern/memmove.c standard libkern/memset.c standard riscv/riscv/autoconf.c standard riscv/riscv/bus_machdep.c standard diff --git a/sys/libkern/bcopy.c b/sys/libkern/bcopy.c index 3d131eb48f9d..1469cb1b707e 100644 --- a/sys/libkern/bcopy.c +++ b/sys/libkern/bcopy.c @@ -50,6 +50,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#undef memcpy +#undef memmove +#undef bcopy + /* * sizeof(word) MUST BE A POWER OF TWO * SO THAT wmask BELOW IS ALL ONES @@ -142,6 +146,8 @@ done: return (dst0); } +__strong_reference(memcpy, memmove); + void (bcopy)(const void *src0, void *dst0, size_t length) {