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 Minor cleanup: remove unused code, ...



details:   https://anonhg.NetBSD.org/src/rev/4850519afd96
branches:  trunk
changeset: 555870:4850519afd96
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Dec 02 22:44:17 2003 +0000

description:
Minor cleanup: remove unused code, sync a comment with current reality.

diffstat:

 sys/arch/sparc64/sparc64/locore.s     |  25 ++++---------------------
 sys/arch/sparc64/sparc64/vm_machdep.c |  23 ++---------------------
 2 files changed, 6 insertions(+), 42 deletions(-)

diffs (95 lines):

diff -r f03204bc7035 -r 4850519afd96 sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Tue Dec 02 20:40:00 2003 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Tue Dec 02 22:44:17 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.184 2003/11/25 05:14:58 cdi Exp $ */
+/*     $NetBSD: locore.s,v 1.185 2003/12/02 22:44:17 martin Exp $      */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -4672,13 +4672,7 @@
        !!
        ldx     [%sp + CC64FSZ + STKB + TF_TSTATE], %g1
        btst    TSTATE_PRIV, %g1                        ! returning to userland?
-#if 0
-       bnz,pt  %icc, 0f
-        sethi  %hi(CURLWP), %o1
-       call    _C_LABEL(rwindow_save)                  ! Flush out our pcb
-        LDPTR  [%o1 + %lo(CURLWP)], %o0
-0:
-#endif
+
        !!
        !! Let all pending interrupts drain before returning to userland
        !!
@@ -8192,24 +8186,13 @@
         mov    %l1, %o0
 
        /*
-        * Here we finish up as in syscall, but simplified.  We need to
-        * fiddle pc and npc a bit, as execve() / setregs() /cpu_set_kpc()
-        * have only set npc, in anticipation that trap.c will advance past
-        * the trap instruction; but we bypass that, so we must do it manually.
+        * Here we finish up as in syscall, but simplified.
         */
        ldx     [%sp + CC64FSZ + STKB + TF_TSTATE], %g1
-       ldx     [%sp + CC64FSZ + STKB + TF_NPC], %g2    ! pc = tf->tf_npc from execve/fork
-!      rdpr    %cwp, %g5                       ! Fixup %cwp in %tstate
        srl     %g1, 0, %g1                     ! Clear out the condition codes
-!      add     %g2, 4, %g3                     ! npc = pc+4
-!      andn    %g1, CWP, %g1                   ! Clear the CWP bits
-!      stx     %g3, [%sp + CC64FSZ + STKB + TF_NPC]
-!      or      %g1, %g5, %g1   ! Not needed
-!      stx     %g2, [%sp + CC64FSZ + STKB + TF_PC]
        stx     %g1, [%sp + CC64FSZ + STKB + TF_TSTATE]
 #ifdef SCHED_DEBUG
-!      set     panicstack-CC64FSZ-STKB, %o0! DEBUG
-!      save    %g0, %o0, %sp   ! DEBUG
+       ldx     [%sp + CC64FSZ + STKB + TF_PC], %g2     ! pc = tf->tf_pc from execve/fork
        save    %sp, -CC64FSZ, %sp
        set     1f, %o0
        ldx     [%fp + CC64FSZ + STKB + TF_O + ( 6*8)], %o2
diff -r f03204bc7035 -r 4850519afd96 sys/arch/sparc64/sparc64/vm_machdep.c
--- a/sys/arch/sparc64/sparc64/vm_machdep.c     Tue Dec 02 20:40:00 2003 +0000
+++ b/sys/arch/sparc64/sparc64/vm_machdep.c     Tue Dec 02 22:44:17 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.51 2003/11/09 16:41:53 martin Exp $ */
+/*     $NetBSD: vm_machdep.c,v 1.52 2003/12/02 22:44:17 martin Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.51 2003/11/09 16:41:53 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.52 2003/12/02 22:44:17 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -279,25 +279,6 @@
        if (stack != NULL)
                tf2->tf_out[6] = (u_int64_t)(u_long)stack + stacksize;
 
-#if 0
-       /* XXX not needed if pc/npc adjusted in syscall */
-       /* Duplicate efforts of syscall(), but slightly differently */
-       if (tf2->tf_global[1] & SYSCALL_G7RFLAG) {
-               /* jmp %g2 (or %g7, deprecated) on success */
-               tf2->tf_npc = tf2->tf_global[7];
-       } else if (tf2->tf_global[1] & SYSCALL_G2RFLAG) {
-               /* jmp %g2 (or %g7, deprecated) on success */
-               tf2->tf_npc = tf2->tf_global[2];
-       } else {
-               /*
-                * old system call convention: clear C on success
-                * note: proc_trampoline() sets a fresh psr when
-                * returning to user mode.
-                */
-               /*tf2->tf_psr &= ~PSR_C;   -* success */
-       }
-#endif
-
        /* Set return values in child mode */
        tf2->tf_out[0] = 0;
        tf2->tf_out[1] = 1;



Home | Main Index | Thread Index | Old Index