Module Name: src Committed By: snj Date: Sat Oct 3 23:34:48 UTC 2009
Modified Files: src/sys/arch/amd64/amd64 [netbsd-5]: netbsd32_machdep.c Log Message: Pull up following revision(s) (requested by mlelstv in ticket #1048): sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.59 Ensure FP state is reset, if FP is used in a signal handler. Fixes PR kern/39299 for 32bit code. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.55.4.1 src/sys/arch/amd64/amd64/netbsd32_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.4.1 --- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55 Wed Oct 15 06:51:17 2008 +++ src/sys/arch/amd64/amd64/netbsd32_machdep.c Sat Oct 3 23:34:48 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_machdep.c,v 1.55 2008/10/15 06:51:17 wrstuden Exp $ */ +/* $NetBSD: netbsd32_machdep.c,v 1.55.4.1 2009/10/03 23:34:48 snj Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.55 2008/10/15 06:51:17 wrstuden Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.55.4.1 2009/10/03 23:34:48 snj Exp $"); #include "opt_compat_netbsd.h" #include "opt_coredump.h" @@ -266,6 +266,9 @@ tf->tf_fs = GSEL(GUDATA32_SEL, SEL_UPL); tf->tf_gs = GSEL(GUDATA32_SEL, SEL_UPL); + /* Ensure FP state is reset, if FP is used. */ + l->l_md.md_flags &= ~MDP_USEDFPU; + tf->tf_rip = (uint64_t)catcher; tf->tf_cs = GSEL(GUCODE32_SEL, SEL_UPL); tf->tf_rflags &= ~PSL_CLEARSIG; @@ -357,6 +360,9 @@ tf->tf_rsp = (uint64_t)fp; tf->tf_ss = GSEL(GUDATA32_SEL, SEL_UPL); + /* Ensure FP state is reset, if FP is used. */ + l->l_md.md_flags &= ~MDP_USEDFPU; + /* Remember that we're now on the signal stack. */ if (onstack) l->l_sigstk.ss_flags |= SS_ONSTACK;