Since the cause of the problems with the __fillcontextx() was
identified, unify the code of check_deferred_signal() for all architectures, making the variant under #ifdef x86 common. Tested by: marius (sparc64) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
This commit is contained in:
parent
07d46f9c18
commit
91ddaeb725
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=251284
@ -318,31 +318,23 @@ check_deferred_signal(struct pthread *curthread)
|
|||||||
ucontext_t *uc;
|
ucontext_t *uc;
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
siginfo_t info;
|
siginfo_t info;
|
||||||
|
int uc_len;
|
||||||
|
|
||||||
if (__predict_true(curthread->deferred_siginfo.si_signo == 0))
|
if (__predict_true(curthread->deferred_siginfo.si_signo == 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if defined(__amd64__) || defined(__i386__)
|
|
||||||
int uc_len;
|
|
||||||
uc_len = __getcontextx_size();
|
uc_len = __getcontextx_size();
|
||||||
uc = alloca(uc_len);
|
uc = alloca(uc_len);
|
||||||
getcontext(uc);
|
getcontext(uc);
|
||||||
if (curthread->deferred_siginfo.si_signo == 0)
|
if (curthread->deferred_siginfo.si_signo == 0)
|
||||||
return;
|
return;
|
||||||
__fillcontextx2((char *)uc);
|
__fillcontextx2((char *)uc);
|
||||||
#else
|
act = curthread->deferred_sigact;
|
||||||
ucontext_t ucv;
|
uc->uc_sigmask = curthread->deferred_sigmask;
|
||||||
uc = &ucv;
|
memcpy(&info, &curthread->deferred_siginfo, sizeof(siginfo_t));
|
||||||
getcontext(uc);
|
/* remove signal */
|
||||||
#endif
|
curthread->deferred_siginfo.si_signo = 0;
|
||||||
if (curthread->deferred_siginfo.si_signo != 0) {
|
handle_signal(&act, info.si_signo, &info, uc);
|
||||||
act = curthread->deferred_sigact;
|
|
||||||
uc->uc_sigmask = curthread->deferred_sigmask;
|
|
||||||
memcpy(&info, &curthread->deferred_siginfo, sizeof(siginfo_t));
|
|
||||||
/* remove signal */
|
|
||||||
curthread->deferred_siginfo.si_signo = 0;
|
|
||||||
handle_signal(&act, info.si_signo, &info, uc);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user