Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips/mips In the idle functions, set curproc to NUL...



details:   https://anonhg.NetBSD.org/src/rev/1a01b237a752
branches:  trunk
changeset: 536135:1a01b237a752
user:      simonb <simonb%NetBSD.org@localhost>
date:      Mon Sep 09 02:32:38 2002 +0000

description:
In the idle functions, set curproc to NULL and (#ifdef LOCKDEBUG) call
sched_unlock_idle before enabling interrupts.  LOCKDEBUG kernels now
boot successfully.

Thanks to Chris Gilbert for helping fix this.

diffstat:

 sys/arch/mips/mips/locore.S       |  25 ++++++++-----------------
 sys/arch/mips/mips/locore_mips3.S |  12 ++++++------
 2 files changed, 14 insertions(+), 23 deletions(-)

diffs (95 lines):

diff -r 4be7768fd64f -r 1a01b237a752 sys/arch/mips/mips/locore.S
--- a/sys/arch/mips/mips/locore.S       Mon Sep 09 01:54:53 2002 +0000
+++ b/sys/arch/mips/mips/locore.S       Mon Sep 09 02:32:38 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.143 2002/08/28 08:34:07 gmcgarry Exp $    */
+/*     $NetBSD: locore.S,v 1.144 2002/09/09 02:32:38 simonb Exp $      */
 
 /*
  * Copyright (c) 1992, 1993
@@ -288,6 +288,11 @@
  * profiling.
  */
 LEAF(mips_idle)
+       sw      zero, _C_LABEL(curproc)         # set curproc NULL for stats
+#if defined(LOCKDEBUG)
+       jal     _C_LABEL(sched_unlock_idle)     # release sched_lock
+       nop
+#endif
 #ifdef         IPL_ICU_MASK
        # all interrupts enable.
        sw      zero, _C_LABEL(md_imask)        
@@ -299,11 +304,6 @@
        mtc0    t0, MIPS_COP_0_STATUS           # enable all interrupts
        COP0_SYNC
        nop
-       sw      zero, _C_LABEL(curproc)         # set curproc NULL for stats
-#if defined(LOCKDEBUG)
-       jal     _C_LABEL(sched_unlock_idle)     # release sched_lock
-       nop
-#endif
 
        /* Try to zero some free pages. */
        lw      t0, _C_LABEL(uvm) + UVM_PAGE_IDLE_ZERO
@@ -325,28 +325,19 @@
        nop
        beq     t0, zero, 1b
        nop
-#if defined(LOCKDEBUG)
        mtc0    zero, MIPS_COP_0_STATUS         # disable all interrupts
        COP0_SYNC
        nop
        nop
        nop
+#if defined(LOCKDEBUG)
        nop
        jal     _C_LABEL(sched_lock_idle)       # acquire sched_lock
        nop
+#endif
        la      ra, cpu_switch_queuescan
        j       ra
        nop
-#else
-       mtc0    zero, MIPS_COP_0_STATUS         # disable all interrupts
-       COP0_SYNC
-       nop
-       nop
-       nop
-       la      ra, cpu_switch_queuescan
-       j       ra
-       nop
-#endif
 END(mips_idle)
 
 /*
diff -r 4be7768fd64f -r 1a01b237a752 sys/arch/mips/mips/locore_mips3.S
--- a/sys/arch/mips/mips/locore_mips3.S Mon Sep 09 01:54:53 2002 +0000
+++ b/sys/arch/mips/mips/locore_mips3.S Mon Sep 09 02:32:38 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore_mips3.S,v 1.82 2002/09/09 01:03:10 simonb Exp $ */
+/*     $NetBSD: locore_mips3.S,v 1.83 2002/09/09 02:32:38 simonb Exp $ */
 
 /*
  * Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author)
@@ -176,16 +176,16 @@
  *     the QED RM52xx family of CPUs, and MIPS32 & MIPS64 CPUs.
  */
 LEAF(mips_wait_idle)
+       sw      zero, _C_LABEL(curproc)         # set curproc NULL for stats
+#if defined(LOCKDEBUG)
+       jal     _C_LABEL(sched_unlock_idle)     # release sched_lock
+       nop
+#endif
        li      t0, (MIPS_INT_MASK | MIPS_SR_INT_IE)
        DYNAMIC_STATUS_MASK(t0,t1)              # machine dependent masking
        mtc0    t0, MIPS_COP_0_STATUS           # enable all interrupts
        COP0_SYNC
        nop
-       sw      zero, _C_LABEL(curproc)         # set curproc NULL for stats
-#if defined(LOCKDEBUG)
-       jal     _C_LABEL(sched_unlock_idle)     # release sched_lock
-       nop
-#endif
 
        /* Try to zero some free pages. */
        lw      t0, _C_LABEL(uvm) + UVM_PAGE_IDLE_ZERO



Home | Main Index | Thread Index | Old Index