Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Oct 2003 16:08:38 -0400 (EDT)
From:      Daniel Eischen <eischen@vigrid.com>
To:        Peter Wemm <peter@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libpthread/arch/amd64/amd64 context.S
Message-ID:  <Pine.GSO.4.10.10310171558150.233-100000@pcnet5.pcnet.com>
In-Reply-To: <200310171630.h9HGU9i1017210@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10310171558150.233-100000>