From owner-freebsd-alpha Fri Jan 4 13:19:26 2002 Delivered-To: freebsd-alpha@freebsd.org Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by hub.freebsd.org (Postfix) with ESMTP id F3E5737B41A for ; Fri, 4 Jan 2002 13:19:21 -0800 (PST) Received: (from uucp@localhost) by srv1.cosmo-project.de (8.11.6/8.11.6) with UUCP id g04LJIr65441; Fri, 4 Jan 2002 22:19:19 +0100 (CET) (envelope-from ticso@cicely8.cicely.de) Received: from mail.cicely.de (cicely20.cicely.de [10.1.1.22]) by cicely5.cicely.de (8.12.1/8.12.1) with ESMTP id g04LIUtx061095; Fri, 4 Jan 2002 22:18:31 +0100 (CET)?g (envelope-from ticso@cicely8.cicely.de) Received: from cicely8.cicely.de (cicely8.cicely.de [10.1.2.10]) by mail.cicely.de (8.11.0/8.11.0) with ESMTP id g04LIUW16236; Fri, 4 Jan 2002 22:18:30 +0100 (CET) Received: (from ticso@localhost) by cicely8.cicely.de (8.11.6/8.11.6) id g04LITw10014; Fri, 4 Jan 2002 22:18:29 +0100 (CET) (envelope-from ticso) Date: Fri, 4 Jan 2002 22:18:29 +0100 From: Bernd Walter To: Daniel Eischen Cc: alpha@FreeBSD.ORG Subject: Re: {get,set,make,swap}context for alpha Message-ID: <20020104221828.F8703@cicely8.cicely.de> References: <20020104182107.D8703@cicely8.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.23i X-Operating-System: FreeBSD cicely8.cicely.de 5.0-CURRENT i386 Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, Jan 04, 2002 at 12:56:45PM -0500, Daniel Eischen wrote: > On Fri, 4 Jan 2002, Bernd Walter wrote: > > --- _ctx_start.S.orig Fri Jan 4 18:15:18 2002 > > +++ _ctx_start.S Fri Jan 4 18:13:26 2002 > > @@ -40,6 +40,7 @@ > > .set noreorder > > LEAF(_ctx_start,0) > > LDGP(pv) > > + mov s0, t12 > > jsr ra, (s0) /* call start routine; args already set */ > > mov s1, a0 /* load A0 (arg 1) with pointer to ucontext */ > > CALL(_ctx_done) /* call context completion routine */ > > Ahh, this makes a bit of sense. After rechecking I found it was incomplete: ticso@cicely9# diff -u _ctx_start.S.orig _ctx_start.S --- _ctx_start.S.orig Fri Jan 4 18:15:18 2002 +++ _ctx_start.S Fri Jan 4 22:05:42 2002 @@ -39,8 +39,9 @@ */ .set noreorder LEAF(_ctx_start,0) - LDGP(pv) + mov s0, t12 jsr ra, (s0) /* call start routine; args already set */ + LDGP(ra) mov s1, a0 /* load A0 (arg 1) with pointer to ucontext */ CALL(_ctx_done) /* call context completion routine */ CALL(abort) /* should never return from above call */ The original LDGP was useless, because it t12 wasn't initialised, but we also don't need it. After calling a function we need to reinitialise gp, which is implied by CALL but not by jsr alone. We need a valid gp to get _ctx_done savely referenced. -- B.Walter COSMO-Project http://www.cosmo-project.de ticso@cicely.de Usergroup info@cosmo-project.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message