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 remove CHKPT() macro and uses. it'...



details:   https://anonhg.NetBSD.org/src/rev/9ef8a3cf71f0
branches:  trunk
changeset: 751072:9ef8a3cf71f0
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sat Jan 23 22:55:04 2010 +0000

description:
remove CHKPT() macro and uses.  it's likely wrong in SMP land and probably should
be replaced with KTR-style uses if necessary.

diffstat:

 sys/arch/sparc64/sparc64/locore.s |  153 +-------------------------------------
 1 files changed, 1 insertions(+), 152 deletions(-)

diffs (truncated from 417 to 300 lines):

diff -r 1b04876692e6 -r 9ef8a3cf71f0 sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Sat Jan 23 22:32:42 2010 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Sat Jan 23 22:55:04 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.302 2010/01/23 21:46:59 mrg Exp $ */
+/*     $NetBSD: locore.s,v 1.303 2010/01/23 22:55:04 mrg Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -1195,118 +1195,6 @@
        .text
 #endif
 
-#ifdef DEBUG
-#define CHKREG(r) \
-       ldx     [%o0 + 8*1], %o1; \
-       cmp     r, %o1; \
-       stx     %o0, [%o0]; \
-       tne     1
-       .data
-globreg_debug:
-       .xword  -1, 0, 0, 0, 0, 0, 0, 0
-       .text
-globreg_set:
-       save    %sp, -CC64FSZ, %sp
-       set     globreg_debug, %o0
-       stx     %g0, [%o0]
-       stx     %g1, [%o0 + 8*1]
-       stx     %g2, [%o0 + 8*2]
-       stx     %g3, [%o0 + 8*3]
-       stx     %g4, [%o0 + 8*4]
-       stx     %g5, [%o0 + 8*5]
-       stx     %g6, [%o0 + 8*6]
-       stx     %g7, [%o0 + 8*7]
-       ret
-        restore
-globreg_check:
-       save    %sp, -CC64FSZ, %sp
-       rd      %pc, %o7
-       set     globreg_debug, %o0
-       ldx     [%o0], %o1
-       brnz,pn %o1, 1f         ! Don't re-execute this
-       CHKREG(%g1)
-       CHKREG(%g2)
-       CHKREG(%g3)
-       CHKREG(%g4)
-       CHKREG(%g5)
-       CHKREG(%g6)
-       CHKREG(%g7)
-       nop
-1:     ret
-        restore
-
-       /*
-        * Checkpoint:   store a byte value at DATA_START+0x21
-        *              uses two temp regs
-        */
-#define CHKPT(r1,r2,val) \
-       sethi   %hi(DATA_START), r1; \
-       mov     val, r2; \
-       stb     r2, [r1 + 0x21]
-
-       /*
-        * Debug routine:
-        *
-        * If datafault manages to get an unaligned pmap entry
-        * we come here.  We want to save as many regs as we can.
-        * %g3 has the sfsr, and %g7 the result of the wstate
-        * both of which we can toast w/out much lossage.
-        *
-        */
-       .data
-pmap_dumpflag:
-       .xword  0               ! semaphore
-       .globl  pmap_dumparea   ! Get this into the kernel syms
-pmap_dumparea:
-       .space  (32*8)          ! room to save 32 registers
-pmap_edumparea:
-       .text
-pmap_screwup:
-       rd      %pc, %g3
-       sub     %g3, (pmap_edumparea-pmap_dumparea), %g3! pc relative addressing 8^)
-       ldstub  [%g3+( 0*0x8)], %g3
-       tst     %g3             ! Semaphore set?
-       tnz     %xcc, 1; nop            ! Then trap
-       set     pmap_dumparea, %g3
-       stx     %g3, [%g3+( 0*0x8)]     ! set semaphore
-       stx     %g1, [%g3+( 1*0x8)]     ! Start saving regs
-       stx     %g2, [%g3+( 2*0x8)]
-       stx     %g3, [%g3+( 3*0x8)]     ! Redundant, I know...
-       stx     %g4, [%g3+( 4*0x8)]
-       stx     %g5, [%g3+( 5*0x8)]
-       stx     %g6, [%g3+( 6*0x8)]
-       stx     %g7, [%g3+( 7*0x8)]
-       stx     %i0, [%g3+( 8*0x8)]
-       stx     %i1, [%g3+( 9*0x8)]
-       stx     %i2, [%g3+(10*0x8)]
-       stx     %i3, [%g3+(11*0x8)]
-       stx     %i4, [%g3+(12*0x8)]
-       stx     %i5, [%g3+(13*0x8)]
-       stx     %i6, [%g3+(14*0x8)]
-       stx     %i7, [%g3+(15*0x8)]
-       stx     %l0, [%g3+(16*0x8)]
-       stx     %l1, [%g3+(17*0x8)]
-       stx     %l2, [%g3+(18*0x8)]
-       stx     %l3, [%g3+(19*0x8)]
-       stx     %l4, [%g3+(20*0x8)]
-       stx     %l5, [%g3+(21*0x8)]
-       stx     %l6, [%g3+(22*0x8)]
-       stx     %l7, [%g3+(23*0x8)]
-       stx     %o0, [%g3+(24*0x8)]
-       stx     %o1, [%g3+(25*0x8)]
-       stx     %o2, [%g3+(26*0x8)]
-       stx     %o3, [%g3+(27*0x8)]
-       stx     %o4, [%g3+(28*0x8)]
-       stx     %o5, [%g3+(29*0x8)]
-       stx     %o6, [%g3+(30*0x8)]
-       stx     %o7, [%g3+(31*0x8)]
-       ta      1; nop          ! Break into the debugger
-
-#else
-#define        CHKPT(r1,r2,val)
-#define CHKREG(r)
-#endif
-
 #ifdef NOTDEF_DEBUG
 /*
  * A hardware red zone is impossible.  We simulate one in software by
@@ -2079,7 +1967,6 @@
         sethi  %hi(CPCB), %g6          ! get current pcb
 
 
-       CHKPT(%g4,%g7,0x20)
        wrpr    %g1, 0, %tl             ! Pop a trap level
        rdpr    %tt, %g7                ! Read type of prev. trap
        rdpr    %tstate, %g4            ! Try to restore prev %cwp if we were executing a restore
@@ -2164,7 +2051,6 @@
        wrpr    %g0, 0, %cleanwin
        dec     1, %g5                                  ! NWINDOWS-1-1
        wrpr    %g5, 0, %cansave                        ! Invalidate all windows
-       CHKPT(%g5,%g7,0xe)
 !      flushw                                          ! DEBUG
        ba,pt   %icc, datafault
         wrpr   %g4, 0, %tnpc
@@ -2175,7 +2061,6 @@
        rdpr    %tt, %g5
        wrpr    %g0, 1, %tl                             ! Revert to TL==1 XXX what if this wasn't in rft_user? Oh well.
        wrpr    %g5, %g0, %tt                           ! Set trap type correctly
-       CHKPT(%g5,%g7,0xe)
 /*
  * Here we need to implement the beginning of datafault.
  * TRAP_SETUP expects to come from either kernel mode or
@@ -2205,7 +2090,6 @@
        set     0x20, %g6                               ! debug
        stx     %g0, [%g7]                              ! debug
        stb     %g6, [%g7 + 0x20]                       ! debug
-       CHKPT(%g4,%g7,0xf)
 #endif
        wr      %g0, ASI_DMMU, %asi                     ! We need to re-load trap info
        ldxa    [%g0 + TLB_TAG_ACCESS] %asi, %g1        ! Get fault address from tag access register
@@ -2247,7 +2131,6 @@
        set     0x12, %g5                               ! debug
        sethi   %hi(DATA_START), %g7                    ! debug
        stb     %g5, [%g7 + 0x20]                       ! debug
-       CHKPT(%g5,%g7,0x11)
 #endif
 
        /*
@@ -2317,7 +2200,6 @@
        sir                                             ! Force a watchdog
 1:
 #endif
-       CHKPT(%g5,%g7,0x12)
        rdpr    %otherwin, %g7
        brnz,pt %g7, 1f
         rdpr   %canrestore, %g5
@@ -2329,7 +2211,6 @@
        wrpr    %g7, 0, %otherwin                       ! Still in user mode -- need to switch to kernel mode
 1:
        mov     %g7, %g1
-       CHKPT(%g5,%g7,0x13)
        add     %g6, PCB_NSAVED, %g7
        DLFLUSH(%g7,%g5)
        lduba   [%g6 + PCB_NSAVED] %asi, %g7            ! Start incrementing pcb_nsaved
@@ -2343,7 +2224,6 @@
         saved                                          ! frob window registers
 
        /* PANIC */
