diff options
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 f9d2f8545afe..46c00cc429bc 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) | |||
252 | unsigned long sp; | 252 | unsigned long sp; |
253 | int pid, status, n, flags; | 253 | int pid, status, n, flags; |
254 | 254 | ||
255 | stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC, | 255 | stack = mmap(NULL, UM_KERN_PAGE_SIZE, |
256 | PROT_READ | PROT_WRITE | PROT_EXEC, | ||
256 | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); | 257 | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); |
257 | if(stack == MAP_FAILED) | 258 | if(stack == MAP_FAILED) |
258 | panic("start_userspace : mmap failed, errno = %d", errno); | 259 | panic("start_userspace : mmap failed, errno = %d", errno); |
259 | sp = (unsigned long) stack + PAGE_SIZE - sizeof(void *); | 260 | sp = (unsigned long) stack + UM_KERN_PAGE_SIZE - sizeof(void *); |
260 | 261 | ||
261 | flags = CLONE_FILES | SIGCHLD; | 262 | flags = CLONE_FILES | SIGCHLD; |
262 | if(proc_mm) flags |= CLONE_VM; | 263 | if(proc_mm) flags |= CLONE_VM; |
@@ -279,7 +280,7 @@ int start_userspace(unsigned long stub_stack) | |||
279 | panic("start_userspace : PTRACE_OLDSETOPTIONS failed, errno=%d\n", | 280 | panic("start_userspace : PTRACE_OLDSETOPTIONS failed, errno=%d\n", |
280 | errno); | 281 | errno); |
281 | 282 | ||
282 | if(munmap(stack, PAGE_SIZE) < 0) | 283 | if(munmap(stack, UM_KERN_PAGE_SIZE) < 0) |
283 | panic("start_userspace : munmap failed, errno = %d\n", errno); | 284 | panic("start_userspace : munmap failed, errno = %d\n", errno); |
284 | 285 | ||
285 | return(pid); | 286 | return(pid); |
@@ -365,7 +366,7 @@ static int __init init_thread_regs(void) | |||
365 | thread_regs[REGS_IP_INDEX] = UML_CONFIG_STUB_CODE + | 366 | thread_regs[REGS_IP_INDEX] = UML_CONFIG_STUB_CODE + |
366 | (unsigned long) stub_clone_handler - | 367 | (unsigned long) stub_clone_handler - |
367 | (unsigned long) &__syscall_stub_start; | 368 | (unsigned long) &__syscall_stub_start; |
368 | thread_regs[REGS_SP_INDEX] = UML_CONFIG_STUB_DATA + PAGE_SIZE - | 369 | thread_regs[REGS_SP_INDEX] = UML_CONFIG_STUB_DATA + UM_KERN_PAGE_SIZE - |
369 | sizeof(void *); | 370 | sizeof(void *); |
370 | #ifdef __SIGNAL_FRAMESIZE | 371 | #ifdef __SIGNAL_FRAMESIZE |
371 | thread_regs[REGS_SP_INDEX] -= __SIGNAL_FRAMESIZE; | 372 | thread_regs[REGS_SP_INDEX] -= __SIGNAL_FRAMESIZE; |
@@ -453,7 +454,7 @@ void map_stub_pages(int fd, unsigned long code, | |||
453 | .u = | 454 | .u = |
454 | { .mmap = | 455 | { .mmap = |
455 | { .addr = code, | 456 | { .addr = code, |
456 | .len = PAGE_SIZE, | 457 | .len = UM_KERN_PAGE_SIZE, |
457 | .prot = PROT_EXEC, | 458 | .prot = PROT_EXEC, |
458 | .flags = MAP_FIXED | MAP_PRIVATE, | 459 | .flags = MAP_FIXED | MAP_PRIVATE, |
459 | .fd = code_fd, | 460 | .fd = code_fd, |
@@ -476,7 +477,7 @@ void map_stub_pages(int fd, unsigned long code, | |||
476 | .u = | 477 | .u = |
477 | { .mmap = | 478 | { .mmap = |
478 | { .addr = data, | 479 | { .addr = data, |
479 | .len = PAGE_SIZE, | 480 | .len = UM_KERN_PAGE_SIZE, |
480 | .prot = PROT_READ | PROT_WRITE, | 481 | .prot = PROT_READ | PROT_WRITE, |
481 | .flags = MAP_FIXED | MAP_SHARED, | 482 | .flags = MAP_FIXED | MAP_SHARED, |
482 | .fd = map_fd, | 483 | .fd = map_fd, |