diff options
author | dt <dt@FreeBSD.org> | 1999-06-10 20:40:59 +0000 |
---|---|---|
committer | dt <dt@FreeBSD.org> | 1999-06-10 20:40:59 +0000 |
commit | 16f5a971881082bcd48a8114de8dcc990341a3ab (patch) | |
tree | 2fffe9b29dc4096140c90302ad6af22c89c34344 | |
parent | dbeceb7755c45d8011b352f07c60e67d32489504 (diff) | |
download | FreeBSD-src-16f5a971881082bcd48a8114de8dcc990341a3ab.zip FreeBSD-src-16f5a971881082bcd48a8114de8dcc990341a3ab.tar.gz |
Replace my previous fix of saving the FP state with a much simpler one: when
we swap out fpcurproc, save its FP state.
Suggested by: bde
-rw-r--r-- | sys/alpha/alpha/fp_emulate.c | 3 | ||||
-rw-r--r-- | sys/alpha/alpha/machdep.c | 15 | ||||
-rw-r--r-- | sys/alpha/alpha/pmap.c | 9 | ||||
-rw-r--r-- | sys/alpha/alpha/prom.c | 5 | ||||
-rw-r--r-- | sys/alpha/alpha/trap.c | 8 | ||||
-rw-r--r-- | sys/alpha/alpha/vm_machdep.c | 6 | ||||
-rw-r--r-- | sys/powerpc/aim/vm_machdep.c | 6 | ||||
-rw-r--r-- | sys/powerpc/powerpc/vm_machdep.c | 6 |
8 files changed, 22 insertions, 36 deletions
diff --git a/sys/alpha/alpha/fp_emulate.c b/sys/alpha/alpha/fp_emulate.c index 47afa49..a01642a 100644 --- a/sys/alpha/alpha/fp_emulate.c +++ b/sys/alpha/alpha/fp_emulate.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: fp_emulate.c,v 1.3 1999/04/08 20:32:51 gallatin Exp $ + * $Id: fp_emulate.c,v 1.4 1999/06/08 16:42:13 dt Exp $ */ #include <sys/param.h> @@ -263,7 +263,6 @@ static int fp_emulate(union alpha_instruction ins, struct proc *p) alpha_pal_wrfen(1); savefpstate(&fpcurproc->p_addr->u_pcb.pcb_fp); alpha_pal_wrfen(0); - PRELE(fpcurproc); fpcurproc = NULL; } diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c index 08790ad..f251e78 100644 --- a/sys/alpha/alpha/machdep.c +++ b/sys/alpha/alpha/machdep.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: machdep.c,v 1.43 1999/05/14 11:15:13 dfr Exp $ + * $Id: machdep.c,v 1.44 1999/06/08 16:42:14 dt Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -1353,7 +1353,6 @@ sendsig(sig_t catcher, int sig, int mask, u_long code) alpha_pal_wrfen(1); savefpstate(&p->p_addr->u_pcb.pcb_fp); alpha_pal_wrfen(0); - PRELE(fpcurproc); fpcurproc = NULL; } ksc.sc_ownedfp = p->p_md.md_flags & MDP_FPUSED; @@ -1466,10 +1465,8 @@ sigreturn(struct proc *p, alpha_pal_wrusp(ksc.sc_regs[R_SP]); /* XXX ksc.sc_ownedfp ? */ - if (p == fpcurproc) { - PRELE(fpcurproc); + if (p == fpcurproc) fpcurproc = NULL; - } bcopy((struct fpreg *)ksc.sc_fpregs, &p->p_addr->u_pcb.pcb_fp, sizeof(struct fpreg)); p->p_addr->u_pcb.pcb_fp_control = ksc.sc_fp_control; @@ -1529,10 +1526,8 @@ setregs(struct proc *p, u_long entry, u_long stack, u_long ps_strings) tfp->tf_regs[FRAME_T12] = tfp->tf_regs[FRAME_PC]; /* a.k.a. PV */ p->p_md.md_flags &= ~MDP_FPUSED; - if (fpcurproc == p) { - PRELE(fpcurproc); + if (fpcurproc == p) fpcurproc = NULL; - } } int @@ -1873,10 +1868,8 @@ set_fpregs(p, fpregs) struct proc *p; struct fpreg *fpregs; { - if (p == fpcurproc) { - PRELE(fpcurproc); + if (p == fpcurproc) fpcurproc = NULL; - } bcopy(fpregs, &p->p_addr->u_pcb.pcb_fp, sizeof *fpregs); return (0); diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c index 3bfa234..abc565c 100644 --- a/sys/alpha/alpha/pmap.c +++ b/sys/alpha/alpha/pmap.c @@ -43,7 +43,7 @@ * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 * from: i386 Id: pmap.c,v 1.193 1998/04/19 15:22:48 bde Exp * with some ideas from NetBSD's alpha pmap - * $Id: pmap.c,v 1.24 1999/05/28 05:38:47 alc Exp $ + * $Id: pmap.c,v 1.25 1999/06/08 17:14:07 dt Exp $ */ /* @@ -1053,6 +1053,13 @@ pmap_swapout_proc(p) vm_object_t upobj; vm_page_t m; + if (p == fpcurproc) { + alpha_pal_wrfen(1); + savefpstate(&fpcurproc->p_addr->u_pcb.pcb_fp); + fpcurproc = NULL; + alpha_pal_wrfen(0); + } + upobj = p->p_upages_obj; /* * let the upages be paged diff --git a/sys/alpha/alpha/prom.c b/sys/alpha/alpha/prom.c index 0cb27c3..4724eb4 100644 --- a/sys/alpha/alpha/prom.c +++ b/sys/alpha/alpha/prom.c @@ -141,12 +141,9 @@ enter_prom() */ if (curproc != fpcurproc) { alpha_pal_wrfen(1); - if (fpcurproc) { + if (fpcurproc) savefpstate(&fpcurproc->p_addr->u_pcb.pcb_fp); - PRELE(fpcurproc); - } fpcurproc = curproc; - PHOLD(fpcurproc); restorefpstate(&fpcurproc->p_addr->u_pcb.pcb_fp); } #endif diff --git a/sys/alpha/alpha/trap.c b/sys/alpha/alpha/trap.c index e1dfc00..0e7b375 100644 --- a/sys/alpha/alpha/trap.c +++ b/sys/alpha/alpha/trap.c @@ -1,4 +1,4 @@ -/* $Id: trap.c,v 1.14 1999/05/10 16:00:56 peter Exp $ */ +/* $Id: trap.c,v 1.15 1999/06/08 16:42:17 dt Exp $ */ /* $NetBSD: trap.c,v 1.31 1998/03/26 02:21:46 thorpej Exp $ */ /* @@ -323,12 +323,9 @@ trap(a0, a1, a2, entry, framep) } alpha_pal_wrfen(1); - if (fpcurproc) { + if (fpcurproc) savefpstate(&fpcurproc->p_addr->u_pcb.pcb_fp); - PRELE(fpcurproc); - } fpcurproc = p; - PHOLD(fpcurproc); restorefpstate(&fpcurproc->p_addr->u_pcb.pcb_fp); alpha_pal_wrfen(0); @@ -747,7 +744,6 @@ const static int reg_to_framereg[32] = { alpha_pal_wrfen(1); \ savefpstate(&fpcurproc->p_addr->u_pcb.pcb_fp); \ alpha_pal_wrfen(0); \ - PRELE(fpcurproc); \ fpcurproc = NULL; \ } diff --git a/sys/alpha/alpha/vm_machdep.c b/sys/alpha/alpha/vm_machdep.c index f5f3cdf..a638794 100644 --- a/sys/alpha/alpha/vm_machdep.c +++ b/sys/alpha/alpha/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.14 1999/04/23 19:53:38 dt Exp $ + * $Id: vm_machdep.c,v 1.15 1999/06/08 16:42:19 dt Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -240,10 +240,8 @@ void cpu_exit(p) register struct proc *p; { - if (p == fpcurproc) { - PRELE(fpcurproc); + if (p == fpcurproc) fpcurproc = NULL; - } (void) splhigh(); cnt.v_swtch++; diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c index f5f3cdf..a638794 100644 --- a/sys/powerpc/aim/vm_machdep.c +++ b/sys/powerpc/aim/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.14 1999/04/23 19:53:38 dt Exp $ + * $Id: vm_machdep.c,v 1.15 1999/06/08 16:42:19 dt Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -240,10 +240,8 @@ void cpu_exit(p) register struct proc *p; { - if (p == fpcurproc) { - PRELE(fpcurproc); + if (p == fpcurproc) fpcurproc = NULL; - } (void) splhigh(); cnt.v_swtch++; diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c index f5f3cdf..a638794 100644 --- a/sys/powerpc/powerpc/vm_machdep.c +++ b/sys/powerpc/powerpc/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.14 1999/04/23 19:53:38 dt Exp $ + * $Id: vm_machdep.c,v 1.15 1999/06/08 16:42:19 dt Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -240,10 +240,8 @@ void cpu_exit(p) register struct proc *p; { - if (p == fpcurproc) { - PRELE(fpcurproc); + if (p == fpcurproc) fpcurproc = NULL; - } (void) splhigh(); cnt.v_swtch++; |