On 8/2/18 5:13 AM, Ruslan Bukin wrote:
> Author: br
> Date: Thu Aug  2 12:13:52 2018
> New Revision: 337127
> URL: https://svnweb.freebsd.org/changeset/base/337127
> 
> Log:
>   Don't overwrite tp in set_mcontext().
>   
>   This makes libthr/swapcontext_test:swapcontext1 happy.
>   
>   Sponsored by:       DARPA, AFRL

This seems a bit odd.  Is get_mcontext() not setting gp_tp correctly, or is
makecontext() not preserving it perhaps?

In general I feel like we should be saving/restoring 'tp' in the trapframe
on kernel entry/exit like other GPRs instead of in the pcb and then
including it in 'struct reg'.  This makes it possible for debuggers to
handle TLS variables more sanely (and in general we need to fix the various
struct reg in FreeBSD architectures to include TLS registers when possible,
such as adding fs_base and gs_base on x86).  It would be nice if RISC-V
started off on the correct foot here.

-- 
John Baldwin
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to