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/process.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/process.c')
-rw-r--r-- | arch/um/os-Linux/skas/process.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c index f9d2f8545af..46c00cc429b 100644 --- a/arch/um/os-Linux/skas/process.c +++ b/arch/um/os-Linux/skas/process.c @@ -252,11 +252,12 @@ int start_userspace(unsigned long stub_stack) unsigned long sp; int pid, status, n, flags; - stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, + stack = mmap(NULL, UM_KERN_PAGE_SIZE, + PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if(stack == MAP_FAILED) panic("start_userspace : mmap failed, errno = %d", errno); - sp = (unsigned long) stack + PAGE_SIZE - sizeof(void *); + sp = (unsigned long) stack + UM_KERN_PAGE_SIZE - sizeof(void *); flags = CLONE_FILES | SIGCHLD; if(proc_mm) flags |= CLONE_VM; @@ -279,7 +280,7 @@ int start_userspace(unsigned long stub_stack) panic("start_userspace : PTRACE_OLDSETOPTIONS failed, errno=%d\n", errno); - if(munmap(stack, PAGE_SIZE) < 0) + if(munmap(stack, UM_KERN_PAGE_SIZE) < 0) panic("start_userspace : munmap failed, errno = %d\n", errno); return(pid); @@ -365,7 +366,7 @@ static int __init init_thread_regs(void) thread_regs[REGS_IP_INDEX] = UML_CONFIG_STUB_CODE + (unsigned long) stub_clone_handler - (unsigned long) &__syscall_stub_start; - thread_regs[REGS_SP_INDEX] = UML_CONFIG_STUB_DATA + PAGE_SIZE - + thread_regs[REGS_SP_INDEX] = UML_CONFIG_STUB_DATA + UM_KERN_PAGE_SIZE - sizeof(void *); #ifdef __SIGNAL_FRAMESIZE thread_regs[REGS_SP_INDEX] -= __SIGNAL_FRAMESIZE; @@ -453,7 +454,7 @@ void map_stub_pages(int fd, unsigned long code, .u = { .mmap = { .addr = code, - .len = PAGE_SIZE, + .len = UM_KERN_PAGE_SIZE, .prot = PROT_EXEC, .flags = MAP_FIXED | MAP_PRIVATE, .fd = code_fd, @@ -476,7 +477,7 @@ void map_stub_pages(int fd, unsigned long code, .u = { .mmap = { .addr = data, - .len = PAGE_SIZE, + .len = UM_KERN_PAGE_SIZE, .prot = PROT_READ | PROT_WRITE, .flags = MAP_FIXED | MAP_SHARED, .fd = map_fd, |