Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/powerpc Make sure to restore SR 0 since ret...



details:   https://anonhg.NetBSD.org/src/rev/6983899c48b6
branches:  trunk
changeset: 514357:6983899c48b6
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Aug 30 22:00:48 2001 +0000

description:
Make sure to restore SR 0 since returning from a syscall is actually
one way of doing a process context switch.

diffstat:

 sys/arch/powerpc/powerpc/trap_subr.S |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (27 lines):

diff -r 2eb1b45e889c -r 6983899c48b6 sys/arch/powerpc/powerpc/trap_subr.S
--- a/sys/arch/powerpc/powerpc/trap_subr.S      Thu Aug 30 21:55:27 2001 +0000
+++ b/sys/arch/powerpc/powerpc/trap_subr.S      Thu Aug 30 22:00:48 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap_subr.S,v 1.10 2001/06/30 01:24:13 matt Exp $      */
+/*     $NetBSD: trap_subr.S,v 1.11 2001/08/30 22:00:48 matt Exp $      */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -542,6 +542,8 @@
 /* Restore user & kernel access SR: */                                 \
        lis     2,_C_LABEL(curpm)@ha;   /* get real address of pmap */  \
        lwz     2,_C_LABEL(curpm)@l(2);                                 \
+       lwz     3,PM_SR+0(2);                                           \
+       mtsr    0,3;                    /* restore SR0 */               \
        lwz     3,PM_SR+4(2);                                           \
        mtsr    1,3;                    /* restore SR1 */               \
        lwz     3,PM_SR+8(2);                                           \
@@ -805,6 +807,8 @@
        bc      4,17,1f                 /* branch if PSL_PR is false */
        lis     3,_C_LABEL(curpm)@ha    /* get current pmap real address */
        lwz     3,_C_LABEL(curpm)@l(3)
+       lwz     4,PM_SR+0(3)
+       mtsr    0,4                     /* Restore SR0 */
        lwz     4,PM_SR+4(3)
        mtsr    1,4                     /* Restore SR1 */
        lwz     4,PM_SR+8(3)



Home | Main Index | Thread Index | Old Index