patch-2.1.42 linux/include/asm-sparc64/mmu_context.h

Next file: linux/include/asm-sparc64/pgtable.h
Previous file: linux/include/asm-sparc64/head.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.41/linux/include/asm-sparc64/mmu_context.h linux/include/asm-sparc64/mmu_context.h
@@ -1,4 +1,4 @@
-/* $Id: mmu_context.h,v 1.8 1997/05/18 20:44:23 davem Exp $ */
+/* $Id: mmu_context.h,v 1.10 1997/05/23 09:35:55 jj Exp $ */
 #ifndef __SPARC64_MMU_CONTEXT_H
 #define __SPARC64_MMU_CONTEXT_H
 
@@ -20,8 +20,6 @@
 
 extern unsigned long tlb_context_cache;
 
-#define MAX_CTX			PAGE_SIZE
-
 #define CTX_VERSION_SHIFT	PAGE_SHIFT
 #define CTX_VERSION_MASK	((~0UL) << CTX_VERSION_SHIFT)
 #define CTX_FIRST_VERSION	((1UL << CTX_VERSION_SHIFT) + 1UL)
@@ -29,7 +27,7 @@
 extern __inline__ void get_new_mmu_context(struct mm_struct *mm,
 					   unsigned long ctx)
 {
-	if((ctx & ~CTX_VERSION_MASK) > MAX_CTX) {
+	if((ctx & ~(CTX_VERSION_MASK)) == 0) {
 		unsigned long flags;
 		int entry;
 
@@ -68,7 +66,9 @@
 		flushw_user();
 		if((mm->context ^ ctx) & CTX_VERSION_MASK)
 			get_new_mmu_context(mm, ctx);
-		spitfire_set_secondary_context(mm->context);
+		tsk->tss.ctx = (mm->context & 0x1fff);
+		spitfire_set_secondary_context(tsk->tss.current_ds ?
+			mm->context : 0);
 		paddr = __pa(mm->pgd);
 		__asm__ __volatile__("
 			rdpr		%%pstate, %%o4

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov