mem.c 655 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
  3. * Licensed under the GPL
  4. */
  5. #include "linux/config.h"
  6. #include "linux/mm.h"
  7. #include "asm/pgtable.h"
  8. #include "mem_user.h"
  9. #include "skas.h"
  10. unsigned long set_task_sizes_skas(unsigned long *task_size_out)
  11. {
  12. /* Round up to the nearest 4M */
  13. unsigned long host_task_size = ROUND_4M((unsigned long)
  14. &host_task_size);
  15. #ifdef CONFIG_HOST_TASK_SIZE
  16. *host_size_out = ROUND_4M(CONFIG_HOST_TASK_SIZE);
  17. *task_size_out = CONFIG_HOST_TASK_SIZE;
  18. #else
  19. if (!skas_needs_stub)
  20. *task_size_out = host_task_size;
  21. else *task_size_out = CONFIG_STUB_START & PGDIR_MASK;
  22. #endif
  23. return host_task_size;
  24. }