From owner-cvs-all Thu Nov 14 2: 9:50 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 5D77E37B401; Thu, 14 Nov 2002 02:09:49 -0800 (PST) Received: from herring.nlsystems.com (mailgate.nlsystems.com [62.49.251.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3AC2A43E75; Thu, 14 Nov 2002 02:09:48 -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 gAEA9jDP084999; Thu, 14 Nov 2002 10:09:45 GMT (envelope-from dfr@nlsystems.com) Content-Type: text/plain; charset="iso-8859-1" From: Doug Rabson To: Marcel Moolenaar , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/ia64/gen _setjmp.S Date: Thu, 14 Nov 2002 10:09:44 +0000 User-Agent: KMail/1.4.3 References: <200211140640.gAE6eNq9016231@repoman.freebsd.org> In-Reply-To: <200211140640.gAE6eNq9016231@repoman.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200211141009.45000.dfr@nlsystems.com> X-Spam-Status: No, hits=-7.7 required=5.0 tests=IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_00_01, 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 6:40 am, Marcel Moolenaar wrote: > marcel 2002/11/13 22:40:23 PST > > Modified files: > lib/libc/ia64/gen _setjmp.S > Log: > o Fix _longjmp() to return 1 when the return value is given as 0. > o Remove the unwanted smartness in _longjmp() where it compares > the current ar.bspstore with the saved ar.bspstore and restores > ar.rnat based on it. This either avoids saving ar.rnat in the > jmp_buf or is the consequence of not saving ar.rnat. All this > complexity breaks libc_r where we use longjmp() to switch to > different threads and the current ar.bspstore has no relation > to the saved ar.bspstore. Thus: we save ar.rnat in setjmp() > and simply restore ar.bspstore and ar.rnat in longjmp(). This is wrong, I think. The purpose of the comparing bspstore values is=20 to avoid a forced flushrs in the normal case of unwinding a single=20 stack. This is the intel-recommended approach for implementing longjmp.=20 We need to use switchcontext() for libc_r which knows that it is=20 switching stacks and can flush the register stack appropriately. I=20 don't think it would ever be a good idea to use longjmp for thread=20 switches on ia64. --=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