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 - make sure cpu_switchto() not to touch M...



details:   https://anonhg.NetBSD.org/src/rev/3683b226c558
branches:  trunk
changeset: 759957:3683b226c558
user:      nisimura <nisimura%NetBSD.org@localhost>
date:      Wed Dec 22 01:34:17 2010 +0000

description:
- make sure cpu_switchto() not to touch MIPS_CURLWP register at newlwp
  switchframe restoration stage.
- discard MIPS_CURLWP assignments exposed in cpu_lwp_fork() and
  cpu_setfunc().
- use plain 'jal' instruction to call lwp_startup().

diffstat:

 sys/arch/mips/mips/locore.S       |  4 ++--
 sys/arch/mips/mips/locore_mips1.S |  7 +++----
 sys/arch/mips/mips/mipsX_subr.S   |  7 +++----
 sys/arch/mips/mips/vm_machdep.c   |  6 ++----
 4 files changed, 10 insertions(+), 14 deletions(-)

diffs (96 lines):

diff -r 6bc75090cb89 -r 3683b226c558 sys/arch/mips/mips/locore.S
--- a/sys/arch/mips/mips/locore.S       Wed Dec 22 01:03:02 2010 +0000
+++ b/sys/arch/mips/mips/locore.S       Wed Dec 22 01:34:17 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.172 2009/12/20 03:40:27 rmind Exp $       */
+/*     $NetBSD: locore.S,v 1.173 2010/12/22 01:34:17 nisimura Exp $    */
 
 /*
  * Copyright (c) 1992, 1993
@@ -247,7 +247,7 @@
        REG_L   s4, PCB_CONTEXT+SF_REG_S4(a0)
        REG_L   s5, PCB_CONTEXT+SF_REG_S5(a0)
        REG_L   s6, PCB_CONTEXT+SF_REG_S6(a0)
-       REG_L   s7, PCB_CONTEXT+SF_REG_S7(a0)
+     /* REG_L  s7, PCB_CONTEXT+SF_REG_S7(a0)   don't touch MIPS_CURLWP */
 #if defined(__mips_n32) || defined(__mips_n64)
        REG_L   gp, PCB_CONTEXT+SF_REG_GP(a0)
 #endif
diff -r 6bc75090cb89 -r 3683b226c558 sys/arch/mips/mips/locore_mips1.S
--- a/sys/arch/mips/mips/locore_mips1.S Wed Dec 22 01:03:02 2010 +0000
+++ b/sys/arch/mips/mips/locore_mips1.S Wed Dec 22 01:34:17 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore_mips1.S,v 1.70 2010/11/25 17:53:24 matt Exp $   */
+/*     $NetBSD: locore_mips1.S,v 1.71 2010/12/22 01:34:17 nisimura Exp $       */
 
 /*
  * Copyright (c) 1992, 1993
@@ -1033,10 +1033,9 @@
        addu    sp, sp, -CALLFRAME_SIZ
 
        # Call lwp_startup(), with args from cpu_switchto()/cpu_setfunc()
-       la      t0, _C_LABEL(lwp_startup)
        move    a0, v0
-       jal     ra, t0
-       move    a1, s7
+       jal     _C_LABEL(lwp_startup)
+       move    a1, MIPS_CURLWP
 
        # Call the routine specified by cpu_setfunc()
        jal     ra, s0                  
diff -r 6bc75090cb89 -r 3683b226c558 sys/arch/mips/mips/mipsX_subr.S
--- a/sys/arch/mips/mips/mipsX_subr.S   Wed Dec 22 01:03:02 2010 +0000
+++ b/sys/arch/mips/mips/mipsX_subr.S   Wed Dec 22 01:34:17 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mipsX_subr.S,v 1.36 2010/06/22 12:42:21 simonb Exp $   */
+/*     $NetBSD: mipsX_subr.S,v 1.37 2010/12/22 01:34:17 nisimura Exp $ */
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -2018,10 +2018,9 @@
        PTR_ADDU sp, sp, -CALLFRAME_SIZ
 
        # Call lwp_startup(), with args from cpu_switchto()/cpu_setfunc()
-       PTR_LA  t0, _C_LABEL(lwp_startup)
        move    a0, v0
-       jal     ra, t0
-       move    a1, s7
+       jal     _C_LABEL(lwp_startup)
+       move    a1, MIPS_CURLWP
 
        # Call the routine specified by cpu_setfunc()
        jal     ra, s0                  
diff -r 6bc75090cb89 -r 3683b226c558 sys/arch/mips/mips/vm_machdep.c
--- a/sys/arch/mips/mips/vm_machdep.c   Wed Dec 22 01:03:02 2010 +0000
+++ b/sys/arch/mips/mips/vm_machdep.c   Wed Dec 22 01:34:17 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.130 2009/12/14 04:37:02 matt Exp $    */
+/*     $NetBSD: vm_machdep.c,v 1.131 2010/12/22 01:34:17 nisimura Exp $        */
 
 /*
  * Copyright (c) 1992, 1993
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.130 2009/12/14 04:37:02 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.131 2010/12/22 01:34:17 nisimura Exp $");
 
 #include "opt_ddb.h"
 
@@ -177,7 +177,6 @@
         */
        pcb2->pcb_context.val[_L_S0] = (intptr_t)func;                  /* S0 */
        pcb2->pcb_context.val[_L_S1] = (intptr_t)arg;                   /* S1 */
-       pcb2->pcb_context.val[MIPS_CURLWP_CARD - 16] = (intptr_t)l2;    /* S? */
        pcb2->pcb_context.val[_L_SP] = (intptr_t)f;                     /* SP */
        pcb2->pcb_context.val[_L_RA] = (intptr_t)lwp_trampoline;        /* RA */
 #ifdef _LP64
@@ -199,7 +198,6 @@
 
        pcb->pcb_context.val[_L_S0] = (intptr_t)func;                   /* S0 */
        pcb->pcb_context.val[_L_S1] = (intptr_t)arg;                    /* S1 */
-       pcb->pcb_context.val[MIPS_CURLWP_CARD - 16] = (intptr_t)l;      /* S? */
        pcb->pcb_context.val[_L_SP] = (intptr_t)f;                      /* SP */
        pcb->pcb_context.val[_L_RA] = (intptr_t)setfunc_trampoline;     /* RA */
 #ifdef _LP64



Home | Main Index | Thread Index | Old Index