patch-2.4.6 linux/arch/mips/kernel/r4k_misc.S

Next file: linux/arch/mips/kernel/r4k_switch.S
Previous file: linux/arch/mips/kernel/r4k_fpu.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.5/linux/arch/mips/kernel/r4k_misc.S linux/arch/mips/kernel/r4k_misc.S
@@ -35,10 +35,25 @@
 	 * in register PTE, a ptr into the table in which
 	 * the pte belongs is in PTR.
 	 */
+
+#ifdef CONFIG_SMP
+#define GET_PGD(scratch, ptr)        \
+	mfc0    ptr, CP0_CONTEXT;    \
+	la      scratch, current_pgd;\
+	srl     ptr, 23;             \
+	sll     ptr, 2;              \
+	addu    ptr, scratch, ptr;   \
+	lw      ptr, (ptr);          
+#else
+#define GET_PGD(scratch, ptr)    \
+	lw	ptr, current_pgd;
+#endif
+	
+	
 #define LOAD_PTE(pte, ptr) \
+	GET_PGD(pte, ptr)          \
 	mfc0	pte, CP0_BADVADDR; \
 	srl	pte, pte, 22; \
-	lw	ptr, current_pgd; \
 	sll	pte, pte, 2; \
 	addu	ptr, ptr, pte; \
 	mfc0	pte, CP0_BADVADDR; \

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