Date: Thu, 10 Jan 2002 09:35:59 -0700 From: Nate Williams <nate@yogotech.com> To: Peter Wemm <peter@wemm.org> Cc: nate@yogotech.com (Nate Williams), Daniel Eischen <eischen@pcnet1.pcnet.com>, Dan Eischen <eischen@vigrid.com>, Archie Cobbs <archie@dellroad.org>, Alfred Perlstein <bright@mu.org>, arch@FreeBSD.ORG Subject: Re: Request for review: getcontext, setcontext, etc Message-ID: <15421.49903.523526.956561@caddis.yogotech.com> In-Reply-To: <20020110091018.0788A38CC@overcee.netplex.com.au> References: <15418.518.723982.571226@caddis.yogotech.com> <20020110091018.0788A38CC@overcee.netplex.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
> > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15421.49903.523526.956561>