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