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.34.2.7 retrieving revision 1.55 diff -u -p -r1.34.2.7 -r1.55 --- src/sys/arch/i386/i386/locore.S 2007/12/07 17:25:00 1.34.2.7 +++ src/sys/arch/i386/i386/locore.S 2007/11/10 23:04:29 1.55 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.34.2.7 2007/12/07 17:25:00 yamt Exp $ */ +/* $NetBSD: locore.S,v 1.55 2007/11/10 23:04:29 ad Exp $ */ /* * Copyright-o-rama! @@ -111,6 +111,7 @@ */ #include "opt_compat_oldboot.h" +#include "opt_cputype.h" #include "opt_ddb.h" #include "opt_realmem.h" #include "opt_vm86.h" @@ -722,8 +723,7 @@ ENTRY(longjmp) ret /* - * struct lwp *cpu_switchto(struct lwp *oldlwp, struct newlwp, - * bool returning) + * struct lwp *cpu_switchto(struct lwp *oldlwp, struct newlwp) * * 1. if (oldlwp != NULL), save its context. * 2. then, restore context of newlwp. @@ -739,7 +739,6 @@ ENTRY(cpu_switchto) movl 16(%esp),%esi # oldlwp movl 20(%esp),%edi # newlwp - movl 24(%esp),%edx # returning testl %esi,%esi jz 1f @@ -753,13 +752,6 @@ ENTRY(cpu_switchto) movl PCB_EBP(%ebx),%ebp movl PCB_ESP(%ebx),%esp - /* Set curlwp. */ - movl %edi,CPUVAR(CURLWP) - - /* Skip the rest if returning to a pinned LWP. */ - testl %edx,%edx - jnz 4f - /* Switch TSS. Reset "task busy" flag before loading. */ movl %cr3,%eax movl %eax,PCB_CR3(%ebx) # for TSS gates @@ -768,10 +760,18 @@ ENTRY(cpu_switchto) andl $~0x0200,4(%ecx,%edx, 1) ltr %dx + /* Set curlwp. */ + movl %edi,CPUVAR(CURLWP) + /* Don't bother with the rest if switching to a system process. */ testl $LW_SYSTEM,L_FLAG(%edi) jnz 4f + /* Is this process using RAS (restartable atomic sequences)? */ + movl L_PROC(%edi),%eax + cmpl $0,P_RASLIST(%eax) + jne 5f + /* Restore thread-private %fs/%gs descriptors. */ movl PCB_FSD(%ebx), %eax movl PCB_FSD+4(%ebx), %edx @@ -782,11 +782,6 @@ ENTRY(cpu_switchto) movl %eax, (GUGS_SEL*8)(%ecx) movl %edx, (GUGS_SEL*8+4)(%ecx) - /* Is this process using RAS (restartable atomic sequences)? */ - movl L_PROC(%edi),%eax - cmpl $0,P_RASLIST(%eax) - jne 5f - /* * Restore cr0 (including FPU state). Raise the IPL to IPL_IPI. * FPU IPIs can alter the LWP's saved cr0. Dropping the priority @@ -911,9 +906,10 @@ syscall1: pushl $4f call _C_LABEL(printf) addl $4,%esp - pushl $IPL_NONE - call _C_LABEL(spllower) - addl $4,%esp +#ifdef DDB + int $3 +#endif /* DDB */ + movl $IPL_NONE,CPUVAR(ILEVEL) jmp .Lsyscall_checkast 4: .asciz "WARNING: SPL NOT LOWERED ON SYSCALL EXIT\n" 5: .asciz "WARNING: SPL NOT ZERO ON SYSCALL ENTRY\n"