From owner-cvs-all Fri Nov 12 20:20:56 1999 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 60A9B150F8; Fri, 12 Nov 1999 20:20:48 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from p46-ts5.syd2.zeta.org.au (beefcake.zeta.org.au [203.26.10.12]) by mailman.zeta.org.au (8.8.7/8.8.7) with ESMTP id PAA18937; Sat, 13 Nov 1999 15:26:58 +1100 Date: Sat, 13 Nov 1999 15:20:35 +1100 (EST) From: Bruce Evans X-Sender: bde@alphplex.bde.org To: Nate Williams Cc: Marcel Moolenaar , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/i386/include signal.h In-Reply-To: <199911121711.KAA19367@mt.sri.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk > > > By reseting the FPU with fninit, we *lose* much of the state, we in our > > > code we must restore the state (which we stored before the call to > > > sigsetjmp with fsave/fwait). > > > > fninit lose some current state, but nothing related to the state at the > > time of the sigsetjmp(). JDK apparently needs to restore the state at > > the time of the setjmp(). > > Right. What else would you restore if not the state at the time of the > setjmp? You would restore as necessary to prevent clobbering of local variables that are stored in registers at the time of the longjmp. In our i386 implementation, there are no such floating point variables, but the implementer of longjmp() should be aware of this. Any such integer and pointer variables are clobbered, as permitted by the C standard. Some implementations of longjmp() do extra work to support broken programs that don't expect this. > > The comment seems to be misleading. It > > should probably say "FreeBSD's siglongjmp() doesn't restore the FPU to > > its state at the time of the sigsetjmp(), so we restore it here". > > What other state would you restore if not the state at the time of the > sigsetjmp? You would set (not restore) to a default state. That's what fninit does. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message