Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mips/mips Use the new COP0* stuff in cpuregs.h



details:   https://anonhg.NetBSD.org/src/rev/438ea58be342
branches:  trunk
changeset: 763885:438ea58be342
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Apr 06 05:48:35 2011 +0000

description:
Use the new COP0* stuff in cpuregs.h

diffstat:

 sys/arch/mips/mips/spl.S |  47 ++++++++++++++---------------------------------
 1 files changed, 14 insertions(+), 33 deletions(-)

diffs (128 lines):

diff -r 7d52811dba50 -r 438ea58be342 sys/arch/mips/mips/spl.S
--- a/sys/arch/mips/mips/spl.S  Wed Apr 06 05:47:54 2011 +0000
+++ b/sys/arch/mips/mips/spl.S  Wed Apr 06 05:48:35 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spl.S,v 1.4 2011/03/08 15:05:40 tsutsui Exp $  */
+/*     $NetBSD: spl.S,v 1.5 2011/04/06 05:48:35 matt Exp $     */
 
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -38,27 +38,14 @@
 #include <mips/asm.h>
 #include <mips/cpuregs.h>
 
-RCSID("$NetBSD: spl.S,v 1.4 2011/03/08 15:05:40 tsutsui Exp $")
+RCSID("$NetBSD: spl.S,v 1.5 2011/04/06 05:48:35 matt Exp $")
 
 #include "assym.h"
 
-#if defined(MIPS1) || defined(MIPS2)
-#define        NOP_L           nop
+#if (MIPS1 + MIPS2) > 0
+#define        NOP_L   nop
 #else
-#define        NOP_L           /* nothing */
-#endif
-
-#undef COP0_SYNC
-#if defined(MIPS3) || defined(MIPS4)
-#define        COP0_SYNC       sll $0,$0,1; sll $0,$0,1; sll $0,$0,3 /* ssnop; ssnop; ehb */
-#elif defined(MIPS32) || defined(MIPS64)
-#define        COP0_SYNC       sll $0,$0,1; sll $0,$0,1        /* ssnop; ssnop */
-#elif defined(MIPS32R2) || defined(MIPS64R2)
-#define        COP0_SYNC       sll $0,$0,3             /* ehb */
-#elif defined(MIPS1) || defined(MIPS2)
-#define        COP0_SYNC       nop
-#else
-#error missing one of MIPS1, MIPS2, MIPS3, MIPS4, MIPS32, MIPS32R2, MIPS64, MIPS64R2
+#define        NOP_L   /* nothing */
 #endif
 
        .data
@@ -157,7 +144,7 @@
        mtc0    v1, MIPS_COP_0_STATUS           ## store back
        COP0_SYNC
 #ifdef PARANOIA
-       j       ra
+       jr      ra
         nop                                    #  branch delay
 #endif /* PARANOIA */
 2:
@@ -172,7 +159,7 @@
 3:     bne     a1, v1, 3b
         nop                                    #  branch delay
 #endif /* PARANOIA */
-       j       ra
+       jr      ra
         nop                                    #  branch delay
 END(_splsw_splx)
 
@@ -194,9 +181,7 @@
 #error IPL_NONE != 0
 #endif
        mtc0    v0, MIPS_COP_0_STATUS           ## enable all sources
-       COP0_SYNC
-       j       ra                              # return
-        nop                                    #  branch delay
+       JR_HB_RA                                # return (clear hazards)
 END(_splsw_spl0)
 
 STATIC_LEAF(_splsw_setsoftintr)
@@ -209,9 +194,7 @@
        mtc0    v0, MIPS_COP_0_CAUSE            # store back
        COP0_SYNC
        mtc0    v1, MIPS_COP_0_STATUS           # enable interrupts
-       COP0_SYNC
-       j       ra
-        nop
+       JR_HB_RA                                # return (clear hazards)
 END(_splsw_setsoftintr)
 
 STATIC_LEAF(_splsw_clrsoftintr)
@@ -224,9 +207,7 @@
        mtc0    v0, MIPS_COP_0_CAUSE            # store back
        COP0_SYNC
        mtc0    v1, MIPS_COP_0_STATUS           # enable interrupts
-       COP0_SYNC
-       j       ra
-        nop                                    #  branch delay
+       JR_HB_RA                                # return (clear hazards)
 END(_splsw_clrsoftintr)
 
 STATIC_LEAF(_splsw_splraise)
@@ -259,7 +240,7 @@
 #endif
        INT_S   a1, CPU_INFO_CPL(a3)            ## save IPL in cpu_info
 #ifdef PARANOIA
-       j       ra                              ## return
+       jr      ra                              ## return
         nop                                    #  branch delay
 #endif /* PARANOIA */
 1:
@@ -269,7 +250,7 @@
 2:     bnez    v1, 2b                          # loop forever.
         nop                                    # branch delay
 #endif /* PARANOIA */
-       j       ra                              ## return
+       jr      ra                              ## return
         nop                                    # branch delay
 END(_splsw_splhigh)
 
@@ -353,7 +334,7 @@
         move   v1, ta2                         # whittle down pending intrs
 
 2:
-       j       ra
+       jr      ra
         INT_S  v1, (a0)                        # return a new pending mask
 END(_splsw_splintr)
 
@@ -375,7 +356,7 @@
 1:     bne     t0, t3, 1b                      # loop forever if not equal
         nop                                    #  branch delay
 #endif /* PARANOIA */
-       j       ra
+       jr      ra
         nop                                    #  branch delay
 END(_splsw_splcheck)
 



Home | Main Index | Thread Index | Old Index