Module Name: src
Committed By: matt
Date: Mon Jul 9 17:11:32 UTC 2012
Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: locore_mips1.S mipsX_subr.S
Log Message:
Add code to panic if/when a kthread return to lwp_startup.
Add a workaround for the XLP which requires a EHB at the start of the interrupt
vector.
To generate a diff of this commit:
cvs rdiff -u -r1.64.26.1.2.15 -r1.64.26.1.2.16 \
src/sys/arch/mips/mips/locore_mips1.S
cvs rdiff -u -r1.26.36.1.2.56 -r1.26.36.1.2.57 \
src/sys/arch/mips/mips/mipsX_subr.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/locore_mips1.S
diff -u src/sys/arch/mips/mips/locore_mips1.S:1.64.26.1.2.15 src/sys/arch/mips/mips/locore_mips1.S:1.64.26.1.2.16
--- src/sys/arch/mips/mips/locore_mips1.S:1.64.26.1.2.15 Thu Feb 9 20:01:21 2012
+++ src/sys/arch/mips/mips/locore_mips1.S Mon Jul 9 17:11:32 2012
@@ -1511,6 +1511,15 @@ LEAF(MIPSX(lwp_trampoline))
jalr s0
move a0, s1
+#ifdef DIAGNOSTIC
+ INT_L v0, L_FLAG(MIPS_CURLWP)
+ and v0, LW_SYSTEM
+ beqz v0, 1f
+ nop
+ PANIC("kthread failed to call kthread_exit!")
+1:
+#endif
+
# Return to user (won't happen if a kernel thread)
.set noat
MIPSX(user_return):
Index: src/sys/arch/mips/mips/mipsX_subr.S
diff -u src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.56 src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.57
--- src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.56 Mon Feb 27 17:04:39 2012
+++ src/sys/arch/mips/mips/mipsX_subr.S Mon Jul 9 17:11:32 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: mipsX_subr.S,v 1.26.36.1.2.56 2012/02/27 17:04:39 matt Exp $ */
+/* $NetBSD: mipsX_subr.S,v 1.26.36.1.2.57 2012/07/09 17:11:32 matt Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@@ -601,8 +601,13 @@ _VECTOR_END(MIPSX(exception))
*/
VECTOR(MIPSX(intr), unknown)
.set noat
+#if (MIPS64R2_RMIXL) > 0
+ EHB #work around chip bug
+#endif
mfc0 k1, MIPS_COP_0_STATUS #00: get the status register
+#if (MIPS3) > 0
nop #01: stall
+#endif
and k1, k1, MIPS3_SR_KSU_USER #02: test for user mode
PTR_LA k0, MIPSX(user_intr) #03: assume user mode
bnez k1, 1f #05: yep, do it
@@ -2598,6 +2603,14 @@ LEAF(MIPSX(lwp_trampoline))
jalr s0
move a0, s1
+#ifdef DIAGNOSTIC
+ INT_L v0, L_FLAG(MIPS_CURLWP)
+ and v0, LW_SYSTEM
+ beqz v0, 1f
+ nop
+ PANIC("kthread failed to call kthread_exit!")
+1:
+#endif
#
# Return to user (won't happen if a kernel thread)
#