From c539ab73070b381f0452dae791f891ec2515098e Mon Sep 17 00:00:00 2001 From: Jeff Dike Date: Sat, 16 Jun 2007 10:16:09 -0700 Subject: 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/um/os-Linux/start_up.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'arch/um/os-Linux/start_up.c') diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c index 3fc13fa..46f6139 100644 --- a/arch/um/os-Linux/start_up.c +++ b/arch/um/os-Linux/start_up.c @@ -107,11 +107,12 @@ static int start_ptraced_child(void **stack_out) unsigned long sp; int pid, n, status; - 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) fatal_perror("check_ptrace : mmap failed"); - sp = (unsigned long) stack + PAGE_SIZE - sizeof(void *); + sp = (unsigned long) stack + UM_KERN_PAGE_SIZE - sizeof(void *); pid = clone(ptrace_child, (void *) sp, SIGCHLD, NULL); if(pid < 0) fatal_perror("start_ptraced_child : clone failed"); @@ -153,7 +154,7 @@ static int stop_ptraced_child(int pid, void *stack, int exitcode, ret = -1; } - if(munmap(stack, PAGE_SIZE) < 0) + if(munmap(stack, UM_KERN_PAGE_SIZE) < 0) fatal_perror("check_ptrace : munmap failed"); return ret; } -- cgit v1.1