summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-11-17 17:37:43 +0000
committerjhb <jhb@FreeBSD.org>2000-11-17 17:37:43 +0000
commit158d498abdea10736ba90f6a34f2ddbb15080172 (patch)
tree946a7936bff4795ab494eeca80aa4bf7f768f5a4 /sys
parent7ffd84a159c7ddeed12d643bcd8d9c920da02e04 (diff)
downloadFreeBSD-src-158d498abdea10736ba90f6a34f2ddbb15080172.zip
FreeBSD-src-158d498abdea10736ba90f6a34f2ddbb15080172.tar.gz
- Change extra sanity checks in cpu_switch() to be conditional on INVARIANTS
instead of DIAGNOSTIC. - Remove the p_wchan check as it no longer applies since a process may be switched out during CURSIG() within msleep() or mawait(). - Remove an extra sanity check only needed during the early SMPng work.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/cpu_switch.S34
-rw-r--r--sys/amd64/amd64/swtch.s34
-rw-r--r--sys/i386/i386/swtch.s34
3 files changed, 9 insertions, 93 deletions
diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S
index b538182..2d315fc 100644
--- a/sys/amd64/amd64/cpu_switch.S
+++ b/sys/amd64/amd64/cpu_switch.S
@@ -173,7 +173,7 @@ sw1:
sw1a:
call _chooseproc /* trash ecx, edx, ret eax*/
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
testl %eax,%eax /* no process? */
jz badsw3 /* no, panic */
#endif
@@ -183,9 +183,7 @@ sw1b:
xorl %eax,%eax
andl $~AST_RESCHED,_astpending
-#ifdef DIAGNOSTIC
- cmpl %eax,P_WCHAN(%ecx)
- jne badsw1
+#ifdef INVARIANTS
cmpb $SRUN,P_STAT(%ecx)
jne badsw2
#endif
@@ -325,23 +323,11 @@ cpu_switch_load_gs:
movl _curproc,%eax
movl %eax,_sched_lock+MTX_LOCK
-#ifdef DIAGNOSTIC
- pushfl
- popl %ecx
- testl $0x200, %ecx /* interrupts enabled? */
- jnz badsw6 /* that way madness lies */
-#endif
ret
CROSSJUMPTARGET(sw1a)
-#ifdef DIAGNOSTIC
-badsw1:
- pushl $sw0_1
- call _panic
-
-sw0_1: .asciz "cpu_switch: has wchan"
-
+#ifdef INVARIANTS
badsw2:
pushl $sw0_2
call _panic
@@ -353,20 +339,6 @@ badsw3:
call _panic
sw0_3: .asciz "cpu_switch: chooseproc returned NULL"
-
-#endif
-
-#ifdef DIAGNOSTIC
-badsw5:
- pushl $sw0_5
- call _panic
-
-sw0_5: .asciz "cpu_switch: interrupts enabled (again)"
-badsw6:
- pushl $sw0_6
- call _panic
-
-sw0_6: .asciz "cpu_switch: interrupts enabled"
#endif
/*
diff --git a/sys/amd64/amd64/swtch.s b/sys/amd64/amd64/swtch.s
index b538182..2d315fc 100644
--- a/sys/amd64/amd64/swtch.s
+++ b/sys/amd64/amd64/swtch.s
@@ -173,7 +173,7 @@ sw1:
sw1a:
call _chooseproc /* trash ecx, edx, ret eax*/
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
testl %eax,%eax /* no process? */
jz badsw3 /* no, panic */
#endif
@@ -183,9 +183,7 @@ sw1b:
xorl %eax,%eax
andl $~AST_RESCHED,_astpending
-#ifdef DIAGNOSTIC
- cmpl %eax,P_WCHAN(%ecx)
- jne badsw1
+#ifdef INVARIANTS
cmpb $SRUN,P_STAT(%ecx)
jne badsw2
#endif
@@ -325,23 +323,11 @@ cpu_switch_load_gs:
movl _curproc,%eax
movl %eax,_sched_lock+MTX_LOCK
-#ifdef DIAGNOSTIC
- pushfl
- popl %ecx
- testl $0x200, %ecx /* interrupts enabled? */
- jnz badsw6 /* that way madness lies */
-#endif
ret
CROSSJUMPTARGET(sw1a)
-#ifdef DIAGNOSTIC
-badsw1:
- pushl $sw0_1
- call _panic
-
-sw0_1: .asciz "cpu_switch: has wchan"
-
+#ifdef INVARIANTS
badsw2:
pushl $sw0_2
call _panic
@@ -353,20 +339,6 @@ badsw3:
call _panic
sw0_3: .asciz "cpu_switch: chooseproc returned NULL"
-
-#endif
-
-#ifdef DIAGNOSTIC
-badsw5:
- pushl $sw0_5
- call _panic
-
-sw0_5: .asciz "cpu_switch: interrupts enabled (again)"
-badsw6:
- pushl $sw0_6
- call _panic
-
-sw0_6: .asciz "cpu_switch: interrupts enabled"
#endif
/*
diff --git a/sys/i386/i386/swtch.s b/sys/i386/i386/swtch.s
index b538182..2d315fc 100644
--- a/sys/i386/i386/swtch.s
+++ b/sys/i386/i386/swtch.s
@@ -173,7 +173,7 @@ sw1:
sw1a:
call _chooseproc /* trash ecx, edx, ret eax*/
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
testl %eax,%eax /* no process? */
jz badsw3 /* no, panic */
#endif
@@ -183,9 +183,7 @@ sw1b:
xorl %eax,%eax
andl $~AST_RESCHED,_astpending
-#ifdef DIAGNOSTIC
- cmpl %eax,P_WCHAN(%ecx)
- jne badsw1
+#ifdef INVARIANTS
cmpb $SRUN,P_STAT(%ecx)
jne badsw2
#endif
@@ -325,23 +323,11 @@ cpu_switch_load_gs:
movl _curproc,%eax
movl %eax,_sched_lock+MTX_LOCK
-#ifdef DIAGNOSTIC
- pushfl
- popl %ecx
- testl $0x200, %ecx /* interrupts enabled? */
- jnz badsw6 /* that way madness lies */
-#endif
ret
CROSSJUMPTARGET(sw1a)
-#ifdef DIAGNOSTIC
-badsw1:
- pushl $sw0_1
- call _panic
-
-sw0_1: .asciz "cpu_switch: has wchan"
-
+#ifdef INVARIANTS
badsw2:
pushl $sw0_2
call _panic
@@ -353,20 +339,6 @@ badsw3:
call _panic
sw0_3: .asciz "cpu_switch: chooseproc returned NULL"
-
-#endif
-
-#ifdef DIAGNOSTIC
-badsw5:
- pushl $sw0_5
- call _panic
-
-sw0_5: .asciz "cpu_switch: interrupts enabled (again)"
-badsw6:
- pushl $sw0_6
- call _panic
-
-sw0_6: .asciz "cpu_switch: interrupts enabled"
#endif
/*
OpenPOWER on IntegriCloud