Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc/sparc Make sure to reset the FP queue when lo...



details:   https://anonhg.NetBSD.org/src/rev/0926736cca27
branches:  trunk
changeset: 479991:0926736cca27
user:      pk <pk%NetBSD.org@localhost>
date:      Wed Dec 29 15:21:27 1999 +0000

description:
Make sure to reset the FP queue when loading new values into FP registers.

diffstat:

 sys/arch/sparc/sparc/process_machdep.c |  25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diffs (59 lines):

diff -r f1b5a0174349 -r 0926736cca27 sys/arch/sparc/sparc/process_machdep.c
--- a/sys/arch/sparc/sparc/process_machdep.c    Wed Dec 29 11:08:02 1999 +0000
+++ b/sys/arch/sparc/sparc/process_machdep.c    Wed Dec 29 15:21:27 1999 +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.7 1999/12/29 15:21:27 pk 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