Date: Tue, 8 Apr 2003 19:04:43 -0700 (PDT) From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 28595 for review Message-ID: <200304090204.h3924hlE022885@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=28595 Change 28595 by marcel@marcel_nfs on 2003/04/08 19:03:47 Move fork_trampoline from context.s to locore.s and break where we used to jump to exception_restore. We cannot go to exception_restore, because fork(2) will have a syscall frame instead of a trap frame. Hence, we must go to user space in a way that works with the EPC syscall path. This has to be determined. Affected files ... .. //depot/projects/ia64_epc/sys/ia64/ia64/context.s#8 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/locore.s#6 edit Differences ... ==== //depot/projects/ia64_epc/sys/ia64/ia64/context.s#8 (text+ko) ==== @@ -302,35 +302,6 @@ END(swapctx) /* - * fork_trampoline() - * - * Arrange for a function to be invoked neatly, after a cpu_switch(). - * - * Invokes fork_exit() passing in three arguments: a callout function, an - * argument to the callout, and a trapframe pointer. For child processes - * returning from fork(2), the argument is a pointer to the child process. - * - * The callout function is in r4, the address to return to after executing - * fork_exit() is in r5, and the argument is in r6. - */ -ENTRY(fork_trampoline, 0) - .prologue - .save rp,r0 - .body - alloc r14=ar.pfs,0,0,3,0 - ;; - mov b0=r5 - mov out0=r4 - mov out1=r6 - add out2=16,sp - ;; - br.call.sptk.few rp=fork_exit - ;; - br.cond.sptk.many exception_restore - ;; -END(fork_trampoline) - -/* * _getcontext(ucontext_t *ucp) */ ENTRY(_getcontext, 1) ==== //depot/projects/ia64_epc/sys/ia64/ia64/locore.s#6 (text+ko) ==== @@ -141,6 +141,38 @@ END(mi_startup_trampoline) +/* + * fork_trampoline() + * + * Arrange for a function to be invoked neatly, after a cpu_switch(). + * + * Invokes fork_exit() passing in three arguments: a callout function, an + * argument to the callout, and a trapframe pointer. For child processes + * returning from fork(2), the argument is a pointer to the child process. + * + * The callout function is in r4 and the argument is in r6. + */ +ENTRY(fork_trampoline, 0) + .prologue + .save rp,r0 + .body +{ .mmi + alloc r14=ar.pfs,0,0,3,0 + mov out0=r4 + mov out1=r6 + ;; +} +{ .mfb + add out2=16,sp + nop 0 + br.call.sptk rp=fork_exit + ;; +} + // If we get back here, it means we're a user space process that's + // the immediate result of fork(2). + break 0 +END(fork_trampoline) + #ifdef SMP /* * AP wake-up entry point. The handoff state is similar as for the BSP,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304090204.h3924hlE022885>