-!      CHKPT(%g4,%g7,0x10)     ! Checkpoint
 !      sir                                             ! Force a watchdog
 #ifdef DEBUG
        wrpr    %g2, 0, %tl
@@ -2403,7 +2283,6 @@
 
        /* fix up pcb fields */
        stba    %g7, [%g6 + PCB_NSAVED] %asi            ! cpcb->pcb_nsaved = n
-       CHKPT(%g5,%g1,0x14)
 #if 0
        mov     %g7, %g5                                ! fixup window registers
 5:
@@ -2482,13 +2361,11 @@
        _ALIGN
        .text
 #endif
-       CHKPT(%g5,%g1,0x15)
 !      rdpr    %tl, %g2                                ! DEBUG DEBUG -- did we trap somewhere?
        sub     %g2, 1, %g1
        rdpr    %tt, %g2
        wrpr    %g1, 0, %tl                             ! We will not attempt to re-execute the spill, so dump our trap frame permanently
        wrpr    %g2, 0, %tt                             ! Move trap type from fault frame here, overwriting spill
-       CHKPT(%g2,%g5,0x16)
 
        /* Did we save a user or kernel window ? */
 !      srax    %g3, 48, %g5                            ! User or kernel store? (TAG TARGET)
@@ -2503,7 +2380,6 @@
        set     DATA_START, %g7                         ! debug
        set     0x11, %g6                               ! debug
        stb     %g6, [%g7 + 0x20]                       ! debug
