2 * include/asm-s390/mmu_context.h
6 * Derived from "include/asm-i386/mmu_context.h"
9 #ifndef __S390_MMU_CONTEXT_H
10 #define __S390_MMU_CONTEXT_H
12 #include <asm/pgalloc.h>
13 #include <asm-generic/mm_hooks.h>
15 static inline int init_new_context(struct task_struct
*tsk
,
18 mm
->context
= _ASCE_TABLE_LENGTH
| _ASCE_USER_BITS
;
20 mm
->context
|= _ASCE_TYPE_REGION3
;
25 #define destroy_context(mm) do { } while (0)
28 #define LCTL_OPCODE "lctl"
30 #define LCTL_OPCODE "lctlg"
33 static inline void update_mm(struct mm_struct
*mm
, struct task_struct
*tsk
)
35 S390_lowcore
.user_asce
= mm
->context
| __pa(mm
->pgd
);
37 /* Load primary space page table origin. */
38 pgd_t
*shadow_pgd
= get_shadow_table(mm
->pgd
) ? : mm
->pgd
;
39 S390_lowcore
.user_exec_asce
= mm
->context
| __pa(shadow_pgd
);
40 asm volatile(LCTL_OPCODE
" 1,1,%0\n"
41 : : "m" (S390_lowcore
.user_exec_asce
) );
43 /* Load home space page table origin. */
44 asm volatile(LCTL_OPCODE
" 13,13,%0"
45 : : "m" (S390_lowcore
.user_asce
) );
48 static inline void switch_mm(struct mm_struct
*prev
, struct mm_struct
*next
,
49 struct task_struct
*tsk
)
51 if (unlikely(prev
== next
))
53 cpu_set(smp_processor_id(), next
->cpu_vm_mask
);
57 #define enter_lazy_tlb(mm,tsk) do { } while (0)
58 #define deactivate_mm(tsk,mm) do { } while (0)
60 static inline void activate_mm(struct mm_struct
*prev
,
61 struct mm_struct
*next
)
63 switch_mm(prev
, next
, current
);
64 set_fs(current
->thread
.mm_segment
);
67 #endif /* __S390_MMU_CONTEXT_H */