Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sh5/sh5 In switch_exit(), load the SP and FP from p...



details:   https://anonhg.NetBSD.org/src/rev/f6789e869d12
branches:  trunk
changeset: 538492:f6789e869d12
user:      scw <scw%NetBSD.org@localhost>
date:      Mon Oct 21 15:37:20 2002 +0000

description:
In switch_exit(), load the SP and FP from proc0's PCB instead of using
a "null" stack.
Also be sure to clear curproc, and update curpcb.

diffstat:

 sys/arch/sh5/sh5/cpu_switch.S |  15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diffs (38 lines):

diff -r ece430b36fc4 -r f6789e869d12 sys/arch/sh5/sh5/cpu_switch.S
--- a/sys/arch/sh5/sh5/cpu_switch.S     Mon Oct 21 15:36:35 2002 +0000
+++ b/sys/arch/sh5/sh5/cpu_switch.S     Mon Oct 21 15:37:20 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu_switch.S,v 1.13 2002/10/12 11:39:54 scw Exp $      */
+/*     $NetBSD: cpu_switch.S,v 1.14 2002/10/21 15:37:20 scw Exp $      */
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -474,12 +474,14 @@
  * another process to run.
  */
 ENTRY(switch_exit)
+       LEA(_C_LABEL(proc0), r1)
        getcon  kcr0, r0
-       LEA(Lnullpcb,r1)
-       movi    USPACE-8, r3
+       LDPTR   r1, P_ADDR, r1
        STPTR   r0, CI_CURPCB, r1       /* Set something useful in CURPCB */
-       add     r1, r3, r15             /* Switch to a temporary stack */
-                                       /* XXX: Should be per cpu... */
+       STPTR   r0, CI_CURPROC, r63     /* No process is current */
+       ld.q    r1, PCB_CTX_SP, r15     /* Switch to proc0's stack */
+       ld.q    r1, PCB_CTX_FP, r14
+
        LEAF(_C_LABEL(exit2), r0)
        ptabs/l r0, tr0
        blink   tr0, r18
@@ -496,9 +498,6 @@
        pta/l   Lsw1, tr0
        blink   tr0, r63
 
-       .comm   Lnullpcb,USPACE,0
-
-
 
 /******************************************************************************
  *



Home | Main Index | Thread Index | Old Index