summaryrefslogtreecommitdiff
path: root/sys/compat/linux
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2020-09-03 14:26:31 +0000
committerthorpej <thorpej@NetBSD.org>2020-09-03 14:26:31 +0000
commit2e029b02880ef06fa2cd77fa750cbdfb96fcfbf5 (patch)
tree8dd55fd820650152631291ebba37a840124adb23 /sys/compat/linux
parentb3ce79a9edbf2971ddc6b731a07ba592deb28e85 (diff)
The conversion of FPU tracking to PCU rendered the fpcurlwp variable
unmaintained, which broke FP status info in the COMPAT_LINUX sigcontext. Use the new API, which will at least be closer to correct.
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/arch/alpha/linux_machdep.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/compat/linux/arch/alpha/linux_machdep.c b/sys/compat/linux/arch/alpha/linux_machdep.c
index 158debcbe4a..e9ee45107fe 100644
--- a/sys/compat/linux/arch/alpha/linux_machdep.c
+++ b/sys/compat/linux/arch/alpha/linux_machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_machdep.c,v 1.50 2014/11/09 17:48:07 maxv Exp $ */
+/* $NetBSD: linux_machdep.c,v 1.51 2020/09/03 14:26:31 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.50 2014/11/09 17:48:07 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.51 2020/09/03 14:26:31 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -243,14 +243,11 @@ void setup_linux_sigframe(struct trapframe *tf, const ksiginfo_t *ksi,
frametoreg(tf, (struct reg *)sigframe.sf_sc.sc_regs);
sigframe.sf_sc.sc_regs[R_SP] = alpha_pal_rdusp();
- if (l == fpcurlwp) {
+ if (fpu_valid_p(l)) {
struct pcb *pcb = lwp_getpcb(l);
- alpha_pal_wrfen(1);
- savefpstate(&pcb->pcb_fp);
- alpha_pal_wrfen(0);
+ fpu_save(l);
sigframe.sf_sc.sc_fpcr = pcb->pcb_fp.fpr_cr;
- fpcurlwp = NULL;
}
/* XXX ownedfp ? etc...? */
@@ -394,9 +391,6 @@ linux_restore_sigcontext(struct lwp *l, struct linux_sigcontext context,
regtoframe((struct reg *)context.sc_regs, l->l_md.md_tf);
alpha_pal_wrusp(context.sc_regs[R_SP]);
- if (l == fpcurlwp)
- fpcurlwp = NULL;
-
/* Restore fp regs and fpr_cr */
pcb = lwp_getpcb(l);
memcpy(&pcb->pcb_fp, (struct fpreg *)context.sc_fpregs,