Blame SOURCES/glibc-rh1505492-undef-32.patch

25845f
commit 99f8dc922033821edcc13f9f8360e9fda40dfcff
25845f
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
25845f
Date:   Thu Jul 3 01:28:45 2014 +0530
25845f
25845f
    Fix -Wundef warning on PAGE_COPY_THRESHOLD
25845f
    
25845f
    The PAGE_COPY_THRESHOLD macro is meant to be overridden by
25845f
    architecture-specific pagecopy.h, but it is currently done only by
25845f
    mach; all other architectures use the default.  Check to see if the
25845f
    macro is defined in addition to whether it is set to a non-zero value.
25845f
25845f
Conflicts:
25845f
	sysdeps/generic/pagecopy.h
25845f
25845f
Due to copyright header change.
25845f
25845f
diff --git a/debug/memcpy_chk.c b/debug/memcpy_chk.c
25845f
index bd43583ff4239c8a..4af85a8cb8f5c8de 100644
25845f
--- a/debug/memcpy_chk.c
25845f
+++ b/debug/memcpy_chk.c
25845f
@@ -20,7 +20,6 @@
25845f
 
25845f
 #include <string.h>
25845f
 #include <memcopy.h>
25845f
-#include <pagecopy.h>
25845f
 
25845f
 void *
25845f
 __memcpy_chk (dstpp, srcpp, len, dstlen)
25845f
diff --git a/debug/mempcpy_chk.c b/debug/mempcpy_chk.c
25845f
index 8e26953764ff1b35..9a4f0e2fbcdde951 100644
25845f
--- a/debug/mempcpy_chk.c
25845f
+++ b/debug/mempcpy_chk.c
25845f
@@ -21,7 +21,6 @@
25845f
 
25845f
 #include <string.h>
25845f
 #include <memcopy.h>
25845f
-#include <pagecopy.h>
25845f
 
25845f
 void *
25845f
 __mempcpy_chk (dstpp, srcpp, len, dstlen)
25845f
diff --git a/string/memcpy.c b/string/memcpy.c
25845f
index 3080fcb4de4cec83..fa1ec24eaca527c4 100644
25845f
--- a/string/memcpy.c
25845f
+++ b/string/memcpy.c
25845f
@@ -20,7 +20,6 @@
25845f
 
25845f
 #include <string.h>
25845f
 #include <memcopy.h>
25845f
-#include <pagecopy.h>
25845f
 
25845f
 #undef memcpy
25845f
 
25845f
diff --git a/string/memmove.c b/string/memmove.c
25845f
index c59e7a9c2a640f7d..51bff31c0530ba91 100644
25845f
--- a/string/memmove.c
25845f
+++ b/string/memmove.c
25845f
@@ -20,7 +20,6 @@
25845f
 
25845f
 #include <string.h>
25845f
 #include <memcopy.h>
25845f
-#include <pagecopy.h>
25845f
 
25845f
 /* All this is so that bcopy.c can #include
25845f
    this file after defining some things.  */
25845f
diff --git a/sysdeps/generic/memcopy.h b/sysdeps/generic/memcopy.h
25845f
index 08892a4ea33f1ca7..d0ffcd33b007ba38 100644
25845f
--- a/sysdeps/generic/memcopy.h
25845f
+++ b/sysdeps/generic/memcopy.h
25845f
@@ -40,6 +40,7 @@
25845f
 
25845f
 #include <sys/cdefs.h>
25845f
 #include <endian.h>
25845f
+#include <pagecopy.h>
25845f
 
