Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc/powerpc Don't zero curlwp/curpcb in cpu_swi...
details: https://anonhg.NetBSD.org/src/rev/47e4617de148
branches: trunk
changeset: 553490:47e4617de148
user: matt <matt%NetBSD.org@localhost>
date: Fri Oct 17 21:08:57 2003 +0000
description:
Don't zero curlwp/curpcb in cpu_switchto.
Use correct register in the store conditional.
Add DIAGNOSTIC check for null curpcb on cpu_switch exit.
diffstat:
sys/arch/powerpc/powerpc/locore_subr.S | 23 +++++++++++++++++++----
1 files changed, 19 insertions(+), 4 deletions(-)
diffs (62 lines):
diff -r 2f23eb491bc6 -r 47e4617de148 sys/arch/powerpc/powerpc/locore_subr.S
--- a/sys/arch/powerpc/powerpc/locore_subr.S Fri Oct 17 20:57:32 2003 +0000
+++ b/sys/arch/powerpc/powerpc/locore_subr.S Fri Oct 17 21:08:57 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore_subr.S,v 1.21 2003/09/25 18:42:18 matt Exp $ */
+/* $NetBSD: locore_subr.S,v 1.22 2003/10/17 21:08:57 matt Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -142,6 +142,8 @@
.rodata
.Lqspanic:
.string "cpu_switch: queue %d [%08x] is empty!"
+.Lcurpcbpanic:
+ .string "cpu_switch: curpcb is null!"
.text
.align 2
@@ -388,9 +390,9 @@
GET_CPUINFO(%r6)
stptru %r4,CI_CURPCB(%r6)
#ifdef PPC_OEA64
- stdcx. %r5,%r0,%r6 /* clear possible reservation */
+ stdcx. %r4,%r0,%r6 /* clear possible reservation */
#else
- stwcx. %r5,%r0,%r6 /* clear possible reservation */
+ stwcx. %r4,%r0,%r6 /* clear possible reservation */
#endif
isync
@@ -436,6 +438,17 @@
bl _C_LABEL(sched_unlock_idle)
#endif
+#if defined(DIAGNOSTIC)
+ GET_CPUINFO(%r3)
+ ldptr %r0,CI_CURPCB(%r3) /* load curcpu()->ci_curpcb */
+ or. %r0,%r0,%r0 /* is it NULL? */
+ bne 2f /* nope, that's good. */
+ lis %r3,.Lcurpcbpanic@ha /* get panic string (HI) */
+ addi %r3,%r3,.Lcurpcbpanic@l /* get panic string (LO) */
+ bl _C_LABEL(panic)
+2:
+#endif
+
mr %r3,%r30 /* restore return value */
/*
@@ -494,10 +507,12 @@
addi %r1,%r6,USPACE-CALLFRAMELEN /* callframe rsvd at stack top */
1:
-#endif
+#endif /* MULTIPROCESSOR */
+#if 0
li %r0,0
streg %r0,CI_CURLWP(%r7) /* Zero to not accumulate cpu time */
ldreg %r0,CI_CURPCB(%r7)
+#endif
/* Lock the scheduler. */
#if defined(PPC_IBM4XX)
Home |
Main Index |
Thread Index |
Old Index