Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/arm Make sure the enable bit is not set when re...



details:   https://anonhg.NetBSD.org/src/rev/d7e2f7559ea6
branches:  trunk
changeset: 783150:d7e2f7559ea6
user:      matt <matt%NetBSD.org@localhost>
date:      Sat Dec 08 06:46:49 2012 +0000

description:
Make sure the enable bit is not set when restoring the VFP context since
that has special meaning to the VFP PCU code.

diffstat:

 sys/arch/arm/arm/process_machdep.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r 2601dd79a5e0 -r d7e2f7559ea6 sys/arch/arm/arm/process_machdep.c
--- a/sys/arch/arm/arm/process_machdep.c        Sat Dec 08 02:41:54 2012 +0000
+++ b/sys/arch/arm/arm/process_machdep.c        Sat Dec 08 06:46:49 2012 +0000
@@ -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 @@
 #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 @@
 {
 #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 @@
        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);
 }



Home | Main Index | Thread Index | Old Index