From owner-freebsd-arch Thu Jan 10 8:36:38 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 0DC2437B400 for ; Thu, 10 Jan 2002 08:36:27 -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 JAA24252; Thu, 10 Jan 2002 09:36:00 -0700 (MST) (envelope-from nate@yogotech.com) Received: (from nate@localhost) by caddis.yogotech.com (8.11.6/8.11.6) id g0AGZxR23383; Thu, 10 Jan 2002 09:35:59 -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: <15421.49903.523526.956561@caddis.yogotech.com> Date: Thu, 10 Jan 2002 09:35:59 -0700 To: Peter Wemm Cc: nate@yogotech.com (Nate Williams), Daniel Eischen , Dan Eischen , Archie Cobbs , Alfred Perlstein , arch@FreeBSD.ORG Subject: Re: Request for review: getcontext, setcontext, etc In-Reply-To: <20020110091018.0788A38CC@overcee.netplex.com.au> References: <15418.518.723982.571226@caddis.yogotech.com> <20020110091018.0788A38CC@overcee.netplex.com.au> 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 > > Basically, we do a 'fsave' on an 108 byte array (which is the amount of > > space required to save a complete processor state of the FPU unit on a > > 387), and then later restore the same state. > > FWIW, this is no longer the case. On all current CPUs, there are a whole > stack more registers. By current, do you mean 586/686. > The context save buffer is 512 bytes long. It isn't > all used yet, but will be at some point in the future as long as you use > the defined fxsave/fxrstor instructions. Is the function call the same for the newer processors, such that we can just increase the size of the buffer to 512 bytes, and it will work on all current CPUs. > When a userland application does a getcontext(), the kernel looks at > fpcurthread to see if the calling process/thread/whatever has got its > context stored in the pcb or in the live registers. There is no need to > copy state to the FPU solely in order for the userland to save a copy. So, if we make getcontext/setcontext a system call, we could do things more effeciently. However, part of the reason why it would be nice to have get/setcontext as userland calls is that it makes userland thread scheduling much more effecient since it doesn't require system calls. Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message