mfd: wm8350-i2c: Make sure the i2c regmap functions are compiled
[linux/fpc-iii.git] / arch / s390 / include / asm / mmu_context.h
blobf61e21848845b6c8c43bc9db296ec911cd3c5f9a
1 /*
2 * S390 version
4 * Derived from "include/asm-i386/mmu_context.h"
5 */
7 #ifndef __S390_MMU_CONTEXT_H
8 #define __S390_MMU_CONTEXT_H
10 #include <asm/pgalloc.h>
11 #include <asm/uaccess.h>
12 #include <asm/tlbflush.h>
13 #include <asm/ctl_reg.h>
15 static inline int init_new_context(struct task_struct *tsk,
16 struct mm_struct *mm)
18 atomic_set(&mm->context.attach_count, 0);
19 mm->context.flush_mm = 0;
20 mm->context.has_pgste = 0;
21 if (mm->context.asce_limit == 0) {
22 /* context created by exec, set asce limit to 4TB */
23 mm->context.asce_bits = _ASCE_TABLE_LENGTH | _ASCE_USER_BITS;
24 #ifdef CONFIG_64BIT
25 mm->context.asce_bits |= _ASCE_TYPE_REGION3;
26 #endif
27 mm->context.asce_limit = STACK_TOP_MAX;
29 crst_table_init((unsigned long *) mm->pgd, pgd_entry_type(mm));
30 return 0;
33 #define destroy_context(mm) do { } while (0)
35 #ifndef CONFIG_64BIT
36 #define LCTL_OPCODE "lctl"
37 #else
38 #define LCTL_OPCODE "lctlg"
39 #endif
41 static inline void update_mm(struct mm_struct *mm, struct task_struct *tsk)
43 pgd_t *pgd = mm->pgd;
45 S390_lowcore.user_asce = mm->context.asce_bits | __pa(pgd);
46 if (s390_user_mode != HOME_SPACE_MODE) {
47 /* Load primary space page table origin. */
48 asm volatile(LCTL_OPCODE" 1,1,%0\n"
49 : : "m" (S390_lowcore.user_asce) );
50 } else
51 /* Load home space page table origin. */
52 asm volatile(LCTL_OPCODE" 13,13,%0"
53 : : "m" (S390_lowcore.user_asce) );
54 set_fs(current->thread.mm_segment);
57 static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
58 struct task_struct *tsk)
60 cpumask_set_cpu(smp_processor_id(), mm_cpumask(next));
61 update_mm(next, tsk);
62 atomic_dec(&prev->context.attach_count);
63 WARN_ON(atomic_read(&prev->context.attach_count) < 0);
64 atomic_inc(&next->context.attach_count);
65 /* Check for TLBs not flushed yet */
66 __tlb_flush_mm_lazy(next);
69 #define enter_lazy_tlb(mm,tsk) do { } while (0)
70 #define deactivate_mm(tsk,mm) do { } while (0)
72 static inline void activate_mm(struct mm_struct *prev,
73 struct mm_struct *next)
75 switch_mm(prev, next, current);
78 static inline void arch_dup_mmap(struct mm_struct *oldmm,
79 struct mm_struct *mm)
83 static inline void arch_exit_mmap(struct mm_struct *mm)
87 #endif /* __S390_MMU_CONTEXT_H */