]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-s390/mmu_context.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial
[linux-2.6-omap-h63xx.git] / include / asm-s390 / mmu_context.h
index 05b842126b993295d95912c8f057f5cb182c5397..a77d4ba3c8ebc5c63ef4fbaa60104ffa6d296fc3 100644 (file)
 #include <asm/pgalloc.h>
 #include <asm-generic/mm_hooks.h>
 
-/*
- * get a new mmu context.. S390 don't know about contexts.
- */
-#define init_new_context(tsk,mm)        0
+static inline int init_new_context(struct task_struct *tsk,
+                                  struct mm_struct *mm)
+{
+       mm->context = _ASCE_TABLE_LENGTH | _ASCE_USER_BITS;
+#ifdef CONFIG_64BIT
+       mm->context |= _ASCE_TYPE_REGION3;
+#endif
+       return 0;
+}
 
 #define destroy_context(mm)             do { } while (0)
 
 
 static inline void update_mm(struct mm_struct *mm, struct task_struct *tsk)
 {
-       pgd_t *pgd = mm->pgd;
-       unsigned long asce_bits;
-
-       /* Calculate asce bits from the first pgd table entry. */
-       asce_bits = _ASCE_TABLE_LENGTH | _ASCE_USER_BITS;
-#ifdef CONFIG_64BIT
-       asce_bits |= _ASCE_TYPE_REGION3;
-#endif
-       S390_lowcore.user_asce = asce_bits | __pa(pgd);
+       S390_lowcore.user_asce = mm->context | __pa(mm->pgd);
        if (switch_amode) {
                /* Load primary space page table origin. */
-               pgd_t *shadow_pgd = get_shadow_table(pgd) ? : pgd;
-               S390_lowcore.user_exec_asce = asce_bits | __pa(shadow_pgd);
+               pgd_t *shadow_pgd = get_shadow_table(mm->pgd) ? : mm->pgd;
+               S390_lowcore.user_exec_asce = mm->context | __pa(shadow_pgd);
                asm volatile(LCTL_OPCODE" 1,1,%0\n"
                             : : "m" (S390_lowcore.user_exec_asce) );
        } else