From owner-p4-projects@FreeBSD.ORG Sun Apr 20 21:42:20 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D618937B404; Sun, 20 Apr 2003 21:42:19 -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 7665E37B401 for ; Sun, 20 Apr 2003 21:42:19 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D65843F3F for ; Sun, 20 Apr 2003 21:42:19 -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 h3L4gI0U075052 for ; Sun, 20 Apr 2003 21:42:18 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3L4gIfv075045 for perforce@freebsd.org; Sun, 20 Apr 2003 21:42:18 -0700 (PDT) Date: Sun, 20 Apr 2003 21:42:18 -0700 (PDT) Message-Id: <200304210442.h3L4gIfv075045@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 29328 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: Mon, 21 Apr 2003 04:42:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=29328 Change 29328 by marcel@marcel_nfs on 2003/04/20 21:41:20 Don't use the preserved registers to tell fork_trampoline what the callout function is and what its argument is. The preserved registers are sacred and using them is instant death (due to not preserving the values contained in the preserved registers on entry into the kernel). Use two scratch registers in the trapframe instead. r2 and r3 are "randomly" picked. Affected files ... .. //depot/projects/ia64_epc/sys/ia64/ia64/locore.s#14 edit .. //depot/projects/ia64_epc/sys/ia64/ia64/vm_machdep.c#9 edit Differences ... ==== //depot/projects/ia64_epc/sys/ia64/ia64/locore.s#14 (text+ko) ==== @@ -135,7 +135,8 @@ * 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. + * The callout function and its argument is in the trapframe in scratch + * registers r2 and r3. */ ENTRY(fork_trampoline, 0) .prologue @@ -143,10 +144,15 @@ .body { .mmi alloc r14=ar.pfs,0,0,3,0 - mov out0=r4 - mov out1=r6 + add r15=32+SIZEOF_SPECIAL+8,sp + add r16=32+SIZEOF_SPECIAL+16,sp ;; } +{ .mmi + ld8 out0=[r15] + ld8 out1=[r16] + nop 0 +} { .mfb add out2=16,sp nop 0 ==== //depot/projects/ia64_epc/sys/ia64/ia64/vm_machdep.c#9 (text+ko) ==== @@ -202,8 +202,8 @@ void (*func)(void *); void *arg; { - td->td_pcb->pcb_preserved.gr4 = (u_int64_t)func; - td->td_pcb->pcb_preserved.gr6 = (u_int64_t)arg; + td->td_frame->tf_scratch.gr2 = (u_int64_t)func; + td->td_frame->tf_scratch.gr3 = (u_int64_t)arg; } /*