Module Name:    src
Committed By:   matt
Date:           Tue Dec 18 06:30:19 UTC 2012

Modified Files:
        src/sys/arch/arm/arm32: vm_machdep.c

Log Message:
Remove unneeded definitions.
When forking a LWP, disable the VFP in the new LWP since it isn't the LWP
that owns the VFP.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/arm/arm32/vm_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/arm32/vm_machdep.c
diff -u src/sys/arch/arm/arm32/vm_machdep.c:1.63 src/sys/arch/arm/arm32/vm_machdep.c:1.64
--- src/sys/arch/arm/arm32/vm_machdep.c:1.63	Mon Dec 10 01:37:31 2012
+++ src/sys/arch/arm/arm32/vm_machdep.c	Tue Dec 18 06:30:18 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.63 2012/12/10 01:37:31 matt Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.64 2012/12/18 06:30:18 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.63 2012/12/10 01:37:31 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.64 2012/12/18 06:30:18 matt Exp $");
 
 #include "opt_armfpe.h"
 #include "opt_pmap_debug.h"
@@ -64,16 +64,13 @@ __KERNEL_RCSID(0, "$NetBSD: vm_machdep.c
 
 #include <uvm/uvm_extern.h>
 
+#include <arm/vfpreg.h>
+
 #include <machine/pcb.h>
 #include <machine/pmap.h>
 #include <machine/reg.h>
 #include <machine/vmparam.h>
 
-extern pv_addr_t systempage;
-
-int process_read_regs(struct proc *p, struct reg *regs);
-int process_read_fpregs(struct proc *p, struct fpreg *regs);
-
 void lwp_trampoline(void);
 
 /*
@@ -114,30 +111,29 @@ void
 cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize,
     void (*func)(void *), void *arg)
 {
-	struct pcb *pcb1, *pcb2;
 	struct switchframe *sf;
 	vaddr_t uv;
 
-	pcb1 = lwp_getpcb(l1);
-	pcb2 = lwp_getpcb(l2);
+	const struct pcb * const pcb1 = lwp_getpcb(l1);
+	struct pcb * const pcb2 = lwp_getpcb(l2);
 
 #ifdef PMAP_DEBUG
 	if (pmap_debug_level >= 0)
 		printf("cpu_lwp_fork: %p %p %p %p\n", l1, l2, curlwp, &lwp0);
 #endif	/* PMAP_DEBUG */
 
-#if 0 /* XXX */
-	if (l1 == curlwp) {
-		/* Sync the PCB before we copy it. */
-		savectx(curpcb);
-	}
-#endif
-
-	l2->l_md.md_flags = l1->l_md.md_flags & MDLWP_VFPUSED;
-
 	/* Copy the pcb */
 	*pcb2 = *pcb1;
 
+#ifdef FPU_VFP
+	/*
+	 * Disable the VFP for a newly created LWP but remember if the
+	 * VFP state is valid.
+	 */
+	pcb2->pcb_vfp.vfp_fpexc &= ~VFP_FPEXC_EN;
+	l2->l_md.md_flags = l1->l_md.md_flags & MDLWP_VFPUSED;
+#endif
+
 	/* 
 	 * Set up the kernel stack for the process.
 	 * Note: this stack is not in use if we are forking from p1

Reply via email to