From 63f2f1279759f48f29dc5b6cc95d89699edf5a11 Mon Sep 17 00:00:00 2001 From: mhitch Date: Wed, 25 Jun 1997 05:06:01 +0000 Subject: [PATCH] Someday I'll learn how the MIPS cpu works; add some delay after the tlbp when switching to a new process. This was causing a ktlbmiss and stack overflow panic on R3000 machines. --- sys/arch/mips/mips/locore_r2000.S | 6 +++--- sys/arch/mips/mips/locore_r4000.S | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/arch/mips/mips/locore_r2000.S b/sys/arch/mips/mips/locore_r2000.S index 154907edda2f..2a611bad10e5 100644 --- a/sys/arch/mips/mips/locore_r2000.S +++ b/sys/arch/mips/mips/locore_r2000.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore_r2000.S,v 1.36 1997/06/23 21:45:05 mhitch Exp $ */ +/* $NetBSD: locore_r2000.S,v 1.37 1997/06/25 05:06:01 mhitch Exp $ */ /* * Copyright (c) 1992, 1993 @@ -1671,8 +1671,8 @@ LEAF(mips1_cpu_switch_resume) mtc0 v0, MIPS_COP_0_TLB_HI nop tlbp # probe for entry - nop mfc0 s1, MIPS_COP_0_TLB_INDEX # see if we found it + nop bltz s1, 1f # not found li s1, MIPS_KSEG0_START mtc0 s1, MIPS_COP_0_TLB_HI @@ -1691,8 +1691,8 @@ LEAF(mips1_cpu_switch_resume) mtc0 v0, MIPS_COP_0_TLB_HI nop tlbp # probe for entry - nop mfc0 s1, MIPS_COP_0_TLB_INDEX # see if we found it + nop bltz s1, 1f # not found li s1, MIPS_KSEG0_START mtc0 s1, MIPS_COP_0_TLB_HI diff --git a/sys/arch/mips/mips/locore_r4000.S b/sys/arch/mips/mips/locore_r4000.S index 0210287b84fc..25fd3009b6ad 100644 --- a/sys/arch/mips/mips/locore_r4000.S +++ b/sys/arch/mips/mips/locore_r4000.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore_r4000.S,v 1.37 1997/06/23 21:45:11 mhitch Exp $ */ +/* $NetBSD: locore_r4000.S,v 1.38 1997/06/25 05:06:05 mhitch Exp $ */ /* * Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author) @@ -2177,7 +2177,9 @@ LEAF(mips3_cpu_switch_resume) nop tlbp # probe for existing entry nop + nop mfc0 s1, MIPS_COP_0_TLB_INDEX + nop slti s1, s1, 8 # if found in random entry bnez s1, 2f mtc0 zero, MIPS_COP_0_TLB_LO0 # flush it @@ -2206,7 +2208,9 @@ LEAF(mips3_cpu_switch_resume) nop tlbp # probe for existing entry nop + nop mfc0 s1, MIPS_COP_0_TLB_INDEX + nop slti s1, s1, 8 # if found in random entry bnez s1, 2f mtc0 zero, MIPS_COP_0_TLB_LO0 # flush it