Home | History | Annotate | Download | only in sys
History log of /src/tests/lib/libc/sys/t_swapcontext.c
RevisionDateAuthorComments
 1.5  27-May-2024  thorpej Mark as expected-fail on VAX (PR port-vax/58290).
 1.4  01-Aug-2023  andvar fix RCSIDs.
 1.3  05-May-2013  skrll Whitespace
 1.2  27-Sep-2012  skrll branches: 1.2.2;
Simplify
 1.1  12-Sep-2012  manu branches: 1.1.2;
setcontext() used to be incompatible with -lpthread since it affected
the TLS pointer, therefore wrecking the pthread environement.

Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha)
that controlled whether setcontext() would change the TLS pointer.
This change let libpthread override setcontext() with its own version
that unsets _UC_TLSBASE, enabling safe usage of setcontext() with
-lpthread.

We also have the following required changes here:
- rename alpha's _UC_UNIQUE into _UC_TLSBASE
- add _UC_TLSBASE definition in header file for all ports
(powerpc, sh3, sparc and sparc64 lack the implementation for now)
- introduce a libc stub that can be overriden for setcontext()
- modify MD libcs swapcontext() implementations so that they use the
setcontext() libc stub instead of doing a plain system call.

While we are there:
- document various MD _UC_* flags in header file
- add libc and libpthread tests for swapcontext() behavior
(hopefully helpful to spot MD problems introduced with this change)

Future work:
- Deciding whether kernel support or _UC_TLSBASE should be added for
powerpc, sh3, sparc and sparc64 is left to portmasters
sparc64

Approved by core@
 1.1.2.2  23-Jun-2013  tls resync from head
 1.1.2.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.2.3  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.2.2  30-Oct-2012  yamt sync with head
 1.2.2.1  27-Sep-2012  yamt file t_swapcontext.c was added on branch yamt-pagecache on 2012-10-30 19:00:02 +0000

RSS XML Feed