about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGeoff Keating <geoffk@cygnus.com>2000-10-24 21:09:50 +0000
committerGeoff Keating <geoffk@cygnus.com>2000-10-24 21:09:50 +0000
commit0a1e7f70eb344d75df116940a5d887c6154a4b41 (patch)
treeacdf480444f1d8113fc9ef2f350b74137e3a7cf0
parent4b4fcf99d16d881e33308c3e333ab32dbb9b999b (diff)
downloadglibc-0a1e7f70eb344d75df116940a5d887c6154a4b41.tar.gz
glibc-0a1e7f70eb344d75df116940a5d887c6154a4b41.tar.xz
glibc-0a1e7f70eb344d75df116940a5d887c6154a4b41.zip
* sysdeps/unix/sysv/linux/powerpc/mmap64.c: Define PAGE_SHIFT
explicitly rather than getting it from <asm/page.h>.
2000-10-21  Geoffrey Keating  <geoffk@cygnus.com>

	* sysdeps/unix/sysv/linux/powerpc/mmap64.c: Define PAGE_SHIFT
	explicitly rather than getting it from <asm/page.h>.
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/mmap64.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index f5ef5bbf2d..e96abacf80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-10-21  Geoffrey Keating  <geoffk@cygnus.com>
+
+	* sysdeps/unix/sysv/linux/powerpc/mmap64.c: Define PAGE_SHIFT
+	explicitly rather than getting it from <asm/page.h>.
+
 2000-10-24  Ulrich Drepper  <drepper@redhat.com>
 
 	* elf/dl-close.c (_dl_close): Handle relocation dependencies of
diff --git a/sysdeps/unix/sysv/linux/powerpc/mmap64.c b/sysdeps/unix/sysv/linux/powerpc/mmap64.c
index f799b05106..076ceaa1c6 100644
--- a/sysdeps/unix/sysv/linux/powerpc/mmap64.c
+++ b/sysdeps/unix/sysv/linux/powerpc/mmap64.c
@@ -25,9 +25,12 @@
 #include <sys/syscall.h>
 #include <bp-checks.h>
 
-#include <asm/page.h>
 #include "kernel-features.h"
 
+/* This is always the constant 12 for this routine, even if the actual
+   page size is larger.  */
+#define PAGE_SHIFT 12
+
 #ifdef __NR_mmap2
 extern void *__unbounded __syscall_mmap2(void *__unbounded, size_t,
 					 int, int, int, off_t);
@@ -44,12 +47,11 @@ __mmap64 (__ptr_t addr, size_t len, int prot, int flags, int fd, off64_t offset)
 # ifndef __ASSUME_MMAP2_SYSCALL
       ! have_no_mmap2 &&
 # endif
-      ! (offset & ~PAGE_MASK))
+      ! (offset & -(1 << (PAGE_SHIFT+1))))
     {
 # ifndef __ASSUME_MMAP2_SYSCALL
       int saved_errno = errno;
 # endif
-      /* This will be always 12, no matter what page size is.  */
       __ptr_t result;
       __ptrvalue (result) = INLINE_SYSCALL (mmap2, 6, __ptrvalue (addr), len, prot,
 					    flags, fd, (off_t) (offset >> PAGE_SHIFT));