NetBSD/lib/libc/arch/mips
manu bba80928a8 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@
2012-09-12 02:00:51 +00:00
..
gdtoa Remove CPUFLAGS?= since it's no longer needed. 2011-01-20 18:41:39 +00:00
gen setcontext() used to be incompatible with -lpthread since it affected 2012-09-12 02:00:51 +00:00
net Rename ${SRCS.{alpha,arm,...}.gen} to ${LSRCS.{alpha,arm,...}.gen} because 2009-12-06 07:12:17 +00:00
softfloat Don't define a new enum. Just #define round_* to their FP_Rx instead. 2011-07-07 07:14:57 +00:00
stdlib Add the 'abs', 'div' and 'erand48' sources to stdlib/Makefile.inc. 2009-07-31 20:39:59 +00:00
string Fix typo. 2009-12-14 02:53:52 +00:00
sys Fix pasto. 2012-02-27 14:48:34 +00:00
genassym.cf Merge from matt-nb5-mips64. 2009-12-14 01:07:41 +00:00
Makefile.inc Don't build tf (long double) if building for O32. 2011-07-09 04:12:01 +00:00
SYS.h Merge from matt-nb5-mips64. 2009-12-14 01:07:41 +00:00