summaryrefslogtreecommitdiffstats
path: root/lib/libthr
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2013-04-10 02:40:03 +0000
committerdavidxu <davidxu@FreeBSD.org>2013-04-10 02:40:03 +0000
commitac0cfc7fcb1b51ee6aeacfd676fa6dfbe11eefb5 (patch)
tree06c13eb76ea94651e8cb651c68dc05bfa1ed83ba /lib/libthr
parentfc5a92987d076dad8e5bc8d16ebd57230c5409dd (diff)
downloadFreeBSD-src-ac0cfc7fcb1b51ee6aeacfd676fa6dfbe11eefb5.zip
FreeBSD-src-ac0cfc7fcb1b51ee6aeacfd676fa6dfbe11eefb5.tar.gz
swapcontext wrapper can not be implemented in C, the stack pointer saved in
the context becomes invalid when the function returns, same as setjmp, it must be implemented in assemble language, see discussions in PR misc/177624.
Diffstat (limited to 'lib/libthr')
-rw-r--r--lib/libthr/thread/thr_sig.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c
index d2be994..a99395f 100644
--- a/lib/libthr/thread/thr_sig.c
+++ b/lib/libthr/thread/thr_sig.c
@@ -737,13 +737,4 @@ _setcontext(const ucontext_t *ucp)
return __sys_setcontext(&uc);
}
-__weak_reference(_swapcontext, swapcontext);
-int
-_swapcontext(ucontext_t *oucp, const ucontext_t *ucp)
-{
- ucontext_t uc;
-
- (void) memcpy(&uc, ucp, sizeof(uc));
- remove_thr_signals(&uc.uc_sigmask);
- return __sys_swapcontext(oucp, &uc);
-}
+__weak_reference(__sys_swapcontext, swapcontext);
OpenPOWER on IntegriCloud