patch-2.4.20 linux-2.4.20/include/asm-parisc/mmu_context.h

Next file: linux-2.4.20/include/asm-parisc/mmzone.h
Previous file: linux-2.4.20/include/asm-parisc/mmu.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/include/asm-parisc/mmu_context.h linux-2.4.20/include/asm-parisc/mmu_context.h
@@ -1,6 +1,8 @@
 #ifndef __PARISC_MMU_CONTEXT_H
 #define __PARISC_MMU_CONTEXT_H
 
+#include <asm/pgalloc.h>
+
 static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
 {
 }
@@ -14,17 +16,10 @@
 static inline int
 init_new_context(struct task_struct *tsk, struct mm_struct *mm)
 {
-	/*
-	 * Init_new_context can be called for a cloned mm, so we
-	 * only allocate a space id if one hasn't been allocated
-	 * yet AND mm != &init_mm (cloned kernel thread which
-	 * will run in the kernel space with spaceid 0).
-	 */
-
-	if ((mm != &init_mm) && (mm->context == 0)) {
-		mm->context = alloc_sid();
-	}
+	if (atomic_read(&mm->mm_users) != 1)
+	    BUG();
 
+	mm->context = alloc_sid();
 	return 0;
 }
 
@@ -39,11 +34,8 @@
 {
 
 	if (prev != next) {
-		/* Re-load page tables */
-		tsk->thread.pg_tables = __pa(next->pgd);
-
-		mtctl(tsk->thread.pg_tables, 25);
-		mtsp(next->context,3);
+		mtctl(__pa(next->pgd), 25);
+		load_context(next->context);
 	}
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)