mem.c 852 B

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