diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/amd64/locore.S | 25 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/locore.S | 8 | ||||
-rw-r--r-- | sys/arch/hppa64/hppa64/locore.S | 8 | ||||
-rw-r--r-- | sys/arch/i386/i386/locore.s | 25 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/locore.s | 24 | ||||
-rw-r--r-- | sys/kern/kern_sched.c | 5 |
6 files changed, 9 insertions, 86 deletions
diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S index 16fe9ef57e3..5af0882f203 100644 --- a/sys/arch/amd64/amd64/locore.S +++ b/sys/arch/amd64/amd64/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.49 2011/09/03 01:21:00 guenther Exp $ */ +/* $OpenBSD: locore.S,v 1.50 2011/10/12 18:30:07 miod Exp $ */ /* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */ /* @@ -724,14 +724,6 @@ ENTRY(cpu_switchto) movq %rdi, %r13 movq %rsi, %r12 -#ifdef DIAGNOSTIC - xorq %rax,%rax - cmpq %rax,P_WCHAN(%r12) - jne _C_LABEL(switch_error2) - cmpb $SRUN,P_STAT(%r12) - jne _C_LABEL(switch_error3) -#endif - /* Record new proc. */ movb $SONPROC,P_STAT(%r12) # p->p_stat = SONPROC SET_CURPROC(%r12,%rcx) @@ -858,21 +850,6 @@ ENTRY(cpu_idle_leave) .globl _C_LABEL(panic) #ifdef DIAGNOSTIC -NENTRY(switch_error1) - movabsq $1f,%rdi - call _C_LABEL(panic) - /* NOTREACHED */ -1: .asciz "cpu_switch 1" -NENTRY(switch_error2) - movabsq $1f,%rdi - call _C_LABEL(panic) - /* NOTREACHED */ -1: .asciz "cpu_switch 2" -NENTRY(switch_error3) - movabsq $1f,%rdi - call _C_LABEL(panic) - /* NOTREACHED */ -1: .asciz "cpu_switch 3" NENTRY(switch_pmcpu_set) movabsq $1f,%rdi call _C_LABEL(panic) diff --git a/sys/arch/hppa/hppa/locore.S b/sys/arch/hppa/hppa/locore.S index 67465680f37..fd008f3c99d 100644 --- a/sys/arch/hppa/hppa/locore.S +++ b/sys/arch/hppa/hppa/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.186 2011/05/05 20:50:43 kettenis Exp $ */ +/* $OpenBSD: locore.S,v 1.187 2011/10/12 18:30:09 miod Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -2769,12 +2769,6 @@ Lcspstr .asciz "cpu_switch:old=%p, new=%p" .align 8 kstack_check - ldw P_WCHAN(arg1), t1 - comb,<>,n r0, t1, switch_error - nop - ldb P_STAT(arg1), t1 - comib,<>,n SRUN, t1, switch_error - nop /* * The new process' kernel stack must be reasonable. */ diff --git a/sys/arch/hppa64/hppa64/locore.S b/sys/arch/hppa64/hppa64/locore.S index 825c3b4b8d0..d6b28a6957f 100644 --- a/sys/arch/hppa64/hppa64/locore.S +++ b/sys/arch/hppa64/hppa64/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.40 2011/09/18 14:14:48 kettenis Exp $ */ +/* $OpenBSD: locore.S,v 1.41 2011/10/12 18:30:09 miod Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -1819,12 +1819,6 @@ Lcspstr .asciz "cpu_switchto: old=%p, new=%p" .align 8 kstack_check - ldd P_WCHAN(%arg1), %arg3 - comb,<>,n %r0, %arg3, switch_error - nop - ldb P_STAT(%arg1), %arg3 - comib,<>,n SRUN, %arg3, switch_error - nop /* * The new process' kernel stack must be reasonable. */ diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s index 7df7720ddaa..c98a6a3cb48 100644 --- a/sys/arch/i386/i386/locore.s +++ b/sys/arch/i386/i386/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.139 2011/07/09 01:49:16 pirofti Exp $ */ +/* $OpenBSD: locore.s,v 1.140 2011/10/12 18:30:09 miod Exp $ */ /* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */ /*- @@ -1160,21 +1160,6 @@ ENTRY(longjmp) /*****************************************************************************/ -#ifdef DIAGNOSTIC -NENTRY(switch_error1) - pushl %edi - pushl $1f - call _C_LABEL(panic) - /* NOTREACHED */ -1: .asciz "cpu_switch1 %p" -NENTRY(switch_error2) - pushl %edi - pushl $1f - call _C_LABEL(panic) - /* NOTREACHED */ -1: .asciz "cpu_switch2 %p" -#endif /* DIAGNOSTIC */ - /* * cpu_switchto(struct proc *old, struct proc *new) * Switch from the "old" proc to the "new" proc. If "old" is NULL, we @@ -1188,14 +1173,6 @@ ENTRY(cpu_switchto) movl 16(%esp), %esi movl 20(%esp), %edi -#ifdef DIAGNOSTIC - xorl %eax, %eax - cmpl %eax,P_WCHAN(%edi) # Waiting for something? - jne _C_LABEL(switch_error1) # Yes; shouldn't be queued. - cmpb $SRUN,P_STAT(%edi) # In run state? - jne _C_LABEL(switch_error2) # No; shouldn't be queued. -#endif /* DIAGNOSTIC */ - /* If old process exited, don't bother. */ testl %esi,%esi jz switch_exited diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s index f200b2a4d8b..3f401f849bb 100644 --- a/sys/arch/sparc64/sparc64/locore.s +++ b/sys/arch/sparc64/sparc64/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.163 2010/11/27 18:04:23 miod Exp $ */ +/* $OpenBSD: locore.s,v 1.164 2011/10/12 18:30:09 miod Exp $ */ /* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */ /* @@ -6019,19 +6019,6 @@ Lcopyfault: retl mov EFAULT, %o0 -Lsw_panic_wchan: - sethi %hi(1f), %o0 - call _C_LABEL(panic) - or %lo(1f), %o0, %o0 -Lsw_panic_srun: - sethi %hi(2f), %o0 - call _C_LABEL(panic) - or %lo(2f), %o0, %o0 - .data -1: .asciz "switch wchan" -2: .asciz "switch SRUN" - - .text /* * cpu_switchto(struct proc *old, struct proc *new) * @@ -6060,15 +6047,6 @@ ENTRY(cpu_switchto) * %o5 = <free> */ - /* firewalls */ - ldx [%i1 + P_WCHAN], %o0 ! if (newproc->p_wchan) - brnz,pn %o0, Lsw_panic_wchan ! panic("switch wchan"); -! XXX check no delay slot - ldsb [%i1 + P_STAT], %o0 ! if (newproc->p_stat != SRUN) - cmp %o0, SRUN - bne Lsw_panic_srun ! panic("switch SRUN"); -! XXX check no delay slot - /* * Committed to running process p. */ diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c index 1fd729eda14..b83b5ba0857 100644 --- a/sys/kern/kern_sched.c +++ b/sys/kern/kern_sched.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sched.c,v 1.23 2011/07/06 21:41:37 art Exp $ */ +/* $OpenBSD: kern_sched.c,v 1.24 2011/10/12 18:30:09 miod Exp $ */ /* * Copyright (c) 2007, 2008 Artur Grabowski <art@openbsd.org> * @@ -265,6 +265,7 @@ sched_chooseproc(void) } p = spc->spc_idleproc; KASSERT(p); + KASSERT(p->p_wchan == NULL); p->p_stat = SRUN; return (p); } @@ -274,6 +275,7 @@ again: queue = ffs(spc->spc_whichqs) - 1; p = TAILQ_FIRST(&spc->spc_qs[queue]); remrunqueue(p); + KASSERT(p->p_stat == SRUN); } else if ((p = sched_steal_proc(curcpu())) == NULL) { p = spc->spc_idleproc; if (p == NULL) { @@ -295,6 +297,7 @@ again: p->p_stat = SRUN; } + KASSERT(p->p_wchan == NULL); return (p); } |