mmu_context.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
  3. * Licensed under the GPL
  4. */
  5. #ifndef __UM_MMU_CONTEXT_H
  6. #define __UM_MMU_CONTEXT_H
  7. #include "linux/sched.h"
  8. #include "choose-mode.h"
  9. #define get_mmu_context(task) do ; while(0)
  10. #define activate_context(tsk) do ; while(0)
  11. #define deactivate_mm(tsk,mm) do { } while (0)
  12. static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
  13. {
  14. }
  15. extern void switch_mm_skas(int mm_fd);
  16. static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
  17. struct task_struct *tsk)
  18. {
  19. unsigned cpu = smp_processor_id();
  20. if(prev != next){
  21. cpu_clear(cpu, prev->cpu_vm_mask);
  22. cpu_set(cpu, next->cpu_vm_mask);
  23. if(next != &init_mm)
  24. CHOOSE_MODE((void) 0,
  25. switch_mm_skas(next->context.skas.mm_fd));
  26. }
  27. }
  28. static inline void enter_lazy_tlb(struct mm_struct *mm,
  29. struct task_struct *tsk)
  30. {
  31. }
  32. extern int init_new_context_skas(struct task_struct *task,
  33. struct mm_struct *mm);
  34. static inline int init_new_context_tt(struct task_struct *task,
  35. struct mm_struct *mm)
  36. {
  37. return(0);
  38. }
  39. static inline int init_new_context(struct task_struct *task,
  40. struct mm_struct *mm)
  41. {
  42. return(CHOOSE_MODE_PROC(init_new_context_tt, init_new_context_skas,
  43. task, mm));
  44. }
  45. extern void destroy_context_skas(struct mm_struct *mm);
  46. static inline void destroy_context(struct mm_struct *mm)
  47. {
  48. CHOOSE_MODE((void) 0, destroy_context_skas(mm));
  49. }
  50. #endif
  51. /*
  52. * Overrides for Emacs so that we follow Linus's tabbing style.
  53. * Emacs will notice this stuff at the end of the file and automatically
  54. * adjust the settings for this buffer only. This must remain at the end
  55. * of the file.
  56. * ---------------------------------------------------------------------------
  57. * Local variables:
  58. * c-file-style: "linux"
  59. * End:
  60. */