summary refs log tree commit diff
path: root/sysdeps
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 /sysdeps
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>.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/mmap64.c8
1 files changed, 5 insertions, 3 deletions
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));