aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/um_arch.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/kernel/um_arch.c')
-rw-r--r--arch/um/kernel/um_arch.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 468aba990dbd..a6c1dd1cf5a1 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -241,6 +241,11 @@ static struct notifier_block panic_exit_notifier = {
241}; 241};
242 242
243/* Set during early boot */ 243/* Set during early boot */
244unsigned long task_size;
245EXPORT_SYMBOL(task_size);
246
247unsigned long host_task_size;
248
244unsigned long brk_start; 249unsigned long brk_start;
245unsigned long end_iomem; 250unsigned long end_iomem;
246EXPORT_SYMBOL(end_iomem); 251EXPORT_SYMBOL(end_iomem);
@@ -267,6 +272,13 @@ int __init linux_main(int argc, char **argv)
267 if (have_root == 0) 272 if (have_root == 0)
268 add_arg(DEFAULT_COMMAND_LINE); 273 add_arg(DEFAULT_COMMAND_LINE);
269 274
275 host_task_size = os_get_task_size();
276 /*
277 * TASK_SIZE needs to be PGDIR_SIZE aligned or else exit_mmap craps
278 * out
279 */
280 task_size = host_task_size & PGDIR_MASK;
281
270 /* OS sanity checks that need to happen before the kernel runs */ 282 /* OS sanity checks that need to happen before the kernel runs */
271 os_early_checks(); 283 os_early_checks();
272 284
@@ -303,7 +315,7 @@ int __init linux_main(int argc, char **argv)
303 315
304 highmem = 0; 316 highmem = 0;
305 iomem_size = (iomem_size + PAGE_SIZE - 1) & PAGE_MASK; 317 iomem_size = (iomem_size + PAGE_SIZE - 1) & PAGE_MASK;
306 max_physmem = CONFIG_TOP_ADDR - uml_physmem - iomem_size - MIN_VMALLOC; 318 max_physmem = TASK_SIZE - uml_physmem - iomem_size - MIN_VMALLOC;
307 319
308 /* 320 /*
309 * Zones have to begin on a 1 << MAX_ORDER page boundary, 321 * Zones have to begin on a 1 << MAX_ORDER page boundary,
@@ -335,7 +347,7 @@ int __init linux_main(int argc, char **argv)
335 } 347 }
336 348
337 virtmem_size = physmem_size; 349 virtmem_size = physmem_size;
338 avail = CONFIG_TOP_ADDR - start_vm; 350 avail = TASK_SIZE - start_vm;
339 if (physmem_size > avail) 351 if (physmem_size > avail)
340 virtmem_size = avail; 352 virtmem_size = avail;
341 end_vm = start_vm + virtmem_size; 353 end_vm = start_vm + virtmem_size;