Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Feb 2001 07:10:20 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        ia64@FreeBSD.org
Subject:   TODO: update teh fork return code..
Message-ID:  <XFMail.010222071020.jhb@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
Hey gang,

One thing that ia64 needs to happen to catch up with the other arch's is to
update the fork return trampoline to call the fork_exit() function passing in
the pointer to the callout function and callout argument.  This would involve
changes to switch_trampoline() in swtch.s similar to the changes to
switch_trampoline() in sys/alpha/alpha/swtch.s and fork_trampoline() in
sys/i386/i386/exception.s (or maybe swtch.s) as well as the following diff:
Hmm, actually, I may need to fix userret() some to take a pointer to a
trapframe, but I'll do that in a second.  The big change I need help with is
the swtch.s change..

Index: trap.c
===================================================================
RCS file: /usr/cvs/src/sys/ia64/ia64/trap.c,v
retrieving revision 1.14
diff -u -r1.14 trap.c
--- trap.c      2001/02/22 13:29:22     1.14
+++ trap.c      2001/02/22 14:41:26
@@ -628,31 +628,6 @@
 }
 
 /*
- * Process the tail end of a fork() for the child.
- */
-void
-child_return(p)
-       struct proc *p;
-{
-
-       /*
-        * Return values in the frame set by cpu_fork().
-        */
-
-       userret(p, p->p_md.md_tf, 0);
-#ifdef KTRACE
-       if (KTRPOINT(p, KTR_SYSRET)) {
-               if (!mtx_owned(&Giant))
-                       mtx_lock(&Giant);
-               ktrsysret(p->p_tracep, SYS_fork, 0, 0);
-       }
-#endif
-
-       if (mtx_owned(&Giant))
-               mtx_unlock(&Giant);
-}
-
-/*
  * Process an asynchronous software trap.
  * This is relatively easy.
  */
Index: vm_machdep.c
===================================================================
RCS file: /usr/cvs/src/sys/ia64/ia64/vm_machdep.c,v
retrieving revision 1.11
diff -u -r1.11 vm_machdep.c
--- vm_machdep.c        2001/02/09 06:09:35     1.11
+++ vm_machdep.c        2001/02/09 08:50:05
@@ -261,7 +261,7 @@
                 * right value for gp.
                 */
                up->u_pcb.pcb_sp = (u_int64_t)p2tf - 16;        
-               up->u_pcb.pcb_r4 = FDESC_FUNC(child_return);
+               up->u_pcb.pcb_r4 = FDESC_FUNC(fork_return);
                up->u_pcb.pcb_r5 = FDESC_FUNC(exception_restore);
                up->u_pcb.pcb_r6 = (u_int64_t)p2;
                up->u_pcb.pcb_b0 = FDESC_FUNC(switch_trampoline);

-- 

John Baldwin <john@baldwin.cx> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ia64" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010222071020.jhb>