Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/sparc64 Most of the time return_from_trap a...



details:   https://anonhg.NetBSD.org/src/rev/b8d2d4a57e7a
branches:  trunk
changeset: 341416:b8d2d4a57e7a
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Nov 05 10:11:51 2015 +0000

description:
Most of the time return_from_trap already got called with tf->tf_tstate
loaded in register %g1 - make it so for two more callers and remove
the reload of that value.

diffstat:

 sys/arch/sparc64/sparc64/locore.s |  19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diffs (75 lines):

diff -r 46602b6a384a -r b8d2d4a57e7a sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Thu Nov 05 09:28:30 2015 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Thu Nov 05 10:11:51 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.384 2015/04/05 20:34:00 palle Exp $       */
+/*     $NetBSD: locore.s,v 1.385 2015/11/05 10:11:51 martin Exp $      */
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -1954,7 +1954,7 @@
 #if 0 /* Need to switch over to new stuff to fix WDR bug */
        wrpr    %g5, %cwp                               ! Restore cwp from before fill trap -- regs should now be consisent
        wrpr    %g2, %g0, %tl                           ! Restore trap level -- we need to reuse it
-       set     return_from_trap, %g4
+       set     return_from_trap, %g4                   ! XXX - need to set %g1 to tstate
        set     CTX_PRIMARY, %g7
        wrpr    %g4, 0, %tpc
        stxa    %g0, [%g7] ASI_DMMU
@@ -2975,8 +2975,8 @@
        call    _C_LABEL(trap)                  ! trap(tf, type, pc, pstate)
         nop
 
-       ba,a,pt %icc, return_from_trap
-        nop
+       b       return_from_trap
+        ldx    [%sp + CC64FSZ + STKB + TF_TSTATE], %g1 ! Load this for return_from_trap
        NOTREACHED
 #if 1
 /*
@@ -3364,7 +3364,7 @@
 return_from_syscall:
        wrpr    %g0, PSTATE_KERN, %pstate       ! Disable intterrupts
        wrpr    %g0, 0, %tl                     ! Return to tl==0
-       ba,a,pt %icc, return_from_trap
+       b       return_from_trap
         nop
        NOTREACHED
 
@@ -3928,8 +3928,8 @@
        ldub    [%sp + CC64FSZ + STKB + TF_OLDPIL], %l3 ! restore old %pil
        wrpr    %l3, 0, %pil
 
-       ba,a,pt %icc, return_from_trap
-        nop
+       b       return_from_trap
+        ldx    [%sp + CC64FSZ + STKB + TF_TSTATE], %g1 ! Load this for return_from_trap
 
 #ifdef notyet
 /*
@@ -3962,6 +3962,7 @@
  * registers are:
  *
  *     [%sp + CC64FSZ + STKB] => trap frame
+ *      %g1 => tstate from trap frame
  *
  * We must load all global, out, and trap registers from the trap frame.
  *
@@ -3987,7 +3988,7 @@
        !!
        !! We'll make sure we flush our pcb here, rather than later.
        !!
-       ldx     [%sp + CC64FSZ + STKB + TF_TSTATE], %g1
+!      ldx     [%sp + CC64FSZ + STKB + TF_TSTATE], %g1 ! already passed in, no need to reload
        btst    TSTATE_PRIV, %g1                        ! returning to userland?
 
        !!
@@ -5965,7 +5966,7 @@
        /*
         * Here we finish up as in syscall, but simplified.
         */
-       ba,a,pt %icc, return_from_trap
+       b       return_from_trap
         nop
 
 /*



Home | Main Index | Thread Index | Old Index