about summary refs log tree commit diff
path: root/sysdeps/generic/memmove.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-02-21 08:07:34 +0000
committerRoland McGrath <roland@gnu.org>1995-02-21 08:07:34 +0000
commit67a87b936eaab25dc983e979e5a548256d1a527a (patch)
treecc821a229df7ee0d081df42258c31c241b78c0ef /sysdeps/generic/memmove.c
parent787126fe16e340c8a0c4301d4cab942973d7d85c (diff)
downloadglibc-67a87b936eaab25dc983e979e5a548256d1a527a.tar.gz
glibc-67a87b936eaab25dc983e979e5a548256d1a527a.tar.xz
glibc-67a87b936eaab25dc983e979e5a548256d1a527a.zip
* string/Makefile (distribute): Add pagecopy.h.
	* sysdeps/mach/pagecopy.h: New file.
	* sysdeps/generic/pagecopy.h: New file.
	* sysdeps/generic/memcpy.c: Include pagecopy.h; call
 	PAGE_COPY_FWD_MAYBE first when word aligned.
	* sysdeps/generic/memmove.c: Likewise.
Diffstat (limited to 'sysdeps/generic/memmove.c')
-rw-r--r--sysdeps/generic/memmove.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sysdeps/generic/memmove.c b/sysdeps/generic/memmove.c
index e3016819d9..8ef6f04cbe 100644
--- a/sysdeps/generic/memmove.c
+++ b/sysdeps/generic/memmove.c
@@ -1,6 +1,6 @@
 /* memmove -- copy memory to memory until the specified number of bytes
    has been copied.  Overlap is handled correctly.
-   Copyright (C) 1991 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1995 Free Software Foundation, Inc.
    Contributed by Torbjorn Granlund (tege@sics.se).
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@ Cambridge, MA 02139, USA.  */
 #include <ansidecl.h>
 #include <string.h>
 #include <memcopy.h>
+#include <pagecopy.h>
 
 /* All this is so that bcopy.c can #include
    this file after defining some things.  */
@@ -55,6 +56,11 @@ DEFUN(memmove, (a1, a2, len),
 	  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 argumnet, i.e. in LEN.  This number may