summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2004-07-10 18:57:00 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2004-07-10 18:57:00 +0000
commitdc1ae928ec0ab57cd4657838d2648e590b552787 (patch)
tree5bc845be8c06e63f3a048343d79ad49b8cea879d /sys/arch/amd64
parent3b6962b49c67e52986c9fdd9347c3e3bfb7a9b5e (diff)
Keep mxcsr and mxcsr_mask across the fake init in process_read_fpregs.
ok deraadt@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/process_machdep.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/arch/amd64/amd64/process_machdep.c b/sys/arch/amd64/amd64/process_machdep.c
index 558a873d824..d16b21c1445 100644
--- a/sys/arch/amd64/amd64/process_machdep.c
+++ b/sys/arch/amd64/amd64/process_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: process_machdep.c,v 1.4 2004/02/01 15:00:42 miod Exp $ */
+/* $OpenBSD: process_machdep.c,v 1.5 2004/07/10 18:56:59 kettenis Exp $ */
/* $NetBSD: process_machdep.c,v 1.1 2003/04/26 18:39:31 fvdl Exp $ */
/*-
@@ -139,6 +139,7 @@ process_read_fpregs(struct proc *p, struct fpreg *regs)
fpusave_proc(p, 1);
} else {
u_int16_t cw;
+ u_int32_t mxcsr, mxcsr_mask;
/*
* Fake a FNINIT.
@@ -146,10 +147,14 @@ process_read_fpregs(struct proc *p, struct fpreg *regs)
* save it temporarily.
*/
cw = frame->fx_fcw;
+ mxcsr = frame->fx_mxcsr;
+ mxcsr_mask = frame->fx_mxcsr_mask;
memset(frame, 0, sizeof(*regs));
frame->fx_fcw = cw;
frame->fx_fsw = 0x0000;
frame->fx_ftw = 0xff;
+ frame->fx_mxcsr = mxcsr;
+ frame->fx_mxcsr_mask = mxcsr_mask;
p->p_md.md_flags |= MDP_USEDFPU;
}