blob: 7e5b8f165cf29ccfb58d71682f73bee6535269bd [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#include "linux/config.h"
7#include "linux/mm.h"
Jeff Diked67b5692005-07-07 17:56:49 -07008#include "asm/pgtable.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -07009#include "mem_user.h"
Jeff Diked67b5692005-07-07 17:56:49 -070010#include "skas.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
Tyler598d1882006-07-10 04:45:03 -070012unsigned long set_task_sizes_skas(unsigned long *host_size_out,
Linus Torvalds1da177e2005-04-16 15:20:36 -070013 unsigned long *task_size_out)
14{
15 /* Round up to the nearest 4M */
Tyler598d1882006-07-10 04:45:03 -070016 unsigned long top = ROUND_4M((unsigned long) &host_size_out);
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
18#ifdef CONFIG_HOST_TASK_SIZE
Tyler598d1882006-07-10 04:45:03 -070019 *host_size_out = ROUND_4M(CONFIG_HOST_TASK_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -070020 *task_size_out = CONFIG_HOST_TASK_SIZE;
21#else
22 *host_size_out = top;
Bodo Stroesser858259c2005-11-07 00:58:55 -080023 if (!skas_needs_stub)
Jeff Diked67b5692005-07-07 17:56:49 -070024 *task_size_out = top;
25 else *task_size_out = CONFIG_STUB_START & PGDIR_MASK;
Linus Torvalds1da177e2005-04-16 15:20:36 -070026#endif
Tyler598d1882006-07-10 04:45:03 -070027 return ((unsigned long) set_task_sizes_skas) & ~0xffffff;
Linus Torvalds1da177e2005-04-16 15:20:36 -070028}