Source-Changes-HG archive

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

[src/netbsd-3-0]: src/sys/arch/sparc64/sparc64 Pull up following revision(s) ...



details:   https://anonhg.NetBSD.org/src/rev/bc87d49534bf
branches:  netbsd-3-0
changeset: 579335:bc87d49534bf
user:      tron <tron%NetBSD.org@localhost>
date:      Mon Nov 06 17:27:21 2006 +0000

description:
Pull up following revision(s) (requested by nakayama in ticket #1517):
        sys/arch/sparc64/sparc64/locore.s: revision 1.217 via patch
        sys/arch/sparc64/sparc64/locore.s: revision 1.218 via patch
Fix a couple of %y register save/restore errors, inspired from OpenBSD.
  revision 1.44
  date: 2004/04/23 04:18:17;  author: marc;  state: Exp;  lines: +5 -4
  fix a couple of %y register save/restore errors
  1) don't save %y in a register that is later used before restoring %y
  2) always restore %y after calling a signal handler
  tested by drahn@, OK pval
>From OpenBSD:
- reload %fprs for checking it again.
- use symbolic names for checking in %fprs.
  revision 1.51
  date: 2005/07/18 14:50:11;  author: deraadt;  state: Exp;  lines: +2 -1
  cache a copy of the fprs so we know what fp restore we should do after
  revision 1.50
  date: 2005/07/14 01:46:13;  author: deraadt;  state: Exp;  lines: +4 -4
  use symbolic names for checking in %fprs, as above

diffstat:

 sys/arch/sparc64/sparc64/locore.s |  25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diffs (88 lines):

diff -r 1c2106fef04f -r bc87d49534bf sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Sat Oct 28 13:57:40 2006 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Mon Nov 06 17:27:21 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.204 2005/02/12 21:32:56 chs Exp $ */
+/*     $NetBSD: locore.s,v 1.204.6.1 2006/11/06 17:27:21 tron Exp $    */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -3022,7 +3022,7 @@
        stx     %g4, [%sp + CC64FSZ + STKB + TF_G + (4*8)]      ! sneak in g4
        rdpr    %tnpc, %g3
        stx     %g5, [%sp + CC64FSZ + STKB + TF_G + (5*8)]      ! sneak in g5
-       rd      %y, %g4                                 ! save y
+       rd      %y, %g5                                 ! save y
        stx     %g6, [%sp + CC64FSZ + STKB + TF_G + (6*8)]      ! sneak in g6
        mov     %g2, %o7                                ! Make the fault address look like the return address
        stx     %g7, [%sp + CC64FSZ + STKB + TF_G + (7*8)]      ! sneak in g7
@@ -3037,9 +3037,9 @@
        stx     %g2, [%sp + CC64FSZ + STKB + TF_PC]             ! set tf.tf_npc
        stx     %g3, [%sp + CC64FSZ + STKB + TF_NPC]
 
-       rdpr    %pil, %g5
-       stb     %g5, [%sp + CC64FSZ + STKB + TF_PIL]
-       stb     %g5, [%sp + CC64FSZ + STKB + TF_OLDPIL]
+       rdpr    %pil, %g4
+       stb     %g4, [%sp + CC64FSZ + STKB + TF_PIL]
+       stb     %g4, [%sp + CC64FSZ + STKB + TF_OLDPIL]
 
 #if 1
        rdpr    %tl, %g7
@@ -3087,7 +3087,7 @@
         */
 
        cmp     %o1, T_DATA_ERROR
-       st      %g4, [%sp + CC64FSZ + STKB + TF_Y]
+       st      %g5, [%sp + CC64FSZ + STKB + TF_Y]
        wr      %g0, ASI_PRIMARY_NOFAULT, %asi  ! Restore default ASI
        be,pn   %icc, data_error
         wrpr   %g0, PSTATE_INTR, %pstate       ! reenable interrupts
@@ -3287,7 +3287,7 @@
        stx     %g6, [%sp + CC64FSZ + STKB + TF_G + (6*8)]      ! sneak in g6
        rdpr    %tnpc, %g3
        stx     %g7, [%sp + CC64FSZ + STKB + TF_G + (7*8)]      ! sneak in g7
-       rd      %y, %g7                                 ! save y
+       rd      %y, %g5                                         ! save y
 
        /* Finish stackframe, call C trap handler */
        stx     %g1, [%sp + CC64FSZ + STKB + TF_TSTATE]         ! set tf.tf_psr, tf.tf_pc
@@ -3296,9 +3296,9 @@
        stx     %o2, [%sp + CC64FSZ + STKB + TF_PC]
        stx     %g3, [%sp + CC64FSZ + STKB + TF_NPC]            ! set tf.tf_npc
 
-       rdpr    %pil, %g5
-       stb     %g5, [%sp + CC64FSZ + STKB + TF_PIL]
-       stb     %g5, [%sp + CC64FSZ + STKB + TF_OLDPIL]
+       rdpr    %pil, %g4
+       stb     %g4, [%sp + CC64FSZ + STKB + TF_PIL]
+       stb     %g4, [%sp + CC64FSZ + STKB + TF_OLDPIL]
 
        rdpr    %tl, %g7
        dec     %g7
@@ -3316,7 +3316,7 @@
        /* Use trap type to see what handler to call */
        cmp     %o1, T_INST_ERROR
        be,pn   %xcc, text_error
-        st     %g7, [%sp + CC64FSZ + STKB + TF_Y]              ! set tf.tf_y
+        st     %g5, [%sp + CC64FSZ + STKB + TF_Y]              ! set tf.tf_y
 
        wrpr    %g0, PSTATE_INTR, %pstate       ! reenable interrupts
        call    _C_LABEL(text_access_fault)     ! mem_access_fault(&tf, type, pc, sfsr)
@@ -6815,6 +6815,7 @@
        lduw    [%fp + BIAS + 128 + 4], %o1     ! code
        call    %g1                     ! (*sa->sa_handler)(sig,code,scp)
         add    %fp, BIAS + 128 + 8, %o2        ! scp
+       wr      %l1, %g0, %y            ! in any case, restore %y
 
        /*
         * Now that the handler has returned, re-establish all the state
@@ -6834,7 +6835,7 @@
        ldda    [%l0] ASI_BLK_P, %f16
 1:
        bz,pt   %icc, 2f
-        wr     %l1, %g0, %y            ! in any case, restore %y
+        nop
        add     %sp, BIAS+CC64FSZ+BLOCK_SIZE, %l0       ! Generate a pointer so we can
        andn    %l0, BLOCK_ALIGN, %l0   ! do a block load
        inc     2*BLOCK_SIZE, %l0       ! and skip what we already loaded



Home | Main Index | Thread Index | Old Index