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.50.2.7 retrieving revision 1.53.2.1 diff -u -p -r1.50.2.7 -r1.53.2.1 --- src/sys/arch/i386/i386/locore.S 2007/10/06 15:34:53 1.50.2.7 +++ src/sys/arch/i386/i386/locore.S 2007/11/19 00:46:27 1.53.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.50.2.7 2007/10/06 15:34:53 yamt Exp $ */ +/* $NetBSD: locore.S,v 1.53.2.1 2007/11/19 00:46:27 mjf Exp $ */ /* * Copyright-o-rama! @@ -111,7 +111,6 @@ */ #include "opt_compat_oldboot.h" -#include "opt_cputype.h" #include "opt_ddb.h" #include "opt_realmem.h" #include "opt_vm86.h" @@ -464,10 +463,11 @@ try586: /* Use the `cpuid' instruction. addl $PGOFSET,%esi # page align up andl $~PGOFSET,%esi - /* nkptp = (esi + ~L2_FRAME) >> L2_SHIFT; */ + /* nkptp[1] = (esi + ~L2_FRAME) >> L2_SHIFT + 1; */ movl %esi,%eax addl $~L2_FRAME,%eax shrl $L2_SHIFT,%eax + incl %eax /* one more ptp for VAs stolen by bootstrap */ 1: movl %eax,RELOC(nkptp)+1*4 /* tablesize = (1 + UPAGES + nkptp) << PGSHIFT; */ @@ -479,6 +479,7 @@ try586: /* Use the `cpuid' instruction. addl %esi,%eax addl $~L2_FRAME,%eax shrl $L2_SHIFT,%eax + incl %eax cmpl %eax,RELOC(nkptp)+1*4 jnz 1b @@ -502,7 +503,6 @@ try586: /* Use the `cpuid' instruction. * 32 bit mode. So use the bottom 32 bits. */ movl $RELOC(__data_start),%edx - addl $PGOFSET,%edx andl $~PGOFSET,%edx /* @@ -754,9 +754,9 @@ ENTRY(cpu_switchto) /* Switch TSS. Reset "task busy" flag before loading. */ movl %cr3,%eax movl %eax,PCB_CR3(%ebx) # for TSS gates - movl CPUVAR(GDT),%eax + movl CPUVAR(GDT),%ecx movl L_MD_TSS_SEL(%edi),%edx - andl $~0x0200,4(%eax,%edx, 1) + andl $~0x0200,4(%ecx,%edx, 1) ltr %dx /* Set curlwp. */ @@ -766,6 +766,16 @@ ENTRY(cpu_switchto) testl $LW_SYSTEM,L_FLAG(%edi) jnz 4f + /* Restore thread-private %fs/%gs descriptors. */ + movl PCB_FSD(%ebx), %eax + movl PCB_FSD+4(%ebx), %edx + movl %eax, (GUFS_SEL*8)(%ecx) + movl %edx, (GUFS_SEL*8+4)(%ecx) + movl PCB_GSD(%ebx), %eax + movl PCB_GSD+4(%ebx), %edx + 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)