25845f
 /* The macros defined in this file are:
25845f
 
25845f
@@ -144,6 +145,47 @@ extern void _wordcopy_bwd_dest_aligned (long int, long int, size_t) __THROW;
25845f
       (nbytes_left) = (nbytes) % OPSIZ;					      \
25845f
     } while (0)
25845f
 
25845f
+/* The macro PAGE_COPY_FWD_MAYBE (dstp, srcp, nbytes_left, nbytes) is invoked
25845f
+   like WORD_COPY_FWD et al.  The pointers should be at least word aligned.
25845f
+   This will check if virtual copying by pages can and should be done and do it
25845f
+   if so.  The pointers will be aligned to PAGE_SIZE bytes.  The macro requires
25845f
+   that pagecopy.h defines at least PAGE_COPY_THRESHOLD to 0.  If
25845f
+   PAGE_COPY_THRESHOLD is non-zero, the header must also define PAGE_COPY_FWD
25845f
+   and PAGE_SIZE.
25845f
+*/
25845f
+#if PAGE_COPY_THRESHOLD
25845f
+
25845f
+# include <assert.h>
25845f
+
25845f
+# define PAGE_COPY_FWD_MAYBE(dstp, srcp, nbytes_left, nbytes)		      \
25845f
+  do									      \
25845f
+    {									      \
25845f
+      if ((nbytes) >= PAGE_COPY_THRESHOLD &&				      \
25845f
+	  PAGE_OFFSET ((dstp) - (srcp)) == 0) 				      \
25845f
+	{								      \
25845f
+	  /* The amount to copy is past the threshold for copying	      \
25845f
+	     pages virtually with kernel VM operations, and the		      \
25845f
+	     source and destination addresses have the same alignment.  */    \
25845f
+	  size_t nbytes_before = PAGE_OFFSET (-(dstp));			      \
25845f
+	  if (nbytes_before != 0)					      \
25845f
+	    {								      \
25845f
+	      /* First copy the words before the first page boundary.  */     \
25845f
+	      WORD_COPY_FWD (dstp, srcp, nbytes_left, nbytes_before);	      \
25845f
+	      assert (nbytes_left == 0);				      \
25845f
+	      nbytes -= nbytes_before;					      \
25845f
+	    }								      \
25845f
+	  PAGE_COPY_FWD (dstp, srcp, nbytes_left, nbytes);		      \
25845f
+	}								      \
25845f
+    } while (0)
25845f
+
25845f
+/* The page size is always a power of two, so we can avoid modulo division.  */
25845f
+# define PAGE_OFFSET(n)	((n) & (PAGE_SIZE - 1))
25845f
+
25845f
+#else
25845f
+
25845f
+# define PAGE_COPY_FWD_MAYBE(dstp, srcp, nbytes_left, nbytes) /* nada */
25845f
+
25845f
+#endif
25845f
 
25845f
 /* Threshold value for when to enter the unrolled loops.  */
25845f
 #define	OP_T_THRES	16
25845f
diff --git a/sysdeps/generic/pagecopy.h b/sysdeps/generic/pagecopy.h
25845f
index 89f392cb43c4dcbc..3c81de1b236486bf 100644
25845f
--- a/sysdeps/generic/pagecopy.h
25845f
+++ b/sysdeps/generic/pagecopy.h
25845f
@@ -1,5 +1,5 @@
25845f
-/* Macros for copying by pages; used in memcpy, memmove.  Generic macros.
25845f
-   Copyright (C) 1995, 1997 Free Software Foundation, Inc.
25845f
+/* Macros for copying by pages; used in memcpy, memmove.
25845f
+   Copyright (C) 1995-2014 Free Software Foundation, Inc.
25845f
    This file is part of the GNU C Library.
25845f
 
25845f
    The GNU C Library is free software; you can redistribute it and/or
25845f
@@ -16,19 +16,15 @@
25845f
    License along with the GNU C Library; if not, see
25845f
    <http://www.gnu.org/licenses/>.  */
25845f
 
