Module Name: src
Committed By: matt
Date: Sat Dec 8 06:46:50 UTC 2012
Modified Files:
src/sys/arch/arm/arm: process_machdep.c
Log Message:
Make sure the enable bit is not set when restoring the VFP context since
that has special meaning to the VFP PCU code.
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/arm/process_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/arm/arm/process_machdep.c
diff -u src/sys/arch/arm/arm/process_machdep.c:1.24 src/sys/arch/arm/arm/process_machdep.c:1.25
--- src/sys/arch/arm/arm/process_machdep.c:1.24 Wed Dec 5 19:05:46 2012
+++ src/sys/arch/arm/arm/process_machdep.c Sat Dec 8 06:46:49 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: process_machdep.c,v 1.24 2012/12/05 19:05:46 matt Exp $ */
+/* $NetBSD: process_machdep.c,v 1.25 2012/12/08 06:46:49 matt Exp $ */
/*
* Copyright (c) 1993 The Regents of the University of California.
@@ -133,7 +133,7 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.24 2012/12/05 19:05:46 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.25 2012/12/08 06:46:49 matt Exp $");
#include <sys/proc.h>
#include <sys/ptrace.h>
@@ -144,6 +144,7 @@ __KERNEL_RCSID(0, "$NetBSD: process_mach
#include <machine/reg.h>
#include <arm/armreg.h>
+#include <arm/vfpreg.h>
int
process_read_regs(struct lwp *l, struct reg *regs)
@@ -175,13 +176,15 @@ process_read_fpregs(struct lwp *l, struc
{
#ifdef FPU_VFP
if (curcpu()->ci_vfp_id == 0) {
- return EINVAL;
+ memset(regs, 0, sizeof(regs));
+ return 0;
}
const struct pcb * const pcb = lwp_getpcb(l);
vfp_savecontext();
regs->fpr_vfp = pcb->pcb_vfp;
+ regs->fpr_vfp.vfp_fpexc &= ~VFP_FPEXC_EN;
#endif
- return(0);
+ return 0;
}
int
@@ -227,6 +230,7 @@ process_write_fpregs(struct lwp *l, cons
vfp_discardcontext();
l->l_md.md_flags |= MDLWP_VFPUSED;
pcb->pcb_vfp = regs->fpr_vfp;
+ pcb->pcb_vfp.vfp_fpexc &= ~VFP_FPEXC_EN;
#endif
return(0);
}