cvs commit: src/lib/libpthread/arch/amd64/amd64 context.S

Peter Wemm peter at wemm.org
Fri Oct 17 16:45:50 PDT 2003


Daniel Eischen wrote:
> On Fri, 17 Oct 2003, Peter Wemm wrote:
> 
> > peter       2003/10/17 09:30:09 PDT
> > 
> >   FreeBSD src repository
> > 
> >   Modified files:
> >     lib/libpthread/arch/amd64/amd64 context.S 
> >   Log:
> >   Update context code for my last ABI breakage of mcontext.  I'm worried
> >   about the fpu code here.  It should be using fxsave/fxrstor instead of
> >   saving/restoring the control word.  The SSE registers are used a lot in
> >   gcc generated code on amd64.  I'm not sure how this all fits together
> >   though.
> 
> FYI, the arch-dependent save context is called as a result of an
> explicit (e.g., pthread_yield) or implicit (e.g., blocking on a
> userland lock) context switch.  You only need to save as many
> registers as you would for a _setjmp() as long as you mark the
> context appropriately (mc_flags, mc_fpformat, etc) and respect
> these in the restore context function.  The MD restore context
> needs to be able to handle both contexts passed out from the
> kernel (needing full restores) and those generated from the
> save context function (perhaps allowing a more minimal restore).

Aha!  That would explain a few things.  Thanks.

Cheers,
-Peter
--
Peter Wemm - peter at wemm.org; peter at FreeBSD.org; peter at yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5



More information about the cvs-src mailing list