Module Name:    src
Committed By:   matt
Date:           Tue Dec 28 22:16:13 UTC 2010

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

Log Message:
Fix MIPS1 corruption problem (wrong register written to ci->ci_mtx_oldspl).


To generate a diff of this commit:
cvs rdiff -u -r1.9.18.11 -r1.9.18.12 src/sys/arch/mips/mips/lock_stubs.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/lock_stubs.S
diff -u src/sys/arch/mips/mips/lock_stubs.S:1.9.18.11 src/sys/arch/mips/mips/lock_stubs.S:1.9.18.12
--- src/sys/arch/mips/mips/lock_stubs.S:1.9.18.11	Fri Dec 24 07:13:19 2010
+++ src/sys/arch/mips/mips/lock_stubs.S	Tue Dec 28 22:16:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs.S,v 1.9.18.11 2010/12/24 07:13:19 matt Exp $	*/
+/*	$NetBSD: lock_stubs.S,v 1.9.18.12 2010/12/28 22:16:12 matt Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -492,7 +492,7 @@
 
 	bnez	ta2, 2f
 	 nop
-	INT_S	t1, CPU_INFO_MTX_OLDSPL(t2)
+	INT_S	ta1, CPU_INFO_MTX_OLDSPL(t2)
 2:
 #if defined(DIAGNOSTIC)
 	INT_L	t3, MTX_LOCK(t0)
@@ -649,6 +649,11 @@
 	/*
 	 * Mutex count is zero so we need to restore the old IPL
 	 */
+#ifdef PARANOIA
+	sltiu	v0, a0, IPL_HIGH+1
+13:	beqz	v0, 13b			# loop forever if ipl > IPL_HIGH
+	 nop
+#endif
 	j	 _C_LABEL(splx)
 	 nop
 1:

Reply via email to