mmu_context.h 1.9 KB

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