Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86_64/x86_64 Propagate P_32 flag on fork. Use corr...



details:   https://anonhg.NetBSD.org/src/rev/cf1c40a6f4b3
branches:  trunk
changeset: 532270:cf1c40a6f4b3
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Tue Jun 04 12:58:13 2002 +0000

description:
Propagate P_32 flag on fork. Use correct trampoline for 32bit return.

diffstat:

 sys/arch/x86_64/x86_64/vm_machdep.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 947e98f2e4bc -r cf1c40a6f4b3 sys/arch/x86_64/x86_64/vm_machdep.c
--- a/sys/arch/x86_64/x86_64/vm_machdep.c       Tue Jun 04 11:17:11 2002 +0000
+++ b/sys/arch/x86_64/x86_64/vm_machdep.c       Tue Jun 04 12:58:13 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.6 2002/06/03 18:23:17 fvdl Exp $      */
+/*     $NetBSD: vm_machdep.c,v 1.7 2002/06/04 12:58:13 fvdl Exp $      */
 
 /*-
  * Copyright (c) 1995 Charles M. Hannum.  All rights reserved.
@@ -111,6 +111,8 @@
                fpusave();
 
        p2->p_md.md_flags = p1->p_md.md_flags;
+       if (p1->p_flag & P_32)
+               p2->p_flag |= P_32;
 
        /* Copy pcb from proc p1 to p2. */
        if (p1 == curproc) {
@@ -152,7 +154,7 @@
        sf->sf_ppl = 0;
        sf->sf_r12 = (u_int64_t)func;
        sf->sf_r13 = (u_int64_t)arg;
-       if (func == child_return)
+       if (func == child_return && !(p2->p_flag & P_32))
                sf->sf_rip = (u_int64_t)child_trampoline;
        else
                sf->sf_rip = (u_int64_t)proc_trampoline;



Home | Main Index | Thread Index | Old Index