84a23b14f770b308dca9b06a982dc264706af5a9
[pandora-kernel.git] / arch / um / kernel / tt / mem.c
1 /* 
2  * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3  * Licensed under the GPL
4  */
5
6 #include "linux/stddef.h"
7 #include "linux/config.h"
8 #include "linux/mm.h"
9 #include "asm/uaccess.h"
10 #include "mem_user.h"
11 #include "kern_util.h"
12 #include "user_util.h"
13 #include "kern.h"
14 #include "tt.h"
15
16 void before_mem_tt(unsigned long brk_start)
17 {
18         if(debug)
19                 remap_data(UML_ROUND_DOWN(&_stext), UML_ROUND_UP(&_etext), 1);
20         remap_data(UML_ROUND_DOWN(&_sdata), UML_ROUND_UP(&_edata), 1);
21         remap_data(UML_ROUND_DOWN(&__bss_start), UML_ROUND_UP(&_end), 1);
22 }
23
24 #define SIZE ((CONFIG_NEST_LEVEL + CONFIG_KERNEL_HALF_GIGS) * 0x20000000)
25 #define START (CONFIG_TOP_ADDR - SIZE)
26
27 unsigned long set_task_sizes_tt(unsigned long *task_size_out)
28 {
29         unsigned long host_task_size;
30
31         /* Round up to the nearest 4M */
32         host_task_size = ROUND_4M((unsigned long) &host_task_size);
33         *task_size_out = START;
34
35         return host_task_size;
36 }