Date: Fri, 17 Jun 2022 19:29:07 GMT From: Dmitry Chagin <dchagin@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 27c31bdac578 - stable/13 - linux(4): optimize ksiginfo to siginfo conversion. Message-ID: <202206171929.25HJT7T1096991@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=27c31bdac5781d884e99f470a8f8c84d6e3f546d commit 27c31bdac5781d884e99f470a8f8c84d6e3f546d Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2021-06-07 03:06:17 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2022-06-17 19:28:00 +0000 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 (cherry picked from commit f4e801085b055fd33f680dd7cb9f8562d236f39a) --- sys/amd64/linux/linux_sysvec.c | 2 +- sys/amd64/linux32/linux32_sysvec.c | 2 +- sys/compat/linux/linux_signal.c | 21 +++++++-------------- sys/compat/linux/linux_signal.h | 1 - sys/i386/linux/linux_sysvec.c | 2 +- 5 files changed, 10 insertions(+), 18 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 174292527e37..6ed694dc8af9 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -660,7 +660,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) { diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index d007f6ad7b77..cce0c8261a84 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -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. diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index 467d2810a228..8c41d724c0b9 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -403,8 +403,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); @@ -424,16 +424,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; @@ -547,13 +547,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) { diff --git a/sys/compat/linux/linux_signal.h b/sys/compat/linux/linux_signal.h index bb34613fa2be..f434ab1b1b35 100644 --- a/sys/compat/linux/linux_signal.h +++ b/sys/compat/linux/linux_signal.h @@ -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); diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index fbfafeee71cd..ed7223f3681a 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -426,7 +426,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 ??? */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202206171929.25HJT7T1096991>