From owner-freebsd-alpha Fri Jan 4 8:47:50 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 BB50637B41C for ; Fri, 4 Jan 2002 08:47:46 -0800 (PST) Received: (from uucp@localhost) by srv1.cosmo-project.de (8.11.6/8.11.6) with UUCP id g04Glh959816; Fri, 4 Jan 2002 17:47:43 +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 g04GkEtx059530; Fri, 4 Jan 2002 17:46:15 +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 g04GkEW16007; Fri, 4 Jan 2002 17:46:14 +0100 (CET) Received: (from ticso@localhost) by cicely8.cicely.de (8.11.6/8.11.6) id g04GkDa09392; Fri, 4 Jan 2002 17:46:13 +0100 (CET) (envelope-from ticso) Date: Fri, 4 Jan 2002 17:46:13 +0100 From: Bernd Walter To: Daniel Eischen Cc: alpha@FreeBSD.ORG Subject: Re: {get,set,make,swap}context for alpha Message-ID: <20020104174613.C8703@cicely8.cicely.de> References: <20020104143622.A8703@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 09:36:23AM -0500, Daniel Eischen wrote: > On Fri, 4 Jan 2002, Bernd Walter wrote: > > On Thu, Jan 03, 2002 at 04:05:25PM -0500, Daniel Eischen wrote: > [...] > > > The first problem I'm having is that getcontext is getting caught > > > in an infinite loop. After the call to sigprocmask, the return > > > value is checked and the next branch instruction doesn't jump to > > > the label; it jumps to a few instructions prior and repeats all > > > over again. > > > > > > ... > > > CALL(_sigprocmask) /* see what's blocked */ > > > mov s0, a0 /* restore ptr to ucontext */ > > > --> beq v0, Lgc2 /* check for error */ > > > ldiq v0, -1 /* return -1 */ > > > br Lgcend > > > Lgc2: > > > ... > > OK, I changed the above to be: > > CALL(_sigprocmask) /* see what's blocked */ > mov s0, a0 /* restore ptr to ucontext */ > ldq ra, ((FRAME_RA + 3) * 8)(a0) /* restore ra */ > ldq s0, ((FRAME_S0 + 3) * 8)(a0) /* restore s0 */ > beq v0, Lgc2 /* check for error */ > ldiq v0, -1 /* return -1 */ > br Lgcend > Lgc2: > ... > > and getcontext now seems to work. I think getcontext can remain a > LEAF function because it can save and restore anything it wants in > the context; that's it's raison d'etre. setcontext probably needs > to be a NESTED function because it doesn't have a place to save > and restore anything -- unless it uses some unused slots in the > ucontext... Lsc_sm: lda sp, -16(sp) /* get stack space */ stq ra, 0(sp) /* save ra */ stq a0, 8(sp) /* save ptr to ucontext */ mov a0, a1 /* set: &ucp->uc_sigmask */ mov zero, a2 /* oset: NULL */ ldiq a0, 3 /* how: SIG_SETMASK */ CALL(_sigprocmask) /* set new signal mask */ ldq a0, 8(sp) /* restore ptr to ucontext */ ldq ra, 0(sp) /* restore ra */ lda sp, 16(sp) /* restore sp */ bne v0, Lscbad /* check for error */ /* restore floating point regs first */ ldq t0, ((71 + 3) * 8)(a0) /* if FP regs not saved, */ What I found so far with the core dump is that proc3 is called with a bogus t12 value. I still have to search why. -- 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