From owner-freebsd-ia64 Thu Nov 14 14:38:13 2002 Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E17E437B401 for ; Thu, 14 Nov 2002 14:38:11 -0800 (PST) Received: from kayak.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 981C543E75 for ; Thu, 14 Nov 2002 14:38:10 -0800 (PST) (envelope-from marcel@xcllnt.net) Received: from kayak.xcllnt.net (localhost [127.0.0.1]) by kayak.xcllnt.net (8.12.6/8.12.6) with ESMTP id gAEMcA0N031735; Thu, 14 Nov 2002 14:38:10 -0800 (PST) (envelope-from marcel@kayak.xcllnt.net) Received: (from marcel@localhost) by kayak.xcllnt.net (8.12.6/8.12.6/Submit) id gAEMc9gK031734; Thu, 14 Nov 2002 14:38:09 -0800 (PST) Date: Thu, 14 Nov 2002 14:38:09 -0800 From: Marcel Moolenaar To: Doug Rabson Cc: ia64@FreeBSD.org Subject: setjmp/longjmp and libc_r [was: Re: cvs commit: src/lib/libc/ia64/gen _setjmp.S] Message-ID: <20021114143809.A31710@kayak.xcllnt.net> References: <200211140640.gAE6eNq9016231@repoman.freebsd.org> <1037298535.19149.8.camel@builder02.qubesoft.com> <20021114194057.GA856@dhcp01.pn.xcllnt.net> <200211141951.41202.dfr@nlsystems.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200211141951.41202.dfr@nlsystems.com> User-Agent: Mutt/1.3.22.1i Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org [moved to ia64@] On Thu, Nov 14, 2002 at 07:51:41PM +0000, Doug Rabson wrote: > > > > All you really need to achieve is that ar.bsp equals ar.bspstore > > > > before you set ar.bspstore, right? > > > > (note that the loadrs is missing a cover or an alloc) > > > > > > You would need a flushrs if you really wanted to use longjmp for > > > thread switching, otherwise you would lose the stacked registers of > > > the thread you were switching away from. > > > > But you need a setjmp to save that context, right? How would you > > otherwise return to the thread? > > I've managed to reload my memory from magtape :-). To use setjmp/longjmp > for thread switching, you would need to call flushrs from setjmp. That > would simplify longjmp at the cost of severely pessimising setjmp. This is exactly what we now have and what I'm willing to sacrificy at this time. It's easy enough to optimize setjmp/longjmp once we have the *context stuff. Note that I'm still not convinced that not doing a flushrs in setjmp will work when a signal handler on the alternate stack jumps to the saved context on the regular stack. You cannot compare the saved ar.bsp or ar.bspstore with the current ar.bspstore without taking into account that they may not be on the same register stack. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message