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 pull up 1.75 .. 1.82, 1.86 & 1...



details:   https://anonhg.NetBSD.org/src/rev/14dfa31a4023
branches:  netbsd-1-5
changeset: 488832:14dfa31a4023
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Jul 31 05:12:43 2000 +0000

description:
pull up 1.75 .. 1.82, 1.86 & 1.90 (approved by thorpej):
1.75
>If `ih_pending' is set simply return from the trap, don't schedule another
>soft interrupt.
1.76
>probeget: 9 -> 0x9
1.77
>Correct args usage comment in probeget.
1.78
>Whitespace cleanup.
1.79
>Miscellaneous cleanup.
1.80
>Disable interrupt interlock using ih->ih_pending field.  Seems to cause
>more problems than it solves.
1.81
>Fix merge problem.
1.82
>Since `intrcnt' points to an array of long ints, reserve the appropriate
>amount of space depending on _LP64. Provide macros to load/store signed
>and unsigned long ints.
>
>Also, make the `intrcnt' and `intrpending' arrays 16 entries long, as on
>sparc/v9 interrupt #15 is just a regular interrupt.
1.86
>Cosmetic & readability:
>       - local label cleanup in interrupt handling code;
>       - in debugging sections when testing `intrdebug': use a unique
>         local label (97) to enhanced clarity;
>       - comment-out unused code;
>       - kill a bug as the satisfying result of doing all of the above.
1.90
>Re-instate a couple of delay slot NOPs marked `XXX spitfire bug?'

diffstat:

 sys/arch/sparc64/sparc64/locore.s |  1464 +++++++++++++++++++-----------------
 1 files changed, 763 insertions(+), 701 deletions(-)

diffs (truncated from 4418 to 300 lines):

diff -r 031a34d7e9d6 -r 14dfa31a4023 sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Mon Jul 31 02:50:53 2000 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Mon Jul 31 05:12:43 2000 +0000
@@ -1,12 +1,12 @@
-/*     $NetBSD: locore.s,v 1.62.2.2 2000/07/27 00:17:29 mycroft Exp $  */
+/*     $NetBSD: locore.s,v 1.62.2.3 2000/07/31 05:12:43 mrg Exp $      */
 /*
  * Copyright (c) 1996-1999 Eduardo Horvath
  * Copyright (c) 1996 Paul Kranenburg
  * Copyright (c) 1996
- *     The President and Fellows of Harvard College. 
+ *     The President and Fellows of Harvard College.
  *     All rights reserved.
  * Copyright (c) 1992, 1993
- *     The Regents of the University of California. 
+ *     The Regents of the University of California.
  *     All rights reserved.
  *
  * This software was developed by the Computer Systems Engineering group
@@ -26,24 +26,24 @@
  *    notice, this list of conditions and the following disclaimer.
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the 
+ *    documentation and/or other materials provided with the
  *    distribution.
- * 3. All advertising materials mentioning features or use of this 
+ * 3. All advertising materials mentioning features or use of this
  *    software must display the following acknowledgement:
  *     This product includes software developed by the University of
  *     California, Berkeley and its contributors.
  *     This product includes software developed by Harvard University.
  *     This product includes software developed by Paul Kranenburg.
- * 4. Neither the name of the University nor the names of its 
- *    contributors may be used to endorse or promote products derived 
+ * 4. Neither the name of the University nor the names of its
+ *    contributors may be used to endorse or promote products derived
  *    from this software without specific prior written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' 
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS''
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
@@ -55,7 +55,8 @@
  */
 #define        DIAGNOSTIC
 
-#undef PHYS_CLEAR
+#undef INTR_INTERLOCK          /* Use IH_PEND field to interlock interrupts */
+#undef PARANOID                /* Extremely expensive consistency checks */
 #undef NO_VCACHE               /* Map w/D$ disabled */
 #define        TRAPTRACE               /* Keep history of all traps (unsafe) */
 #undef FLTRACE                 /* Keep history of all page faults */
@@ -71,7 +72,7 @@
 #undef NO_TSB                  /* Don't use TSB */
 #undef TICK_IS_TIME            /* Keep %tick synchronized with time */
 #undef SCHED_DEBUG
