From cbec2d7db896cb69945c76003177cf61c46993b5 Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Tue, 31 Mar 2009 08:49:19 +0000 Subject: - remove obsolete comment - remove dead (#if 0) code - move switch_error panics to after cpu_switchto to make branch prediction happier and the code more readable. no functional change --- sys/arch/amd64/amd64/locore.S | 57 +++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 37 deletions(-) (limited to 'sys/arch') diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S index 89d9800b590..352944238a3 100644 --- a/sys/arch/amd64/amd64/locore.S +++ b/sys/arch/amd64/amd64/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.31 2009/02/15 17:06:30 mikeb Exp $ */ +/* $OpenBSD: locore.S,v 1.32 2009/03/31 08:49:18 art Exp $ */ /* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */ /* @@ -714,35 +714,6 @@ ENTRY(longjmp) /*****************************************************************************/ -/* - * The following primitives manipulate the run queues. - * _whichqs tells which of the 32 queues _qs - * have processes in them. Setrq puts processes into queues, Remrq - * removes them from queues. The running process is on no queue, - * other processes are on a queue related to p->p_pri, divided by 4 - * actually to shrink the 0-127 range of priorities into the 32 available - * queues. - */ - .globl _C_LABEL(uvmexp),_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" -#endif /* DIAGNOSTIC */ - /* * int cpu_switchto(struct proc *old, struct proc *new) * Switch from "old" proc to "new". @@ -852,13 +823,6 @@ switch_restored: switch_return: -#if 0 - /* Violation of lock ordering, since we're holding the sched_lock */ - movl $IPL_NONE,%edi - call _C_LABEL(Xspllower) - movl $IPL_HIGH,CPUVAR(ILEVEL) -#endif - popq %r15 popq %r14 popq %r13 @@ -877,6 +841,25 @@ ENTRY(cpu_idle_cycle) ENTRY(cpu_idle_leave) ret + .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" +#endif /* DIAGNOSTIC */ /* * savectx(struct pcb *pcb); -- cgit v1.2.3