FPA ownership is now guarded by MDP_FPUSED flag and there is no necessity

to have #if ... around savefpregs() calls.
This commit is contained in:
nisimura 2000-05-30 01:29:59 +00:00
parent 0e501989cd
commit b67b90d7f9
3 changed files with 9 additions and 21 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mips_machdep.c,v 1.83 2000/05/30 01:23:55 nisimura Exp $ */
/* $NetBSD: mips_machdep.c,v 1.84 2000/05/30 01:29:59 nisimura Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -52,7 +52,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.83 2000/05/30 01:23:55 nisimura Exp $");
__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.84 2000/05/30 01:29:59 nisimura Exp $");
#include "opt_compat_netbsd.h"
#include "opt_compat_ultrix.h"
@ -757,11 +757,9 @@ sendsig(catcher, sig, mask, code)
/* Save the floating-pointstate, if necessary, then copy it. */
ksc.sc_fpused = p->p_md.md_flags & MDP_FPUSED;
if (ksc.sc_fpused) {
#if !defined(NOFPU) && !defined(SOFTFLOAT)
/* if FPU has current state, save it first */
if (p == fpcurproc)
savefpregs(p);
#endif
*(struct fpreg *)ksc.sc_fpregs = p->p_addr->u_pcb.pcb_fpregs;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: process_machdep.c,v 1.18 2000/05/29 11:46:52 nisimura Exp $ */
/* $NetBSD: process_machdep.c,v 1.19 2000/05/30 01:30:00 nisimura Exp $ */
/*
* Copyright (c) 1994 Adam Glass
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.18 2000/05/29 11:46:52 nisimura Exp $");
__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.19 2000/05/30 01:30:00 nisimura Exp $");
/*
* This file may seem a bit stylized, but that so that it's easier to port.
@ -100,10 +100,8 @@ process_read_fpregs(p, regs)
struct proc *p;
struct fpreg *regs;
{
#if !defined(NOFPU) && !defined(SOFTFLOAT)
if ((p->p_md.md_flags & MDP_FPUSED) && p == fpcurproc)
savefpregs(p);
#endif
memcpy(regs, &p->p_addr->u_pcb.pcb_fpregs, sizeof(struct fpreg));
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.60 2000/05/29 09:43:33 nisimura Exp $ */
/* $NetBSD: vm_machdep.c,v 1.61 2000/05/30 01:30:01 nisimura Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.60 2000/05/29 09:43:33 nisimura Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.61 2000/05/30 01:30:01 nisimura Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -113,10 +113,8 @@ cpu_fork(p1, p2, stack, stacksize, func, arg)
if (p1 != curproc && p1 != &proc0)
panic("cpu_fork: curproc");
#endif
#if !defined(NOFPU) && !defined(SOFTFLOAT)
if ((p1->p_md.md_flags & MDP_FPUSED) && p1 == fpcurproc)
savefpregs(p1);
#endif
/*
* Copy pcb from proc p1 to p2.
@ -217,16 +215,10 @@ cpu_coredump(p, vp, cred, chdr)
chdr->c_seghdrsize = ALIGN(sizeof(struct coreseg));
chdr->c_cpusize = sizeof(struct cpustate);
if ((p->p_md.md_flags & MDP_FPUSED && p == fpcurproc)
savefpregs(p);
cpustate.frame = *(struct frame *)p->p_md.md_regs;
if (p->p_md.md_flags & MDP_FPUSED) {
#if !defined(NOFPU) && !defined(SOFTFLOAT)
if (p == fpcurproc)
savefpregs(p);
#endif
cpustate.fpregs = p->p_addr->u_pcb.pcb_fpregs;
}
else
memset(&cpustate.fpregs, 0, sizeof(struct fpreg));
cpustate.fpregs = p->p_addr->u_pcb.pcb_fpregs;
CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_MACHINE, CORE_CPU);
cseg.c_addr = 0;