Module Name:    src
Committed By:   matt
Date:           Wed Dec 22 06:08:10 UTC 2010

Modified Files:
        src/sys/arch/mips/mips [matt-nb5-mips64]: spl.S

Log Message:
If we are MULTIPROCESSOR (which means preemption is enabled), we need to
reload curcpu() after disabling interrupts since we have been preempted
to a different CPU before interrupt got disabled.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 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.1.2.7 src/sys/arch/mips/mips/spl.S:1.1.2.8
--- src/sys/arch/mips/mips/spl.S:1.1.2.7	Wed Jun  9 14:25:30 2010
+++ src/sys/arch/mips/mips/spl.S	Wed Dec 22 06:08:10 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: spl.S,v 1.1.2.7 2010/06/09 14:25:30 matt Exp $	*/
+/*	$NetBSD: spl.S,v 1.1.2.8 2010/12/22 06:08:10 matt Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -29,6 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "opt_multiprocessor.h"	/* MP kernel? */
 #include "opt_cputype.h"	/* which mips CPU levels do we support? */
 
 #include <sys/cdefs.h>
@@ -37,7 +38,7 @@
 #include <mips/asm.h>
 #include <mips/cpuregs.h>
 
-RCSID("$NetBSD: spl.S,v 1.1.2.7 2010/06/09 14:25:30 matt Exp $")
+RCSID("$NetBSD: spl.S,v 1.1.2.8 2010/12/22 06:08:10 matt Exp $")
 
 #include "assym.h"
 
@@ -76,6 +77,9 @@
 	DYNAMIC_STATUS_MASK(a0,v0)		# machine dependent masking
 	mtc0	zero, MIPS_COP_0_STATUS		## disable interrupts
 	COP0_SYNC
+#ifdef MULTIPROCESSOR
+	PTR_L	a3, L_CPU(MIPS_CURLWP)		## make sure curcpu is correct
+#endif
 	INT_S	a1, CPU_INFO_CPL(a3)		## save IPL in cpu_info
 	mtc0	a0, MIPS_COP_0_STATUS		## store back
 	COP0_SYNC
@@ -220,6 +224,9 @@
 	DYNAMIC_STATUS_MASK(a0,a2)		# machine dependent masking
 	mtc0	a0, MIPS_COP_0_STATUS		## store back
 	COP0_SYNC
+#ifdef MULTIPROCESSOR
+	PTR_L	a3, L_CPU(MIPS_CURLWP)		## make sure curcpu is correct
+#endif
 	INT_S	a1, CPU_INFO_CPL(a3)		## save IPL in cpu_info
 #ifdef PARANOIA
 	j	ra				## return

Reply via email to