diff --git a/sys/arch/i386/i386/freebsd_machdep.c b/sys/arch/i386/i386/freebsd_machdep.c index eebec21733e6..bee921cb7851 100644 --- a/sys/arch/i386/i386/freebsd_machdep.c +++ b/sys/arch/i386/i386/freebsd_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: freebsd_machdep.c,v 1.27 2001/05/30 12:28:43 mrg Exp $ */ +/* $NetBSD: freebsd_machdep.c,v 1.28 2001/08/03 00:41:46 thorpej Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -68,7 +68,10 @@ freebsd_setregs(p, epp, stack) register struct pcb *pcb = &p->p_addr->u_pcb; setregs(p, epp, stack); - pcb->pcb_savefpu.sv_env.en_cw = __FreeBSD_NPXCW__; + if (i386_use_fxsave) + pcb->pcb_savefpu.sv_xmm.sv_env.en_cw = __FreeBSD_NPXCW__; + else + pcb->pcb_savefpu.sv_87.sv_env.en_cw = __FreeBSD_NPXCW__; } /* diff --git a/sys/arch/i386/i386/ibcs2_machdep.c b/sys/arch/i386/i386/ibcs2_machdep.c index 8c798d018d25..985439ae5b52 100644 --- a/sys/arch/i386/i386/ibcs2_machdep.c +++ b/sys/arch/i386/i386/ibcs2_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_machdep.c,v 1.15 2001/06/17 21:01:33 sommerfeld Exp $ */ +/* $NetBSD: ibcs2_machdep.c,v 1.16 2001/08/03 00:41:46 thorpej Exp $ */ /*- * Copyright (c) 1997, 2000 The NetBSD Foundation, Inc. @@ -75,7 +75,10 @@ ibcs2_setregs(p, epp, stack) register struct trapframe *tf; setregs(p, epp, stack); - pcb->pcb_savefpu.sv_env.en_cw = __iBCS2_NPXCW__; + if (i386_use_fxsave) + pcb->pcb_savefpu.sv_xmm.sv_env.en_cw = __iBCS2_NPXCW__; + else + pcb->pcb_savefpu.sv_87.sv_env.en_cw = __iBCS2_NPXCW__; tf = p->p_md.md_regs; tf->tf_eax = 0x2000000; /* XXX base of heap */ } diff --git a/sys/arch/i386/i386/math_emulate.c b/sys/arch/i386/i386/math_emulate.c index 3e367fd9d539..9ea0db892033 100644 --- a/sys/arch/i386/i386/math_emulate.c +++ b/sys/arch/i386/i386/math_emulate.c @@ -1,4 +1,4 @@ -/* $NetBSD: math_emulate.c,v 1.21 1999/04/22 00:23:33 fvdl Exp $ */ +/* $NetBSD: math_emulate.c,v 1.22 2001/08/03 00:41:46 thorpej Exp $ */ /* * expediant "port" of linux 8087 emulator to 386BSD, with apologies -wfj @@ -72,6 +72,7 @@ int math_emulate(info) struct trapframe *info; { + struct proc *p = curproc; u_short cw, code; temp_real tmp; char * address; @@ -86,10 +87,13 @@ math_emulate(info) /* ever used fp? */ if ((curproc->p_md.md_flags & MDP_USEDFPU) == 0) { - cw = curproc->p_addr->u_pcb.pcb_savefpu.sv_env.en_cw; + if (i386_use_fxsave) + cw = p->p_addr->u_pcb.pcb_savefpu.sv_xmm.sv_env.en_cw; + else + cw = p->p_addr->u_pcb.pcb_savefpu.sv_87.sv_env.en_cw; fninit(); I387.cwd = cw; - curproc->p_md.md_flags |= MDP_USEDFPU; + p->p_md.md_flags |= MDP_USEDFPU; } if (I387.cwd & I387.swd & 0x3f) diff --git a/sys/arch/i386/i386/svr4_machdep.c b/sys/arch/i386/i386/svr4_machdep.c index bfdef15ffe92..8560b5736066 100644 --- a/sys/arch/i386/i386/svr4_machdep.c +++ b/sys/arch/i386/i386/svr4_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_machdep.c,v 1.54 2001/07/13 23:32:26 kristerw Exp $ */ +/* $NetBSD: svr4_machdep.c,v 1.55 2001/08/03 00:41:46 thorpej Exp $ */ /*- * Copyright (c) 1994, 2000 The NetBSD Foundation, Inc. @@ -123,7 +123,10 @@ svr4_setregs(p, epp, stack) register struct pcb *pcb = &p->p_addr->u_pcb; setregs(p, epp, stack); - pcb->pcb_savefpu.sv_env.en_cw = __SVR4_NPXCW__; + if (i386_use_fxsave) + pcb->pcb_savefpu.sv_xmm.sv_env.en_cw = __SVR4_NPXCW__; + else + pcb->pcb_savefpu.sv_87.sv_env.en_cw = __SVR4_NPXCW__; } void *