-       
+
 #include "opt_ddb.h"
 #include "opt_compat_svr4.h"
 #include "opt_compat_sunos.h"
@@ -118,7 +119,7 @@
 
 #if 1
 /*
- * Try to issue an elf note to ask the Solaris 
+ * Try to issue an elf note to ask the Solaris
  * bootloader to align the kernel properly.
  */
        .section        .note
@@ -126,7 +127,7 @@
        .word   4               ! Dunno why
        .word   1
 0:     .asciz  "SUNW Solaris"
-1:     
+1:
        .align  4
        .word   0x0400000
 #endif
@@ -139,34 +140,47 @@
 /* reg that points to base of data/text segment */
 #define        BASEREG %g4
 /* first constants for storage allocation */
-#define PTRSZ  8
-#define PTRSHFT        3
-#define        POINTER .xword
-/* Now instructions to load/store pointers */
-#define LDPTR  ldx
-#define LDPTRA ldxa
-#define STPTR  stx
-#define STPTRA stxa
-#define        CASPTR  casxa
+#define LONGINTSIZE    8
+#define LONGINTSHFT    3
+#define PTRSZ          8
+#define PTRSHFT                3
+#define        POINTER         .xword
+/* Now instructions to load/store pointers & long ints */
+#define LDLONGINT      ldx
+#define LDULONGINT     ldx
+#define STLONGINT      stx
+#define STULONGINT     stx
+#define LDPTR          ldx
+#define LDPTRA         ldxa
+#define STPTR          stx
+#define STPTRA         stxa
+#define        CASPTR          casxa
 /* Now something to calculate the stack bias */
 #define STKB   BIAS
 #else
 #define        BASEREG %g0
-#define PTRSZ  4
-#define PTRSHFT        2
-#define POINTER        .word
-#define LDPTR  lduw
-#define LDPTRA lduwa
-#define STPTR  stw
-#define STPTRA stwa
-#define        CASPTR  casa
+#define LONGINTSIZE    4
+#define LONGINTSHFT    2
+#define PTRSZ          4
+#define PTRSHFT                2
+#define POINTER                .word
+/* Instructions to load/store pointers & long ints */
+#define LDLONGINT      ldsw
+#define LDULONGINT     lduw
+#define STLONGINT      stw
+#define STULONGINT     stw
+#define LDPTR          lduw
+#define LDPTRA         lduwa
+#define STPTR          stw
+#define STPTRA         stwa
+#define        CASPTR          casa
 #define STKB   0
 #endif
 
 /*
  * GNU assembler does not understand `.empty' directive; Sun assembler
  * gripes about labels without it.  To allow cross-compilation using
- * the Sun assembler, and because .empty directives are useful 
+ * the Sun assembler, and because .empty directives are useful
  * documentation, we use this trick.
  */
 #ifdef SUN_AS
@@ -182,7 +196,7 @@
 /* Give this real authority: reset the machine */
 #if 1
 #define NOTREACHED     sir
-#else  
+#else
 #define NOTREACHED
 #endif
 
@@ -207,7 +221,7 @@
 #define DLFLUSH(a,t)
 #define DLFLUSH2(t)
 #endif
-       
+
 
 /*
  * A handy macro for maintaining instrumentation counters.
@@ -260,18 +274,22 @@
  * regardless of the current stack.
  */
 
-#ifdef _LP64
-#define STACKFRAME(size)                                       \
+#define TO_STACK64(size)                                       \
        andcc   %sp, 1, %g0; /* 64-bit stack? */                \
        save    %sp, size, %sp;                                 \
        add     %sp, -BIAS, %o0; /* Convert to 64-bits */       \
        movz    %icc, %o0, %sp
-#else
-#define STACKFRAME(size)                                       \
+
+#define TO_STACK32(size)                                       \
        andcc   %sp, 1, %g0; /* 64-bit stack? */                \
        save    %sp, size, %sp;                                 \
        add     %sp, +BIAS, %o0; /* Convert to 32-bits */       \
        movnz   %icc, %o0, %sp
