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.152 retrieving revision 1.157 diff -u -p -r1.152 -r1.157 --- src/sys/arch/i386/i386/locore.S 2017/09/17 09:59:23 1.152 +++ src/sys/arch/i386/i386/locore.S 2018/06/14 17:58:22 1.157 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.152 2017/09/17 09:59:23 maxv Exp $ */ +/* $NetBSD: locore.S,v 1.157 2018/06/14 17:58:22 maxv Exp $ */ /* * Copyright-o-rama! @@ -128,7 +128,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.152 2017/09/17 09:59:23 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.157 2018/06/14 17:58:22 maxv Exp $"); #include "opt_copy_symtab.h" #include "opt_ddb.h" @@ -838,6 +838,7 @@ begin: pushl $0 /* init386() expects a 64 bits paddr_t with PAE */ #endif pushl %eax + call _C_LABEL(init_bootspace) call _C_LABEL(init386) addl $PDE_SIZE,%esp /* pop paddr_t */ addl $NGDT*8,%esp /* pop temporary gdt */ @@ -909,6 +910,7 @@ begin: pushl $0 /* init386() expects a 64 bits paddr_t with PAE */ #endif pushl %esi + call _C_LABEL(init_bootspace) call _C_LABEL(init386) addl $PDE_SIZE,%esp /* pop paddr_t */ call _C_LABEL(main) @@ -1087,6 +1089,19 @@ ENTRY(cpu_switchto) movl %ebp,PCB_EBP(%eax) skip_save: +#ifndef XEN + pushl %edx + movb _C_LABEL(x86_fpu_eager),%dl + testb %dl,%dl + jz .Lno_eagerfpu + pushl %edi + pushl %esi + call _C_LABEL(fpu_eagerswitch) + addl $8,%esp +.Lno_eagerfpu: + popl %edx +#endif + /* Switch to newlwp's stack. */ movl L_PCB(%edi),%ebx movl PCB_EBP(%ebx),%ebp @@ -1110,7 +1125,8 @@ skip_save: addl $4,%esp #else movl PCB_ESP0(%ebx),%eax - movl %eax,CPUVAR(ESP0) + movl CPUVAR(TSS),%ecx + movl %eax,TSS_ESP0(%ecx) #endif /* Don't bother with the rest if switching to a system process. */ @@ -1134,7 +1150,8 @@ skip_save: movl PCB_IOMAP(%ebx),%eax orl %eax,%eax jnz .Lcopy_iobitmap - movl $(IOMAP_INVALOFF << 16),CPUVAR(IOBASE) + movl CPUVAR(TSS),%eax + movl $(IOMAP_INVALOFF << 16),TSS_IOBASE(%eax) .Liobitmap_done: /* Is this process using RAS (restartable atomic sequences)? */ @@ -1198,13 +1215,14 @@ switch_return: pushl %esi pushl %edi movl %eax,%esi /* pcb_iomap */ - movl CPUVAR(SELF),%edi - leal CPU_INFO_IOMAP(%edi),%edi + movl CPUVAR(TSS),%edi + leal TSS_IOMAP(%edi),%edi rep movsl popl %edi popl %esi - movl $((CPU_INFO_IOMAP - CPU_INFO_TSS) << 16),CPUVAR(IOBASE) + movl CPUVAR(TSS),%eax + movl $(IOMAP_VALIDOFF << 16),TSS_IOBASE(%eax) jmp .Liobitmap_done END(cpu_switchto)