Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/amd64/amd64 Don't use err and trapno from a copied ...



details:   https://anonhg.NetBSD.org/src/rev/1eb2a51514a2
branches:  trunk
changeset: 553658:1eb2a51514a2
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Sun Oct 19 18:14:42 2003 +0000

description:
Don't use err and trapno from a copied in mcontext.

diffstat:

 sys/arch/amd64/amd64/compat_16_machdep.c |  12 ++++++++++--
 sys/arch/amd64/amd64/machdep.c           |  12 ++++++++++--
 2 files changed, 20 insertions(+), 4 deletions(-)

diffs (84 lines):

diff -r 7b2bc6d9ffc5 -r 1eb2a51514a2 sys/arch/amd64/amd64/compat_16_machdep.c
--- a/sys/arch/amd64/amd64/compat_16_machdep.c  Sun Oct 19 17:45:35 2003 +0000
+++ b/sys/arch/amd64/amd64/compat_16_machdep.c  Sun Oct 19 18:14:42 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_16_machdep.c,v 1.2 2003/10/13 18:45:59 fvdl Exp $       */
+/*     $NetBSD: compat_16_machdep.c,v 1.3 2003/10/19 18:14:42 fvdl Exp $       */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.2 2003/10/13 18:45:59 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.3 2003/10/19 18:14:42 fvdl Exp $");
 
 #include "opt_vm86.h"
 #include "opt_compat_netbsd.h"
@@ -86,6 +86,7 @@
        struct sigcontext *scp, context;
        struct trapframe *tf;
        int error;
+       int err, trapno;
 
        /*
         * The trampoline code hands us the context.
@@ -106,7 +107,14 @@
        if (error != 0)
                return error;
 
+       /*
+        * XXX maybe inline this.
+        */
+       err = tf->tf_err;
+       trapno = tf->tf_trapno;
        memcpy(tf, &context.sc_mcontext.__gregs, sizeof (*tf));
+       tf->tf_err = err;
+       tf->tf_trapno = trapno;
 
        /* Restore (possibly fixed up) FP state and force it to be reloaded */
        if (l->l_md.md_flags & MDP_USEDFPU) {
diff -r 7b2bc6d9ffc5 -r 1eb2a51514a2 sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c    Sun Oct 19 17:45:35 2003 +0000
+++ b/sys/arch/amd64/amd64/machdep.c    Sun Oct 19 18:14:42 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.13 2003/10/17 16:24:31 fvdl Exp $        */
+/*     $NetBSD: machdep.c,v 1.14 2003/10/19 18:14:42 fvdl Exp $        */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.13 2003/10/17 16:24:31 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.14 2003/10/19 18:14:42 fvdl Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_ddb.h"
@@ -1736,16 +1736,24 @@
        struct trapframe *tf = l->l_md.md_regs;
        __greg_t *gr = mcp->__gregs;
        int error;
+       int err, trapno;
        int64_t rflags;
 
        if ((flags & _UC_CPU) != 0) {
                error = check_mcontext(mcp, tf);
                if (error != 0)
                        return error;
+               /*
+                * XXX maybe inline this.
+                */
                rflags = tf->tf_rflags;
+               err = tf->tf_err;
+               trapno = tf->tf_trapno;
                memcpy(tf, gr, sizeof *tf);
                rflags &= ~PSL_USER;
                tf->tf_rflags = rflags | (gr[_REG_RFL] & PSL_USER);
+               tf->tf_err = err;
+               tf->tf_trapno = trapno;
        }
 
        if ((flags & _UC_FPU) != 0) {



Home | Main Index | Thread Index | Old Index