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.
This commit is contained in:
parent
ae551da6a1
commit
31c18e29cc
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user