From owner-freebsd-arch Mon Jan 7 13:12:53 2002 Delivered-To: freebsd-arch@freebsd.org Received: from ns.yogotech.com (ns.yogotech.com [206.127.123.66]) by hub.freebsd.org (Postfix) with ESMTP id 794A837B405 for ; Mon, 7 Jan 2002 13:12:45 -0800 (PST) Received: from caddis.yogotech.com (caddis.yogotech.com [206.127.123.130]) by ns.yogotech.com (8.9.3/8.9.3) with ESMTP id OAA16959; Mon, 7 Jan 2002 14:12:34 -0700 (MST) (envelope-from nate@yogotech.com) Received: (from nate@localhost) by caddis.yogotech.com (8.11.6/8.11.6) id g07LCX299828; Mon, 7 Jan 2002 14:12:34 -0700 (MST) (envelope-from nate) From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15418.3903.102913.925450@caddis.yogotech.com> Date: Mon, 7 Jan 2002 14:12:31 -0700 To: Daniel Eischen Cc: Nate Williams , Dan Eischen , Peter Wemm , Archie Cobbs , Alfred Perlstein , arch@FreeBSD.ORG Subject: Re: Request for review: getcontext, setcontext, etc In-Reply-To: References: <15418.2505.568006.160724@caddis.yogotech.com> X-Mailer: VM 6.96 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid Reply-To: nate@yogotech.com (Nate Williams) 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 > > > What guarantees do you have that the FP state is restored > > > to where it was prior to calling foo_fp_munch_lots_more()? > > > > Because the code (and code similar to it) is called by the thread > > scheduler when a thread switches context. > > > > Above, if the thread switches context (involuntarily or voluntarily), > > the code I posted (and others routines similar to it it) also saves the > > context, and just before the context is switched back to the above > > thread, the FPU context is restored (along with all of the other > > information necessary to restore the thread context). > > > > Not all thread switches are done using yield. > > I am only concerned with voluntary switches; forget about signals > and preemptions. The threads library knows the difference between > voluntary and involuntary switches. Involuntary switches always > come from the kernel (in libc_r via signals) The JDK is the same. > and have the full FPU state saved (and restored when resumed). Is this done with fsave and frstor, which saves the entire context? Where is this done in the libc_r code? (I looked on my 4.5-PRE box, but nothing jumped out at me in grep search.) > Assume that setcontext > can tell if the FP state is saved or not and will restore it when > needed. Wonderful. > Assume that the kernel (or the threads library) will save > the FP state when a signal occurs. Wonderful. Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message