diff options
Diffstat (limited to 'arch/um/kernel')
-rw-r--r-- | arch/um/kernel/um_arch.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 82058ac7d48..9db85b2ce69 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c | |||
@@ -258,6 +258,7 @@ int __init linux_main(int argc, char **argv) | |||
258 | { | 258 | { |
259 | unsigned long avail, diff; | 259 | unsigned long avail, diff; |
260 | unsigned long virtmem_size, max_physmem; | 260 | unsigned long virtmem_size, max_physmem; |
261 | unsigned long stack; | ||
261 | unsigned int i; | 262 | unsigned int i; |
262 | int add; | 263 | int add; |
263 | char * mode; | 264 | char * mode; |
@@ -348,7 +349,9 @@ int __init linux_main(int argc, char **argv) | |||
348 | } | 349 | } |
349 | 350 | ||
350 | virtmem_size = physmem_size; | 351 | virtmem_size = physmem_size; |
351 | avail = TASK_SIZE - start_vm; | 352 | stack = (unsigned long) argv; |
353 | stack &= ~(1024 * 1024 - 1); | ||
354 | avail = stack - start_vm; | ||
352 | if (physmem_size > avail) | 355 | if (physmem_size > avail) |
353 | virtmem_size = avail; | 356 | virtmem_size = avail; |
354 | end_vm = start_vm + virtmem_size; | 357 | end_vm = start_vm + virtmem_size; |