mem.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
  3. * Licensed under the GPL
  4. */
  5. #include "linux/stddef.h"
  6. #include "linux/config.h"
  7. #include "linux/mm.h"
  8. #include "asm/uaccess.h"
  9. #include "mem_user.h"
  10. #include "kern_util.h"
  11. #include "user_util.h"
  12. #include "kern.h"
  13. #include "tt.h"
  14. void before_mem_tt(unsigned long brk_start)
  15. {
  16. if(debug)
  17. remap_data(UML_ROUND_DOWN(&_stext), UML_ROUND_UP(&_etext), 1);
  18. remap_data(UML_ROUND_DOWN(&_sdata), UML_ROUND_UP(&_edata), 1);
  19. remap_data(UML_ROUND_DOWN(&__bss_start), UML_ROUND_UP(&_end), 1);
  20. }
  21. #ifdef CONFIG_HOST_2G_2G
  22. #define TOP 0x80000000
  23. #else
  24. #define TOP 0xc0000000
  25. #endif
  26. #define SIZE ((CONFIG_NEST_LEVEL + CONFIG_KERNEL_HALF_GIGS) * 0x20000000)
  27. #define START (TOP - SIZE)
  28. unsigned long set_task_sizes_tt(int arg, unsigned long *host_size_out,
  29. unsigned long *task_size_out)
  30. {
  31. /* Round up to the nearest 4M */
  32. *host_size_out = ROUND_4M((unsigned long) &arg);
  33. *task_size_out = START;
  34. return(START);
  35. }
  36. /*
  37. * Overrides for Emacs so that we follow Linus's tabbing style.
  38. * Emacs will notice this stuff at the end of the file and automatically
  39. * adjust the settings for this buffer only. This must remain at the end
  40. * of the file.
  41. * ---------------------------------------------------------------------------
  42. * Local variables:
  43. * c-file-style: "linux"
  44. * End:
  45. */