patch-2.4.7 linux/arch/cris/mm/tlb.c

Next file: linux/arch/i386/boot/video.S
Previous file: linux/arch/cris/mm/init.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.6/linux/arch/cris/mm/tlb.c linux/arch/cris/mm/tlb.c
@@ -1,7 +1,7 @@
 /*
  *  linux/arch/cris/mm/tlb.c
  *
- *  Copyright (C) 2000  Axis Communications AB
+ *  Copyright (C) 2000, 2001  Axis Communications AB
  *  
  *  Authors:   Bjorn Wesen (bjornw@axis.com)
  *
@@ -21,6 +21,7 @@
 #include <asm/segment.h>
 #include <asm/pgtable.h>
 #include <asm/svinto.h>
+#include <asm/mmu_context.h>
 
 #define D(x)
 
@@ -252,6 +253,15 @@
 
 	get_mmu_context(next);
 
+	/* remember the pgd for the fault handlers
+	 * this is similar to the pgd register in some other CPU's.
+	 * we need our own copy of it because current and active_mm
+	 * might be invalid at points where we still need to derefer
+	 * the pgd.
+	 */
+
+	current_pgd = next->pgd;
+
 	/* switch context in the MMU */
 	
 	D(printk("switching mmu_context to %d (%p)\n", next->context, next));
@@ -288,7 +298,7 @@
 
 	/* clear the page_id map */
 
-	for(i = 0; i < NUM_PAGEID; i++)
+	for (i = 1; i < sizeof (page_id_map) / sizeof (page_id_map[0]); i++)
 		page_id_map[i] = NULL;
 	
 	/* invalidate the entire TLB */

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