From owner-cvs-all Thu Nov 14 11:51:59 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B79337B401; Thu, 14 Nov 2002 11:51:57 -0800 (PST) Received: from herring.nlsystems.com (mailgate.nlsystems.com [62.49.251.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 792E243F1E; Thu, 14 Nov 2002 11:51:44 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from herring.nlsystems.com (herring [10.0.0.2]) by herring.nlsystems.com (8.12.6/8.12.6) with ESMTP id gAEJpfDP087392; Thu, 14 Nov 2002 19:51:41 GMT (envelope-from dfr@nlsystems.com) Content-Type: text/plain; charset="iso-8859-1" From: Doug Rabson To: Marcel Moolenaar Subject: Re: cvs commit: src/lib/libc/ia64/gen _setjmp.S Date: Thu, 14 Nov 2002 19:51:41 +0000 User-Agent: KMail/1.4.3 Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org References: <200211140640.gAE6eNq9016231@repoman.freebsd.org> <1037298535.19149.8.camel@builder02.qubesoft.com> <20021114194057.GA856@dhcp01.pn.xcllnt.net> In-Reply-To: <20021114194057.GA856@dhcp01.pn.xcllnt.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200211141951.41202.dfr@nlsystems.com> X-Spam-Status: No, hits=-8.2 required=5.0 tests=IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_03_05, USER_AGENT,USER_AGENT_KMAIL version=2.41 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thursday 14 November 2002 7:40 pm, Marcel Moolenaar wrote: > On Thu, Nov 14, 2002 at 06:28:55PM +0000, Doug Rabson wrote: > > > Why do you need a flushrs in longjmp() anyway? > > > 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=20 for thread switching, you would need to call flushrs from setjmp. That=20 would simplify longjmp at the cost of severely pessimising setjmp. > > > > It's good to eventually optimize setjmp/longjmp for the common > > > case, but at this time it's all we have and I think we'd better > > > focus on being functionally complete. > > > > I don't think thread switching is (should be) part of the > > functional specification of setjmp/longjmp. > > I don't disagree, but deischen's swapcontext stuff is not here yet > and not having libc_r is hurting now. I would rather do this right than break setjmp. Intel wrote the code=20 that way for a good reason. Dan is close to being able to commit the=20 syscall version of swapcontext, and we should be able to implement that=20 for ia64 easily. FWIW, linux doesn't support setjmp/longjmp style=20 thread switching. --=20 Doug Rabson=09=09=09=09Mail: dfr@nlsystems.com =09=09=09=09=09Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message