mem.c 852 字节
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/* 
 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
 * Licensed under the GPL
 */

#include "linux/stddef.h"
#include "linux/mm.h"
#include "asm/uaccess.h"
#include "mem_user.h"
#include "kern_util.h"
#include "kern.h"
#include "tt.h"

void before_mem_tt(unsigned long brk_start)
{
	if(debug)
		remap_data(UML_ROUND_DOWN(&_stext), UML_ROUND_UP(&_etext), 1);
	remap_data(UML_ROUND_DOWN(&_sdata), UML_ROUND_UP(&_edata), 1);
	remap_data(UML_ROUND_DOWN(&__bss_start), UML_ROUND_UP(&_end), 1);
}

#define SIZE ((CONFIG_NEST_LEVEL + CONFIG_KERNEL_HALF_GIGS) * 0x20000000)
23
#define START (CONFIG_TOP_ADDR - SIZE)
L
Linus Torvalds 已提交
24

25
unsigned long set_task_sizes_tt(unsigned long *task_size_out)
L
Linus Torvalds 已提交
26
{
27 28
	unsigned long host_task_size;

L
Linus Torvalds 已提交
29
	/* Round up to the nearest 4M */
30
	host_task_size = ROUND_4M((unsigned long) &host_task_size);
L
Linus Torvalds 已提交
31
	*task_size_out = START;
32 33

	return host_task_size;
L
Linus Torvalds 已提交
34
}