Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/arch/sparc64/sparc64 Approved by thorpej:



details:   https://anonhg.NetBSD.org/src/rev/66f7c9cca9ac
branches:  netbsd-1-5
changeset: 488763:66f7c9cca9ac
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Thu Jul 27 00:17:29 2000 +0000

description:
Approved by thorpej:
Fix bugs in bzero(), and many stack bias problems.

syssrc/sys/arch/sparc64/sparc64/locore.s                1.82 -> 1.85
syssrc/sys/arch/sparc64/sparc64/locore.s                1.86 -> 1.89
(Part of 1.85 omitted, since it's not related.)

diffstat:

 sys/arch/sparc64/sparc64/locore.s |  64 ++++++++++++--------------------------
 1 files changed, 20 insertions(+), 44 deletions(-)

diffs (148 lines):

diff -r a8954edaa93a -r 66f7c9cca9ac sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Thu Jul 27 00:17:18 2000 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Thu Jul 27 00:17:29 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.62.2.1 2000/07/18 16:23:27 mrg Exp $      */
+/*     $NetBSD: locore.s,v 1.62.2.2 2000/07/27 00:17:29 mycroft Exp $  */
 /*
  * Copyright (c) 1996-1999 Eduardo Horvath
  * Copyright (c) 1996 Paul Kranenburg
@@ -4341,7 +4341,7 @@
        tst     %o2
        tnz     %icc, 1; nop
 1:     
-       set     EINTSTACK, %o2
+       set     EINTSTACK-STKB, %o2
        cmp     %sp, %o2
        bleu    0f
 
@@ -8438,10 +8438,10 @@
        brz,pn  %l3, 1f                                 ! Make sure we have an fpstate
         mov    %l3, %o0
        call    _C_LABEL(savefpstate)                   ! Save the old fpstate
-        set    EINTSTACK, %l4                          ! Are we on intr stack?
+        set    EINTSTACK-STKB, %l4                     ! Are we on intr stack?
        cmp     %sp, %l4
        bgu,pt  %xcc, 1f
-        set    INTSTACK, %l4
+        set    INTSTACK-STKB, %l4
        cmp     %sp, %l4
        blu     %xcc, 1f
 0:     
@@ -8497,14 +8497,6 @@
        fzero   %f10
        fzero   %f12
        fzero   %f14
-       fzero   %f16                            ! And second bank
-       fzero   %f18
-       fzero   %f20
-       fzero   %f22
-       fzero   %f24
-       fzero   %f26
-       fzero   %f28
-       fzero   %f30
        
        stxa    %o3, [%o3] ASI_DMMU_DEMAP       ! Do the demap
        membar  #Sync                           ! No real reason for this XXXX
@@ -8525,7 +8517,7 @@
        stda    %f0, [%o2] ASI_BLK_COMMIT_P             ! Store 64 bytes
        add     %o2, 64, %o2
        dec     128, %o4
-       stda    %f16, [%o2] ASI_BLK_COMMIT_P            ! Store 64 bytes
+       stda    %f0, [%o2] ASI_BLK_COMMIT_P             ! Store 64 bytes
        brgz,pt %o4, 1b
         add    %o2, 64, %o2
 
@@ -8737,10 +8729,10 @@
        brz,pn  %l3, 1f                                 ! Make sure we have an fpstate
         mov    %l3, %o0
        call    _C_LABEL(savefpstate)                   ! Save the old fpstate
-        set    EINTSTACK, %l4                          ! Are we on intr stack?
+        set    EINTSTACK-STKB, %l4                     ! Are we on intr stack?
        cmp     %sp, %l4
        bgu,pt  %xcc, 1f
-        set    INTSTACK, %l4
+        set    INTSTACK-STKB, %l4
        cmp     %sp, %l4
        blu     %xcc, 1f
 0:     
@@ -9588,7 +9580,7 @@
 3:     
        stx     %o2, [%o0]              ! Do 1 longword at a time
        deccc   8, %o1
-       bge,pt  %xcc, 3b
+       brgez,pt        %o1, 3b
         inc    8, %o0
 
        /*
@@ -9675,20 +9667,17 @@
        save    %sp, -(CC64FSZ+FS_SIZE+BLOCK_SIZE), %sp ! Allocate an fpstate
        sethi   %hi(FPPROC), %l1
        LDPTR   [%l1 + %lo(FPPROC)], %l2                ! Load fpproc
-       btst    1, %sp
-       add     %sp, (CC64FSZ+BLOCK_SIZE-1), %l0        ! Calculate pointer to fpstate
-       add     %l0, BIAS, %l3
-       movnz   %xcc, %l3, %l0
+       add     %sp, (CC64FSZ+STKB+BLOCK_SIZE-1), %l0   ! Calculate pointer to fpstate
        brz,pt  %l2, 1f                                 ! fpproc == NULL?
         andn   %l0, BLOCK_ALIGN, %l0                   ! And make it block aligned
        LDPTR   [%l2 + P_FPSTATE], %l3
        brz,pn  %l3, 1f                                 ! Make sure we have an fpstate
         mov    %l3, %o0
        call    _C_LABEL(savefpstate)                   ! Save the old fpstate
-        set    EINTSTACK, %l4                          ! Are we on intr stack?
+        set    EINTSTACK-STKB, %l4                     ! Are we on intr stack?
        cmp     %sp, %l4
        bgu,pt  %xcc, 1f
-        set    INTSTACK, %l4
+        set    INTSTACK-STKB, %l4
        cmp     %sp, %l4
        blu     %xcc, 1f
 0:     
@@ -9720,22 +9709,17 @@
         dec    8, %i1
 
 2:
-       brz,pt  %i2, 4f                                 ! Do we have a pattern to load?
-        fzero  %f0                                     ! Set up FPU
-
-       btst    1, %fp
-       bnz,pt  %icc, 3f                                ! 64-bit stack?
-        nop
-       stw     %i2, [%fp + 0x28]                       ! Flush this puppy to RAM
+#ifdef _LP64
+       stx     %i2, [%sp + BIAS + 0x50]                ! Flush this puppy to RAM
        membar  #StoreLoad
-       ld      [%fp + 0x28], %f0
-       ba,pt   %icc, 4f
-        fmovsa %icc, %f0, %f1
-3:     
-       stx     %i2, [%fp + BIAS + 0x50]                ! Flush this puppy to RAM
+       ldd     [%sp + BIAS + 0x50], %f0
+#else
+       stw     %i2, [%sp + 0x28]                       ! Flush this puppy to RAM
        membar  #StoreLoad
-       ldd     [%fp + BIAS + 0x50], %f0
-4:     
+       ld      [%sp + 0x28], %f0
+       fmovsa  %icc, %f0, %f1
+#endif
+
        fmovda  %icc, %f0, %f2                          ! Duplicate the pattern
        fmovda  %icc, %f0, %f4
        fmovda  %icc, %f0, %f6
@@ -9743,14 +9727,6 @@
        fmovda  %icc, %f0, %f10
        fmovda  %icc, %f0, %f12
        fmovda  %icc, %f0, %f14
-       fmovda  %icc, %f0, %f16                         ! And second bank
-       fmovda  %icc, %f0, %f18
-       fmovda  %icc, %f0, %f20
-       fmovda  %icc, %f0, %f22
-       fmovda  %icc, %f0, %f24
-       fmovda  %icc, %f0, %f26
-       fmovda  %icc, %f0, %f28
-       fmovda  %icc, %f0, %f30
        
        !! Remember: we were 8 bytes too far
        dec     56, %i1                 ! Go one iteration too far



Home | Main Index | Thread Index | Old Index