mmu_context.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * include/asm-s390/mmu_context.h
  3. *
  4. * S390 version
  5. *
  6. * Derived from "include/asm-i386/mmu_context.h"
  7. */
  8. #ifndef __S390_MMU_CONTEXT_H
  9. #define __S390_MMU_CONTEXT_H
  10. /*
  11. * get a new mmu context.. S390 don't know about contexts.
  12. */
  13. #define init_new_context(tsk,mm) 0
  14. #define destroy_context(mm) do { } while (0)
  15. static inline void enter_lazy_tlb(struct mm_struct *mm,
  16. struct task_struct *tsk)
  17. {
  18. }
  19. static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
  20. struct task_struct *tsk)
  21. {
  22. if (prev != next) {
  23. #ifndef __s390x__
  24. S390_lowcore.user_asce = (__pa(next->pgd)&PAGE_MASK) |
  25. (_SEGMENT_TABLE|USER_STD_MASK);
  26. /* Load home space page table origin. */
  27. asm volatile("lctl 13,13,%0"
  28. : : "m" (S390_lowcore.user_asce) );
  29. #else /* __s390x__ */
  30. S390_lowcore.user_asce = (__pa(next->pgd) & PAGE_MASK) |
  31. (_REGION_TABLE|USER_STD_MASK);
  32. /* Load home space page table origin. */
  33. asm volatile("lctlg 13,13,%0"
  34. : : "m" (S390_lowcore.user_asce) );
  35. #endif /* __s390x__ */
  36. }
  37. cpu_set(smp_processor_id(), next->cpu_vm_mask);
  38. }
  39. #define deactivate_mm(tsk,mm) do { } while (0)
  40. static inline void activate_mm(struct mm_struct *prev,
  41. struct mm_struct *next)
  42. {
  43. switch_mm(prev, next, current);
  44. set_fs(current->thread.mm_segment);
  45. }
  46. #endif