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

Daniel Eischen eischen at vigrid.com
Fri Oct 17 13:08:40 PDT 2003


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).

-- 
Dan Eischen



More information about the cvs-src mailing list