25845f
-/* This file defines the macro:
25845f
+/* The macro PAGE_COPY_FWD_MAYBE defined in memcopy.h is used in memmove if the
25845f
+   PAGE_COPY_THRESHOLD macro is set to a non-zero value.  The default is 0,
25845f
+   that is copying by pages is not implemented.
25845f
 
25845f
-   PAGE_COPY_FWD_MAYBE (dstp, srcp, nbytes_left, nbytes)
25845f
-
25845f
-   which is invoked like WORD_COPY_FWD et al.  The pointers should be at
25845f
-   least word aligned.  This will check if virtual copying by pages can and
25845f
-   should be done and do it if so.
25845f
-
25845f
-   System-specific pagecopy.h files should define these macros and then
25845f
-   #include this file:
25845f
+   System-specific pagecopy.h files that want to support page copying should
25845f
+   define these macros:
25845f
 
25845f
    PAGE_COPY_THRESHOLD
25845f
-   -- Minimum size for which virtual copying by pages is worthwhile.
25845f
+   -- A non-zero minimum size for which virtual copying by pages is worthwhile.
25845f
 
25845f
    PAGE_SIZE
25845f
    -- Size of a page.
25845f
@@ -38,37 +34,4 @@
25845f
    The pointers will be aligned to PAGE_SIZE bytes.
25845f
 */
25845f
 
25845f
-
25845f
-#if PAGE_COPY_THRESHOLD
25845f
-
25845f
-#include <assert.h>
25845f
-
25845f
-#define PAGE_COPY_FWD_MAYBE(dstp, srcp, nbytes_left, nbytes)		      \
25845f
-  do									      \
25845f
-    {									      \
25845f
-      if ((nbytes) >= PAGE_COPY_THRESHOLD &&				      \
25845f
-	  PAGE_OFFSET ((dstp) - (srcp)) == 0) 				      \
25845f
-	{								      \
25845f
-	  /* The amount to copy is past the threshold for copying	      \
25845f
-	     pages virtually with kernel VM operations, and the		      \
25845f
-	     source and destination addresses have the same alignment.  */    \
25845f
-	  size_t nbytes_before = PAGE_OFFSET (-(dstp));			      \
25845f
-	  if (nbytes_before != 0)					      \
25845f
-	    {								      \
25845f
-	      /* First copy the words before the first page boundary.  */     \
25845f
-	      WORD_COPY_FWD (dstp, srcp, nbytes_left, nbytes_before);	      \
25845f
-	      assert (nbytes_left == 0);				      \
25845f
-	      nbytes -= nbytes_before;					      \
25845f
-	    }								      \
25845f
-	  PAGE_COPY_FWD (dstp, srcp, nbytes_left, nbytes);		      \
25845f
-	}								      \
25845f
-    } while (0)
25845f
-
25845f
-/* The page size is always a power of two, so we can avoid modulo division.  */
25845f
-#define PAGE_OFFSET(n)	((n) & (PAGE_SIZE - 1))
25845f
-
25845f
-#else
25845f
-
25845f
-#define PAGE_COPY_FWD_MAYBE(dstp, srcp, nbytes_left, nbytes) /* nada */
25845f
-
25845f
-#endif
25845f
+#define PAGE_COPY_THRESHOLD 0
25845f
diff --git a/sysdeps/mach/pagecopy.h b/sysdeps/mach/pagecopy.h
25845f
index 5b212144b7b163fe..8cce76a6d76698b9 100644
25845f
--- a/sysdeps/mach/pagecopy.h
25845f
+++ b/sysdeps/mach/pagecopy.h
25845f
@@ -30,6 +30,3 @@
25845f
 				(vm_address_t) dstp) == KERN_SUCCESS	      \
25845f
 		     ? trunc_page (nbytes)				      \
25845f
 		     : 0)))
25845f
-
25845f
-/* Get the generic macro.  */
25845f
-#include <sysdeps/generic/pagecopy.h>
25845f
diff --git a/sysdeps/powerpc/memmove.c b/sysdeps/powerpc/memmove.c
25845f
index 1617ecea95620133..50734e45458352c5 100644
25845f
--- a/sysdeps/powerpc/memmove.c
25845f
+++ b/sysdeps/powerpc/memmove.c
25845f
@@ -20,7 +20,6 @@
25845f
 
25845f
 #include <string.h>
25845f
 #include <memcopy.h>
25845f
-#include <pagecopy.h>
25845f
 
25845f
 /* All this is so that bcopy.c can #include
25845f
    this file after defining some things.  */