mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
linux(4): optimize ksiginfo to siginfo conversion.
Retire ksiginfo_to_lsiginfo function, use siginfo_to_lsiginfo instead. Convert rt_sigtimedwait siginfo variables to well known names. MFC after: 2 weeks
This commit is contained in:
parent
9c1045ff00
commit
f4e801085b
5 changed files with 10 additions and 18 deletions
|
|
@ -666,7 +666,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
|
|||
|
||||
sf.sf_handler = catcher;
|
||||
/* Fill in POSIX parts. */
|
||||
ksiginfo_to_lsiginfo(ksi, &sf.sf_si, sig);
|
||||
siginfo_to_lsiginfo(&ksi->ksi_info, &sf.sf_si, sig);
|
||||
|
||||
/* Copy the sigframe out to the user's stack. */
|
||||
if (copyout(&sf, sfp, sizeof(*sfp)) != 0) {
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
|
|||
frame.sf_ucontext = PTROUT(&fp->sf_sc);
|
||||
|
||||
/* Fill in POSIX parts. */
|
||||
ksiginfo_to_lsiginfo(ksi, &frame.sf_si, sig);
|
||||
siginfo_to_lsiginfo(&ksi->ksi_info, &frame.sf_si, sig);
|
||||
|
||||
/*
|
||||
* Build the signal context to be used by sigreturn and libgcc unwind.
|
||||
|
|
|
|||
|
|
@ -398,8 +398,8 @@ linux_rt_sigtimedwait(struct thread *td,
|
|||
struct l_timespec lts;
|
||||
l_sigset_t lset;
|
||||
sigset_t bset;
|
||||
l_siginfo_t linfo;
|
||||
ksiginfo_t info;
|
||||
l_siginfo_t lsi;
|
||||
ksiginfo_t ksi;
|
||||
|
||||
if (args->sigsetsize != sizeof(l_sigset_t))
|
||||
return (EINVAL);
|
||||
|
|
@ -419,16 +419,16 @@ linux_rt_sigtimedwait(struct thread *td,
|
|||
} else
|
||||
tsa = NULL;
|
||||
|
||||
error = kern_sigtimedwait(td, bset, &info, tsa);
|
||||
error = kern_sigtimedwait(td, bset, &ksi, tsa);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
sig = bsd_to_linux_signal(info.ksi_signo);
|
||||
sig = bsd_to_linux_signal(ksi.ksi_signo);
|
||||
|
||||
if (args->ptr) {
|
||||
memset(&linfo, 0, sizeof(linfo));
|
||||
ksiginfo_to_lsiginfo(&info, &linfo, sig);
|
||||
error = copyout(&linfo, args->ptr, sizeof(linfo));
|
||||
memset(&lsi, 0, sizeof(lsi));
|
||||
siginfo_to_lsiginfo(&ksi.ksi_info, &lsi, sig);
|
||||
error = copyout(&lsi, args->ptr, sizeof(lsi));
|
||||
}
|
||||
if (error == 0)
|
||||
td->td_retval[0] = sig;
|
||||
|
|
@ -542,13 +542,6 @@ linux_tkill(struct thread *td, struct linux_tkill_args *args)
|
|||
return (linux_do_tkill(td, tdt, &ksi));
|
||||
}
|
||||
|
||||
void
|
||||
ksiginfo_to_lsiginfo(const ksiginfo_t *ksi, l_siginfo_t *lsi, l_int sig)
|
||||
{
|
||||
|
||||
siginfo_to_lsiginfo(&ksi->ksi_info, lsi, sig);
|
||||
}
|
||||
|
||||
static void
|
||||
sicode_to_lsicode(int si_code, int *lsi_code)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@
|
|||
#define LINUX_SI_TKILL -6 /* sent by tkill system call */
|
||||
|
||||
int linux_do_sigaction(struct thread *, int, l_sigaction_t *, l_sigaction_t *);
|
||||
void ksiginfo_to_lsiginfo(const ksiginfo_t *ksi, l_siginfo_t *lsi, l_int sig);
|
||||
void siginfo_to_lsiginfo(const siginfo_t *si, l_siginfo_t *lsi, l_int sig);
|
||||
int lsiginfo_to_siginfo(struct thread *td, const l_siginfo_t *lsi,
|
||||
siginfo_t *si, int sig);
|
||||
|
|
|
|||
|
|
@ -430,7 +430,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
|
|||
frame.sf_ucontext = &fp->sf_sc;
|
||||
|
||||
/* Fill in POSIX parts. */
|
||||
ksiginfo_to_lsiginfo(ksi, &frame.sf_si, sig);
|
||||
siginfo_to_lsiginfo(&ksi->ksi_info, &frame.sf_si, sig);
|
||||
|
||||
/* Build the signal context to be used by sigreturn. */
|
||||
frame.sf_sc.uc_flags = 0; /* XXX ??? */
|
||||
|
|
|
|||
Loading…
Reference in a new issue