|
@@ -258,6 +258,7 @@ int __init linux_main(int argc, char **argv)
|
|
|
{
|
|
|
unsigned long avail, diff;
|
|
|
unsigned long virtmem_size, max_physmem;
|
|
|
+ unsigned long stack;
|
|
|
unsigned int i;
|
|
|
int add;
|
|
|
char * mode;
|
|
@@ -348,7 +349,9 @@ int __init linux_main(int argc, char **argv)
|
|
|
}
|
|
|
|
|
|
virtmem_size = physmem_size;
|
|
|
- avail = TASK_SIZE - start_vm;
|
|
|
+ stack = (unsigned long) argv;
|
|
|
+ stack &= ~(1024 * 1024 - 1);
|
|
|
+ avail = stack - start_vm;
|
|
|
if (physmem_size > avail)
|
|
|
virtmem_size = avail;
|
|
|
end_vm = start_vm + virtmem_size;
|