Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-4]: src/sys/arch/sparc/sparc Pull up revision 1.7 (requested by...
details: https://anonhg.NetBSD.org/src/rev/b1e2de26609c
branches: netbsd-1-4
changeset: 469983:b1e2de26609c
user: he <he%NetBSD.org@localhost>
date: Sat Jan 08 18:02:35 2000 +0000
description:
Pull up revision 1.7 (requested by pk):
Prevent garbage from entering the data structure holding the FP
state of a process.
diffstat:
sys/arch/sparc/sparc/process_machdep.c | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
diffs (59 lines):
diff -r fd8e8902b940 -r b1e2de26609c sys/arch/sparc/sparc/process_machdep.c
--- a/sys/arch/sparc/sparc/process_machdep.c Sat Jan 08 17:58:49 2000 +0000
+++ b/sys/arch/sparc/sparc/process_machdep.c Sat Jan 08 18:02:35 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: process_machdep.c,v 1.6 1996/03/14 21:09:26 christos Exp $ */
+/* $NetBSD: process_machdep.c,v 1.6.24.1 2000/01/08 18:02:35 he Exp $ */
/*
* Copyright (c) 1993 The Regents of the University of California.
@@ -100,7 +100,7 @@
int sstep;
{
if (sstep)
- return EINVAL;
+ return (EINVAL);
return (0);
}
@@ -116,27 +116,32 @@
int
process_read_fpregs(p, regs)
-struct proc *p;
-struct fpreg *regs;
+ struct proc *p;
+ struct fpreg *regs;
{
extern struct fpstate initfpstate;
struct fpstate *statep = &initfpstate;
- /* NOTE: struct fpreg == struct fpstate */
+ /* NOTE: struct fpreg == prefix of struct fpstate */
if (p->p_md.md_fpstate)
statep = p->p_md.md_fpstate;
bcopy(statep, regs, sizeof(struct fpreg));
- return 0;
+ return (0);
}
int
process_write_fpregs(p, regs)
-struct proc *p;
-struct fpreg *regs;
+ struct proc *p;
+ struct fpreg *regs;
{
if (p->p_md.md_fpstate == NULL)
- return EINVAL;
+ return (EINVAL);
+ /* Write new values to the FP registers */
bcopy(regs, p->p_md.md_fpstate, sizeof(struct fpreg));
- return 0;
+
+ /* Reset FP queue in this process `fpstate' */
+ p->p_md.md_fpstate->fs_qsize = 0;
+
+ return (0);
}
Home |
Main Index |
Thread Index |
Old Index