Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/i386/i386/locore.S,v rcsdiff: /ftp/cvs/cvsroot/src/sys/arch/i386/i386/locore.S,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.1.2.2 retrieving revision 1.1.2.6 diff -u -p -r1.1.2.2 -r1.1.2.6 --- src/sys/arch/i386/i386/locore.S 2002/12/11 06:00:55 1.1.2.2 +++ src/sys/arch/i386/i386/locore.S 2002/12/23 16:15:28 1.1.2.6 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.1.2.2 2002/12/11 06:00:55 thorpej Exp $ */ +/* $NetBSD: locore.S,v 1.1.2.6 2002/12/23 16:15:28 skrll Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -1647,84 +1647,9 @@ 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(sched_whichqs),_C_LABEL(sched_qs) .globl _C_LABEL(uvmexp),_C_LABEL(panic) -/* - * void setrunqueue(struct lwp *p); - * Insert a process on the appropriate queue. Should be called at splclock(). - * See setrunqueue(9) for more details. - */ -/* LINTSTUB: Func: void setrunqueue(struct lwp *p) */ -NENTRY(setrunqueue) - movl 4(%esp),%eax -#ifdef DIAGNOSTIC - cmpl $0,L_BACK(%eax) # should not be on q already - jne 1f - cmpl $0,L_WCHAN(%eax) - jne 1f - cmpb $SRUN,L_STAT(%eax) - jne 1f -#endif /* DIAGNOSTIC */ - movzbl L_PRIORITY(%eax),%edx - shrl $2,%edx - btsl %edx,_C_LABEL(sched_whichqs) # set q full bit - leal _C_LABEL(sched_qs)(,%edx,8),%edx # locate q hdr - movl L_BACK(%edx),%ecx - movl %edx,L_FORW(%eax) # link process on tail of q - movl %eax,L_BACK(%edx) - movl %eax,L_FORW(%ecx) - movl %ecx,L_BACK(%eax) - ret -#ifdef DIAGNOSTIC -1: pushl $2f - call _C_LABEL(panic) - /* NOTREACHED */ -2: .asciz "setrunqueue" -#endif /* DIAGNOSTIC */ - -/* - * void remrunqueue(struct lwp *p); - * Remove a process from its queue. Should be called at splclock(). - * See remrunqueue(9) for more details. - */ -/* LINTSTUB: Func: void remrunqueue(struct lwp *p) */ -NENTRY(remrunqueue) - movl 4(%esp),%ecx - movzbl L_PRIORITY(%ecx),%eax -#ifdef DIAGNOSTIC - shrl $2,%eax - btl %eax,_C_LABEL(sched_whichqs) - jnc 1f -#endif /* DIAGNOSTIC */ - movl L_BACK(%ecx),%edx # unlink process - movl $0,L_BACK(%ecx) # zap reverse link to indicate off list - movl L_FORW(%ecx),%ecx - movl %ecx,L_FORW(%edx) - movl %edx,L_BACK(%ecx) - cmpl %ecx,%edx # q still has something? - jne 2f -#ifndef DIAGNOSTIC - shrl $2,%eax -#endif - btrl %eax,_C_LABEL(sched_whichqs) # no; clear bit -2: ret -#ifdef DIAGNOSTIC -1: pushl $3f - call _C_LABEL(panic) - /* NOTREACHED */ -3: .asciz "remrunqueue" -#endif /* DIAGNOSTIC */ - #ifdef DIAGNOSTIC NENTRY(switch_error) pushl $1f @@ -1751,10 +1676,10 @@ ENTRY(cpu_switch) #ifdef DEBUG cmpl $IPL_SCHED,CPUVAR(ILEVEL) jae 1f - pushl 2f + pushl $2f call _C_LABEL(panic) /* NOTREACHED */ -2: .asciz "not splhigh() in cpu_switch!" +2: .asciz "not splsched() in cpu_switch!" 1: #endif /* DEBUG */ @@ -1775,7 +1700,7 @@ ENTRY(cpu_switch) * %eax - queue head, scratch, then zero * %ebx - queue number * %ecx - cached value of whichqs - * %edx - next process in queue + * %edx - next lwp in queue * %esi - old lwp * %edi - new lwp */ @@ -1853,8 +1778,9 @@ idle_unlock: call _C_LABEL(sched_unlock_idle) #endif /* Interrupts are okay again. */ - movl $IPL_NONE,CPUVAR(ILEVEL) # spl0() + pushl $IPL_NONE # spl0() call _C_LABEL(Xspllower) # process pending interrupts + addl $4,%esp jmp idle_start idle_zero: sti @@ -2019,23 +1945,20 @@ switch_restored: /* * Check for restartable atomic sequences (RAS) - * XXX %edi reloads are not necessary here as %edi is callee-saved! */ movl CPUVAR(CURLWP),%edi movl L_PROC(%edi),%esi cmpl $0,P_NRAS(%esi) je 1f - movl L_MD_REGS(%edi),%edx - movl TF_EIP(%edx),%eax + movl L_MD_REGS(%edi),%ebx + movl TF_EIP(%ebx),%eax pushl %eax pushl %esi call _C_LABEL(ras_lookup) addl $8,%esp cmpl $-1,%eax je 1f - movl CPUVAR(CURLWP),%edi - movl L_MD_REGS(%edi),%edx - movl %eax,TF_EIP(%edx) + movl %eax,TF_EIP(%ebx) 1: xor %eax,%eax @@ -2043,8 +1966,9 @@ switch_return: #if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) call _C_LABEL(sched_unlock_idle) #endif - movl $IPL_NONE,CPUVAR(ILEVEL) # spl0() + pushl $IPL_NONE # spl0() call _C_LABEL(Xspllower) # process pending interrupts + addl $4,%esp movl $IPL_HIGH,CPUVAR(ILEVEL) # splhigh() popl %edi @@ -2062,7 +1986,7 @@ NENTRY(preempt_error) /* * void cpu_preempt(struct lwp *current, struct lwp *next) - * Switch to the specified nexxt LWP. + * Switch to the specified next LWP. */ ENTRY(cpu_preempt) pushl %ebx