Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mips/mips Make claried MDP_FPUSED usage.
details: https://anonhg.NetBSD.org/src/rev/cd74b84c5766
branches: trunk
changeset: 486815:cd74b84c5766
user: nisimura <nisimura%NetBSD.org@localhost>
date: Mon May 29 09:16:36 2000 +0000
description:
Make claried MDP_FPUSED usage.
- MDP_FPUSED flag indicates the process has executed at least one
FP insn during its life time.
- pcb_fpregs storage is guaranteed zero initialzed. If the process is FPA
owner, savefpregs() must be called to synchronize it with FPA contents.
- No necessity to save FPA contents into pcb_fpregs prior to the whole
storage is overwritten by process_write_fpregs().
diffstat:
sys/arch/mips/mips/process_machdep.c | 23 ++++++-----------------
1 files changed, 6 insertions(+), 17 deletions(-)
diffs (56 lines):
diff -r bf145b55f47c -r cd74b84c5766 sys/arch/mips/mips/process_machdep.c
--- a/sys/arch/mips/mips/process_machdep.c Mon May 29 08:56:01 2000 +0000
+++ b/sys/arch/mips/mips/process_machdep.c Mon May 29 09:16:36 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: process_machdep.c,v 1.14 2000/03/28 03:11:28 simonb Exp $ */
+/* $NetBSD: process_machdep.c,v 1.15 2000/05/29 09:16:36 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.14 2000/03/28 03:11:28 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.15 2000/05/29 09:16:36 nisimura Exp $");
/*
* This file may seem a bit stylized, but that so that it's easier to port.
@@ -110,16 +110,11 @@
struct proc *p;
struct fpreg *regs;
{
- if (p->p_md.md_flags & MDP_FPUSED) {
#if !defined(NOFPU) && !defined(SOFTFLOAT)
- if (p == fpcurproc)
- savefpregs(p);
+ 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));
- }
- else
- memset(regs, 0, sizeof(struct fpreg));
+ memcpy(regs, &p->p_addr->u_pcb.pcb_fpregs, sizeof(struct fpreg));
return 0;
}
@@ -128,16 +123,10 @@
struct proc *p;
struct fpreg *regs;
{
+#if 0 /* no FP insn is executed yet */
if ((p->p_md.md_flags & MDP_FPUSED) == 0) /* XXX */
return EINVAL;
-
-#if !defined(NOFPU) && !defined(SOFTFLOAT)
- if (p->p_md.md_flags & MDP_FPUSED) {
- if (p == fpcurproc)
- savefpregs(p);
- }
#endif
-
memcpy(&p->p_addr->u_pcb.pcb_fpregs, regs, sizeof(struct fpreg));
return 0;
}
Home |
Main Index |
Thread Index |
Old Index