-       CHKPT(%g2,%g1,0x17)
 !      sir
 #endif
        !!
@@ -2541,7 +2417,6 @@
 #endif
 
 #ifdef DEBUG
-       CHKPT(%g2,%g1,0x18)
        set     DATA_START, %g7                         ! debug
        set     0x19, %g6                               ! debug
        stb     %g6, [%g7 + 0x20]                       ! debug
@@ -2624,7 +2499,6 @@
        set     0x20, %g6                               ! debug
        stx     %g0, [%g7]                              ! debug
        stb     %g6, [%g7 + 0x20]                       ! debug
-       CHKPT(%g4,%g7,0xf)
 #endif
        wr      %g0, ASI_DMMU, %asi                     ! We need to re-load trap info
        ldxa    [%g0 + TLB_TAG_ACCESS] %asi, %g1        ! Get fault address from tag access register
@@ -2679,10 +2553,8 @@
        rdpr    %tl, %g7
        dec     %g7
        movrlz  %g7, %g0, %g7
-       CHKPT(%g1,%g3,0x21)
        wrpr    %g0, %g7, %tl           ! Revert to kernel mode
 #else
-       CHKPT(%g1,%g3,0x21)
        wrpr    %g0, 0, %tl             ! Revert to kernel mode
 #endif
        /* Finish stackframe, call C trap handler */
@@ -2734,7 +2606,6 @@
        wrpr    %g0, PSTATE_KERN, %pstate               ! disable interrupts
 
 data_recover:
-       CHKPT(%o1,%o2,1)
 #ifdef TRAPSTATS
        set     _C_LABEL(uintrcnt), %g1
        stw     %g0, [%g1]
@@ -2935,7 +2806,6 @@
        rdpr    %tl, %g7
        dec     %g7
        movrlz  %g7, %g0, %g7
-       CHKPT(%g1,%g3,0x22)
        wrpr    %g0, %g7, %tl           ! Revert to kernel mode
 
        wr      %g0, ASI_PRIMARY_NOFAULT, %asi          ! Restore default ASI
@@ -2954,7 +2824,6 @@
        call    _C_LABEL(text_access_fault)     ! mem_access_fault(&tf, type, pc, sfsr)
         add    %sp, CC64FSZ + STKB, %o0        ! (argument: &tf)
 text_recover:
-       CHKPT(%o1,%o2,2)
        wrpr    %g0, PSTATE_KERN, %pstate       ! disable interrupts
        b       return_from_trap                ! go return
         ldx    [%sp + CC64FSZ + STKB + TF_TSTATE], %g1 ! Load this for return_from_trap
@@ -3126,7 +2995,6 @@
        rdpr    %tl, %g1
        dec     %g1
        movrlz  %g1, %g0, %g1
-       CHKPT(%g2,%g3,0x24)
        wrpr    %g0, %g1, %tl           ! Revert to kernel mode
        !! In the EMBEDANY memory model %g4 points to the start of the data segment.
        !! In our case we need to clear it before calling any C-code
@@ -3137,7 +3005,6 @@
        call    _C_LABEL(trap)                  ! trap(tf, type, pc, pstate)
         nop
 
-       CHKPT(%o1,%o2,3)
        ba,a,pt %icc, return_from_trap
         nop
        NOTREACHED
@@ -3498,7 +3365,6 @@
        rd      %y, %o4
        stx     %g5, [%sp + CC64FSZ + STKB + TF_G + ( 5*8)]
        stx     %g6, [%sp + CC64FSZ + STKB + TF_G + ( 6*8)]
-       CHKPT(%g5,%g6,0x31)
        wrpr    %g0, 0, %tl                     ! return to tl=0
        stx     %g7, [%sp + CC64FSZ + STKB + TF_G + ( 7*8)]
        add     %sp, CC64FSZ + STKB, %o0        ! (&tf)
@@ -3527,9 +3393,7 @@
        /* see `lwp_trampoline' for the reason for this label */
 return_from_syscall:



Home | Main Index | Thread Index | Old Index