mmu.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
  3. * Licensed under the GPL
  4. */
  5. #include "linux/sched.h"
  6. #include "linux/list.h"
  7. #include "linux/spinlock.h"
  8. #include "linux/slab.h"
  9. #include "asm/current.h"
  10. #include "asm/segment.h"
  11. #include "asm/mmu.h"
  12. #include "os.h"
  13. #include "skas.h"
  14. int init_new_context_skas(struct task_struct *task, struct mm_struct *mm)
  15. {
  16. int from;
  17. if((current->mm != NULL) && (current->mm != &init_mm))
  18. from = current->mm->context.skas.mm_fd;
  19. else from = -1;
  20. mm->context.skas.mm_fd = new_mm(from);
  21. if(mm->context.skas.mm_fd < 0){
  22. printk("init_new_context_skas - new_mm failed, errno = %d\n",
  23. mm->context.skas.mm_fd);
  24. return(mm->context.skas.mm_fd);
  25. }
  26. return(0);
  27. }
  28. void destroy_context_skas(struct mm_struct *mm)
  29. {
  30. os_close_file(mm->context.skas.mm_fd);
  31. }
  32. /*
  33. * Overrides for Emacs so that we follow Linus's tabbing style.
  34. * Emacs will notice this stuff at the end of the file and automatically
  35. * adjust the settings for this buffer only. This must remain at the end
  36. * of the file.
  37. * ---------------------------------------------------------------------------
  38. * Local variables:
  39. * c-file-style: "linux"
  40. * End:
  41. */