Subject: Re: Call for assistance: porters wanted for nathanw_sa support
To: Nathan J. Williams <nathanw@wasabisystems.com>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-kern
Date: 11/18/2001 16:41:11
On Wed, Oct 31, 2001 at 07:44:54PM -0500, Nathan J. Williams wrote:

 >  14) In the pthread/arch/PORT directory (this should be per-CPU, not
 >      per-platform), implement _getcontext_u(), _setcontext_u(),
 >      _swapcontext_u() (in _context_u.S), and pthread__switch(),
 >      pthread__locked_switch(), and pthread__upcall_switch() (in
 >      pthread_switch.S). In pthread_md, define pthread__sp() as an
 >      inline function which returns the value of the stack pointer, and
 >      pthread___uc_sp() as a macro that takes a ucontext_t and extracts
 >      the stack pointer from it.

What should be done wrt floating point state in the user-level
context switcher?  Presumably, if _UC_FPU is set in the ucontext,
then _setcontext_u() (and _swapcontext_u()) should restore the FP
state.  But what about saving FP state in _getcontext_u()?

I guess I'm wondering what will happen with two different threads
are using FP...

(This gets even trickier for systems w/ soft FP in libc... guess in
that case, you just need to save the rounding modes, etc...)

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>