From owner-p4-projects@FreeBSD.ORG Tue Apr 8 19:04:44 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 66B2537B404; Tue, 8 Apr 2003 19:04:44 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 05BC937B401 for ; Tue, 8 Apr 2003 19:04:44 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 84D8C43F75 for ; Tue, 8 Apr 2003 19:04:43 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3924h0U022889 for ; Tue, 8 Apr 2003 19:04:43 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3924hlE022885 for perforce@freebsd.org; Tue, 8 Apr 2003 19:04:43 -0700 (PDT) Date: Tue, 8 Apr 2003 19:04:43 -0700 (PDT) Message-Id: <200304090204.h3924hlE022885@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 28595 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 02:04:45 -0000 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,