From owner-freebsd-arch Thu Jan 10 5:14:54 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 91AF237B41A for ; Thu, 10 Jan 2002 05:14:47 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id AAA20032; Fri, 11 Jan 2002 00:14:20 +1100 Date: Fri, 11 Jan 2002 00:14:58 +1100 (EST) From: Bruce Evans X-X-Sender: To: Peter Wemm Cc: Nate Williams , Dan Eischen , Archie Cobbs , Alfred Perlstein , Subject: Re: Request for review: getcontext, setcontext, etc In-Reply-To: <20020110090055.B28BC38CC@overcee.netplex.com.au> Message-ID: <20020111000813.N12236-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 10 Jan 2002, Peter Wemm wrote: > Nate Williams wrote: > > Hmm, IIRC, Java's green threads saves the FP context everytime it does a > > thread switch, since it has no way of knowing if the thread was doing FP > > context. Is there a way to force get/setcontext to always/conditionally > > save the FP context, for applications that either know they need to have > > it saved? > > Exactly the problem. Userland cannot tell if it has touched FP or not > except by touching it. This is where a system call is more efficient since > to save FP context you are doing trap recovery on top of doing the work. Actually, userland can look at the state bit in %msw (on i386's) to tell if it can look at the state without trapping. However, this is not very useful. The state will often be in the kernel, and then userland will have to trap to the kernel too look at it. The trap may as well be a syscall that fetches all the state. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message