+
+#ifdef _LP64
+#define        STACKFRAME(size)        TO_STACK64(size)
+#else
+#define        STACKFRAME(size)        TO_STACK32(size)
 #endif
 
 
@@ -352,7 +370,7 @@
 _C_LABEL(cpcb):        POINTER _C_LABEL(u0)
 
 /*
- * romp is the prom entry pointer 
+ * romp is the prom entry pointer
  */
        .globl  romp
 romp:  POINTER 0
@@ -455,7 +473,7 @@
 #else
 #define TRACEWIN       wrpr %g0, PSTATE_KERN|PSTATE_IG, %pstate;\
  sethi %hi(9f), %g1; ba,pt %icc,traceit; or %g1, %lo(9f), %g1; 9:
-#endif 
+#endif
 #define TRACERELOAD32  ba reload32; nop;
 #define TRACERELOAD64  ba reload64; nop;
 #define TRACEFLT       TRACEME
@@ -492,7 +510,7 @@
 #else
 #define TRACEWIN       wrpr %g0, PSTATE_KERN|PSTATE_IG, %pstate;\
  sethi %hi(9f), %g1; ba,pt %icc,traceit; or %g1, %lo(9f), %g1; 9:
-#endif 
+#endif
 #define TRACERELOAD32  ba reload32; nop;
 #define TRACERELOAD64  ba reload64; nop;
 #define TRACEFLT       TRACEME
@@ -521,7 +539,7 @@
        /* software interrupts (may not be made direct, sorry---but you
           should not be using them trivially anyway) */
 #define        SOFTINT4U(lev, bit) \
-       HARDINT4U(lev) 
+       HARDINT4U(lev)
 
        /* traps that just call trap() */
 #define        TRAP(type)      VTRAP(type, slowtrap)
@@ -532,7 +550,7 @@
 #else
 #define        UTRAP(type)     VTRAP(type, slowtrap)
 #endif
-       
+
        /* software undefined traps (may be replaced) */
 #define        STRAP(type)     VTRAP(type, slowtrap)
 
@@ -592,7 +610,7 @@
        CLRTT; \
        retry; \
        NOTREACHED; \
-       TA32            
+       TA32
 
        /* spill a 32-bit register window */
 #define SPILL32(label,as) \
@@ -622,7 +640,7 @@
        CLRTT; \
        retry; \
        NOTREACHED; \
-       TA32    
+       TA32
 
        /* Spill either 32-bit or 64-bit register window. */
 #define SPILLBOTH(label64,label32,as) \
@@ -693,7 +711,7 @@
        retry; \
        NOTREACHED; \
        TA32
-       
+
        /* fill either 32-bit or 64-bit register window. */
 #define FILLBOTH(label64,label32,as) \
        TRACEWIN; \
@@ -739,20 +757,20 @@
        rdpr %cleanwin, %o7             ! 024-027 = clean window trap
        inc %o7                         !       This handler is in-lined and cannot fault
        wrpr %g0, %o7, %cleanwin        !       Nucleus (trap&IRQ) code does not need clean windows
-       
+
        clr     %l0
 !      set     0xbadcafe, %l0          ! DEBUG
-       mov %l0,%l1; mov %l0,%l2        !       Clear out %l0-%l8 and %o0-%o8 and inc %cleanwin and done        
+       mov %l0,%l1; mov %l0,%l2        !       Clear out %l0-%l8 and %o0-%o8 and inc %cleanwin and done
        mov %l0,%l3; mov %l0,%l4
 #if 0
 #ifdef DIAGNOSTIC
-       !! 
+       !!
        !! Check the sp redzone
        !!
        !! Since we can't spill the current window, we'll just keep
        !! track of the frame pointer.  Problems occur when the routine
        !! allocates and uses stack storage.
-       !! 
+       !!
 !      rdpr    %wstate, %l5    ! User stack?
 !      cmp     %l5, WSTATE_KERN
 !      bne,pt  %icc, 7f
@@ -763,15 +781,15 @@
        sub     %fp, %l5, %l7
        bnz,a,pt        %icc, 1f



Home | Main Index | Thread Index | Old Index