diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2013-03-03 17:10:55 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2013-03-03 17:10:55 +0000 |
commit | d15f124ff59606604c0243ee19cd67bc99ecd09f (patch) | |
tree | f0b18e431b15b797d5f5dc980928cd1a26b8f74a /libc/string/mempcpy.c | |
parent | c1078e9067234e88d5c1ca8af18ae67b64141d66 (diff) |
Merge changes between r22241 and r22552 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@22553 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/string/mempcpy.c')
-rw-r--r-- | libc/string/mempcpy.c | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/libc/string/mempcpy.c b/libc/string/mempcpy.c index ba4d1c6bc..c0d244820 100644 --- a/libc/string/mempcpy.c +++ b/libc/string/mempcpy.c @@ -20,48 +20,14 @@ <http://www.gnu.org/licenses/>. */ #include <string.h> -#include <memcopy.h> -#include <pagecopy.h> #undef mempcpy #undef __mempcpy void * -__mempcpy (dstpp, srcpp, len) - void *dstpp; - const void *srcpp; - size_t len; +__mempcpy (void *dest, const void *src, size_t len) { - unsigned long int dstp = (long int) dstpp; - unsigned long int srcp = (long int) srcpp; - - /* Copy from the beginning to the end. */ - - /* If there not too few bytes to copy, use word copy. */ - if (len >= OP_T_THRES) - { - /* Copy just a few bytes to make DSTP aligned. */ - len -= (-dstp) % OPSIZ; - BYTE_COPY_FWD (dstp, srcp, (-dstp) % OPSIZ); - - /* Copy whole pages from SRCP to DSTP by virtual address manipulation, - as much as possible. */ - - PAGE_COPY_FWD_MAYBE (dstp, srcp, len, len); - - /* Copy from SRCP to DSTP taking advantage of the known alignment of - DSTP. Number of bytes remaining is put in the third argument, - i.e. in LEN. This number may vary from machine to machine. */ - - WORD_COPY_FWD (dstp, srcp, len, len); - - /* Fall out and copy the tail. */ - } - - /* There are just a few bytes to copy. Use byte memory operations. */ - BYTE_COPY_FWD (dstp, srcp, len); - - return (void *) dstp; + return memcpy (dest, src, len) + len; } libc_hidden_def (__mempcpy) weak_alias (__mempcpy, mempcpy) |