diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-06-16 10:16:09 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-16 13:16:16 -0700 |
commit | c539ab73070b381f0452dae791f891ec2515098e (patch) | |
tree | 68e4e706fe31b88b26bd4b29eadb32440148eb3e /arch/um/os-Linux/skas/mem.c | |
parent | f5a9c77df45b113d21b64cbc2bf6c72a0da48998 (diff) |
uml: remove PAGE_SIZE from libc code
Distros seem to be removing PAGE_SIZE from asm/page.h. So, the libc side of
UML should stop using it.
I replace it with UM_KERN_PAGE_SIZE, which is defined to be the same as
PAGE_SIZE on the kernel side of the house. I could also use getpagesize(),
but it's more important that UML have the same value of PAGE_SIZE everywhere.
It's conceivable that it could be built with a larger PAGE_SIZE, and use of
getpagesize() would break that badly.
PAGE_MASK got the same treatment, as it is closely tied to PAGE_SIZE.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux/skas/mem.c')
-rw-r--r-- | arch/um/os-Linux/skas/mem.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/um/os-Linux/skas/mem.c b/arch/um/os-Linux/skas/mem.c index 5c894632079..0f7df4eb903 100644 --- a/arch/um/os-Linux/skas/mem.c +++ b/arch/um/os-Linux/skas/mem.c @@ -25,6 +25,7 @@ #include "sysdep/ptrace.h" #include "sysdep/stub.h" #include "init.h" +#include "kern_constants.h" extern unsigned long batch_syscall_stub, __syscall_stub_start; @@ -149,8 +150,8 @@ long run_syscall_stub(struct mm_id * mm_idp, int syscall, *stack = 0; multi_op_count++; - if(!done && ((((unsigned long) stack) & ~PAGE_MASK) < - PAGE_SIZE - 10 * sizeof(long))){ + if(!done && ((((unsigned long) stack) & ~UM_KERN_PAGE_MASK) < + UM_KERN_PAGE_SIZE - 10 * sizeof(long))){ *addr = stack; return 0; } @@ -168,8 +169,8 @@ long syscall_stub_data(struct mm_id * mm_idp, /* If *addr still is uninitialized, it *must* contain NULL. * Thus in this case do_syscall_stub correctly won't be called. */ - if((((unsigned long) *addr) & ~PAGE_MASK) >= - PAGE_SIZE - (10 + data_count) * sizeof(long)) { + if((((unsigned long) *addr) & ~UM_KERN_PAGE_MASK) >= + UM_KERN_PAGE_SIZE - (10 + data_count) * sizeof(long)) { ret = do_syscall_stub(mm_idp, addr); /* in case of error, don't overwrite data on stack */ if(ret) @@ -183,8 +184,8 @@ long syscall_stub_data(struct mm_id * mm_idp, memcpy(stack + 1, data, data_count * sizeof(long)); - *stub_addr = (void *)(((unsigned long)(stack + 1) & ~PAGE_MASK) + - UML_CONFIG_STUB_DATA); + *stub_addr = (void *)(((unsigned long)(stack + 1) & + ~UM_KERN_PAGE_MASK) + UML_CONFIG_STUB_DATA); return 0; } |