Module Name:    src
Committed By:   matt
Date:           Wed Apr  6 05:48:35 UTC 2011

Modified Files:
        src/sys/arch/mips/mips: spl.S

Log Message:
Use the new COP0* stuff in cpuregs.h


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/mips/spl.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/mips/spl.S
diff -u src/sys/arch/mips/mips/spl.S:1.4 src/sys/arch/mips/mips/spl.S:1.5
--- src/sys/arch/mips/mips/spl.S:1.4	Tue Mar  8 15:05:40 2011
+++ src/sys/arch/mips/mips/spl.S	Wed Apr  6 05:48:35 2011
@@ -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)
 

Reply via email to