Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jun 2022 19:40:36 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: c2704d378078 - stable/13 - linux(4): Better naming for ucontext field of struct rt_sigframe
Message-ID:  <202206171940.25HJeaUN026041@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=c2704d3780784037a37fb3a741604e6cdacf68ac

commit c2704d3780784037a37fb3a741604e6cdacf68ac
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2022-05-15 18:06:47 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-06-17 19:35:21 +0000

    linux(4): Better naming for ucontext field of struct rt_sigframe
    
    To reduce sendsig code difference and to avoid confusing me,
    rename sf_sc to sf_uc to match the content.
    
    MFC after:              2 weeks
    
    (cherry picked from commit 6e826d27c340fa29e166d06e5d8553f6c63c409e)
---
 sys/amd64/linux/linux_genassym.c     |  2 +-
 sys/amd64/linux/linux_sysvec.c       | 56 ++++++++++++++++++------------------
 sys/amd64/linux32/linux32_genassym.c |  2 +-
 sys/amd64/linux32/linux32_sysvec.c   | 54 +++++++++++++++++-----------------
 sys/i386/linux/linux_genassym.c      |  2 +-
 sys/i386/linux/linux_sysvec.c        | 54 +++++++++++++++++-----------------
 sys/x86/linux/linux_x86_sigframe.h   |  4 +--
 7 files changed, 87 insertions(+), 87 deletions(-)

diff --git a/sys/amd64/linux/linux_genassym.c b/sys/amd64/linux/linux_genassym.c
index a468520431dc..a9658b006be8 100644
--- a/sys/amd64/linux/linux_genassym.c
+++ b/sys/amd64/linux/linux_genassym.c
@@ -10,7 +10,7 @@ __FBSDID("$FreeBSD$");
 
 #include <x86/linux/linux_x86_sigframe.h>
 
-ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_sc));
+ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_uc));
 ASSYM(LINUX_RT_SIGF_SC, offsetof(struct l_ucontext, uc_mcontext));
 ASSYM(LINUX_VERSION_CODE, LINUX_VERSION_CODE);
 ASSYM(LINUX_SC_RSP, offsetof(struct l_sigcontext, sc_rsp));
diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c
index ea9cb74dab0d..0545f334b1b5 100644
--- a/sys/amd64/linux/linux_sysvec.c
+++ b/sys/amd64/linux/linux_sysvec.c
@@ -638,36 +638,36 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
 
 	/* Save user context. */
 	bzero(&sf, sizeof(sf));
-	bsd_to_linux_sigset(mask, &sf.sf_sc.uc_sigmask);
-	bsd_to_linux_sigset(mask, &sf.sf_sc.uc_mcontext.sc_mask);
+	bsd_to_linux_sigset(mask, &sf.sf_uc.uc_sigmask);
+	bsd_to_linux_sigset(mask, &sf.sf_uc.uc_mcontext.sc_mask);
 
-	sf.sf_sc.uc_stack.ss_sp = PTROUT(td->td_sigstk.ss_sp);
-	sf.sf_sc.uc_stack.ss_size = td->td_sigstk.ss_size;
-	sf.sf_sc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK)
+	sf.sf_uc.uc_stack.ss_sp = PTROUT(td->td_sigstk.ss_sp);
+	sf.sf_uc.uc_stack.ss_size = td->td_sigstk.ss_size;
+	sf.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK)
 	    ? ((oonstack) ? LINUX_SS_ONSTACK : 0) : LINUX_SS_DISABLE;
 
-	sf.sf_sc.uc_mcontext.sc_rdi    = regs->tf_rdi;
-	sf.sf_sc.uc_mcontext.sc_rsi    = regs->tf_rsi;
-	sf.sf_sc.uc_mcontext.sc_rdx    = regs->tf_rdx;
-	sf.sf_sc.uc_mcontext.sc_rbp    = regs->tf_rbp;
-	sf.sf_sc.uc_mcontext.sc_rbx    = regs->tf_rbx;
-	sf.sf_sc.uc_mcontext.sc_rcx    = regs->tf_rcx;
-	sf.sf_sc.uc_mcontext.sc_rax    = regs->tf_rax;
-	sf.sf_sc.uc_mcontext.sc_rip    = regs->tf_rip;
-	sf.sf_sc.uc_mcontext.sc_rsp    = regs->tf_rsp;
-	sf.sf_sc.uc_mcontext.sc_r8     = regs->tf_r8;
-	sf.sf_sc.uc_mcontext.sc_r9     = regs->tf_r9;
-	sf.sf_sc.uc_mcontext.sc_r10    = regs->tf_r10;
-	sf.sf_sc.uc_mcontext.sc_r11    = regs->tf_r11;
-	sf.sf_sc.uc_mcontext.sc_r12    = regs->tf_r12;
-	sf.sf_sc.uc_mcontext.sc_r13    = regs->tf_r13;
-	sf.sf_sc.uc_mcontext.sc_r14    = regs->tf_r14;
-	sf.sf_sc.uc_mcontext.sc_r15    = regs->tf_r15;
-	sf.sf_sc.uc_mcontext.sc_cs     = regs->tf_cs;
-	sf.sf_sc.uc_mcontext.sc_rflags = regs->tf_rflags;
-	sf.sf_sc.uc_mcontext.sc_err    = regs->tf_err;
-	sf.sf_sc.uc_mcontext.sc_trapno = bsd_to_linux_trapcode(code);
-	sf.sf_sc.uc_mcontext.sc_cr2    = (register_t)ksi->ksi_addr;
+	sf.sf_uc.uc_mcontext.sc_rdi    = regs->tf_rdi;
+	sf.sf_uc.uc_mcontext.sc_rsi    = regs->tf_rsi;
+	sf.sf_uc.uc_mcontext.sc_rdx    = regs->tf_rdx;
+	sf.sf_uc.uc_mcontext.sc_rbp    = regs->tf_rbp;
+	sf.sf_uc.uc_mcontext.sc_rbx    = regs->tf_rbx;
+	sf.sf_uc.uc_mcontext.sc_rcx    = regs->tf_rcx;
+	sf.sf_uc.uc_mcontext.sc_rax    = regs->tf_rax;
+	sf.sf_uc.uc_mcontext.sc_rip    = regs->tf_rip;
+	sf.sf_uc.uc_mcontext.sc_rsp    = regs->tf_rsp;
+	sf.sf_uc.uc_mcontext.sc_r8     = regs->tf_r8;
+	sf.sf_uc.uc_mcontext.sc_r9     = regs->tf_r9;
+	sf.sf_uc.uc_mcontext.sc_r10    = regs->tf_r10;
+	sf.sf_uc.uc_mcontext.sc_r11    = regs->tf_r11;
+	sf.sf_uc.uc_mcontext.sc_r12    = regs->tf_r12;
+	sf.sf_uc.uc_mcontext.sc_r13    = regs->tf_r13;
+	sf.sf_uc.uc_mcontext.sc_r14    = regs->tf_r14;
+	sf.sf_uc.uc_mcontext.sc_r15    = regs->tf_r15;
+	sf.sf_uc.uc_mcontext.sc_cs     = regs->tf_cs;
+	sf.sf_uc.uc_mcontext.sc_rflags = regs->tf_rflags;
+	sf.sf_uc.uc_mcontext.sc_err    = regs->tf_err;
+	sf.sf_uc.uc_mcontext.sc_trapno = bsd_to_linux_trapcode(code);
+	sf.sf_uc.uc_mcontext.sc_cr2    = (register_t)ksi->ksi_addr;
 
 	/* Allocate space for the signal handler context. */
 	if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack &&
@@ -686,7 +686,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
 	regs->tf_rdi = sig;			/* arg 1 in %rdi */
 	regs->tf_rax = 0;
 	regs->tf_rsi = (register_t)&sfp->sf_si;	/* arg 2 in %rsi */
-	regs->tf_rdx = (register_t)&sfp->sf_sc;	/* arg 3 in %rdx */
+	regs->tf_rdx = (register_t)&sfp->sf_uc;	/* arg 3 in %rdx */
 	regs->tf_rcx = (register_t)catcher;
 
 	/* Fill in POSIX parts. */
diff --git a/sys/amd64/linux32/linux32_genassym.c b/sys/amd64/linux32/linux32_genassym.c
index 2bc2586ebe4a..1465863dd08c 100644
--- a/sys/amd64/linux32/linux32_genassym.c
+++ b/sys/amd64/linux32/linux32_genassym.c
@@ -12,7 +12,7 @@ __FBSDID("$FreeBSD$");
 #include <x86/linux/linux_x86_sigframe.h>
 
 ASSYM(LINUX_SIGF_SC, offsetof(struct l_sigframe, sf_sc));
-ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_sc));
+ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_uc));
 ASSYM(LINUX_RT_SIGF_SC, offsetof(struct l_ucontext, uc_mcontext));
 ASSYM(LINUX_VERSION_CODE, LINUX_VERSION_CODE);
 ASSYM(LINUX_SC_ESP, offsetof(struct l_sigcontext, sc_esp));
diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c
index 5f9922aaf708..f86ca13e1a1b 100644
--- a/sys/amd64/linux32/linux32_sysvec.c
+++ b/sys/amd64/linux32/linux32_sysvec.c
@@ -318,7 +318,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
 
 	frame.sf_sig = sig;
 	frame.sf_siginfo = PTROUT(&fp->sf_si);
-	frame.sf_ucontext = PTROUT(&fp->sf_sc);
+	frame.sf_ucontext = PTROUT(&fp->sf_uc);
 
 	/* Fill in POSIX parts. */
 	siginfo_to_lsiginfo(&ksi->ksi_info, &frame.sf_si, sig);
@@ -326,35 +326,35 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
 	/*
 	 * Build the signal context to be used by sigreturn and libgcc unwind.
 	 */
-	frame.sf_sc.uc_stack.ss_sp = PTROUT(td->td_sigstk.ss_sp);
-	frame.sf_sc.uc_stack.ss_size = td->td_sigstk.ss_size;
-	frame.sf_sc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK)
+	frame.sf_uc.uc_stack.ss_sp = PTROUT(td->td_sigstk.ss_sp);
+	frame.sf_uc.uc_stack.ss_size = td->td_sigstk.ss_size;
+	frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK)
 	    ? ((oonstack) ? LINUX_SS_ONSTACK : 0) : LINUX_SS_DISABLE;
 	PROC_UNLOCK(p);
 
-	bsd_to_linux_sigset(mask, &frame.sf_sc.uc_sigmask);
-
-	frame.sf_sc.uc_mcontext.sc_mask   = frame.sf_sc.uc_sigmask.__mask;
-	frame.sf_sc.uc_mcontext.sc_edi    = regs->tf_rdi;
-	frame.sf_sc.uc_mcontext.sc_esi    = regs->tf_rsi;
-	frame.sf_sc.uc_mcontext.sc_ebp    = regs->tf_rbp;
-	frame.sf_sc.uc_mcontext.sc_ebx    = regs->tf_rbx;
-	frame.sf_sc.uc_mcontext.sc_esp    = regs->tf_rsp;
-	frame.sf_sc.uc_mcontext.sc_edx    = regs->tf_rdx;
-	frame.sf_sc.uc_mcontext.sc_ecx    = regs->tf_rcx;
-	frame.sf_sc.uc_mcontext.sc_eax    = regs->tf_rax;
-	frame.sf_sc.uc_mcontext.sc_eip    = regs->tf_rip;
-	frame.sf_sc.uc_mcontext.sc_cs     = regs->tf_cs;
-	frame.sf_sc.uc_mcontext.sc_gs     = regs->tf_gs;
-	frame.sf_sc.uc_mcontext.sc_fs     = regs->tf_fs;
-	frame.sf_sc.uc_mcontext.sc_es     = regs->tf_es;
-	frame.sf_sc.uc_mcontext.sc_ds     = regs->tf_ds;
-	frame.sf_sc.uc_mcontext.sc_eflags = regs->tf_rflags;
-	frame.sf_sc.uc_mcontext.sc_esp_at_signal = regs->tf_rsp;
-	frame.sf_sc.uc_mcontext.sc_ss     = regs->tf_ss;
-	frame.sf_sc.uc_mcontext.sc_err    = regs->tf_err;
-	frame.sf_sc.uc_mcontext.sc_cr2    = (u_int32_t)(uintptr_t)ksi->ksi_addr;
-	frame.sf_sc.uc_mcontext.sc_trapno = bsd_to_linux_trapcode(code);
+	bsd_to_linux_sigset(mask, &frame.sf_uc.uc_sigmask);
+
+	frame.sf_uc.uc_mcontext.sc_mask   = frame.sf_uc.uc_sigmask.__mask;
+	frame.sf_uc.uc_mcontext.sc_edi    = regs->tf_rdi;
+	frame.sf_uc.uc_mcontext.sc_esi    = regs->tf_rsi;
+	frame.sf_uc.uc_mcontext.sc_ebp    = regs->tf_rbp;
+	frame.sf_uc.uc_mcontext.sc_ebx    = regs->tf_rbx;
+	frame.sf_uc.uc_mcontext.sc_esp    = regs->tf_rsp;
+	frame.sf_uc.uc_mcontext.sc_edx    = regs->tf_rdx;
+	frame.sf_uc.uc_mcontext.sc_ecx    = regs->tf_rcx;
+	frame.sf_uc.uc_mcontext.sc_eax    = regs->tf_rax;
+	frame.sf_uc.uc_mcontext.sc_eip    = regs->tf_rip;
+	frame.sf_uc.uc_mcontext.sc_cs     = regs->tf_cs;
+	frame.sf_uc.uc_mcontext.sc_gs     = regs->tf_gs;
+	frame.sf_uc.uc_mcontext.sc_fs     = regs->tf_fs;
+	frame.sf_uc.uc_mcontext.sc_es     = regs->tf_es;
+	frame.sf_uc.uc_mcontext.sc_ds     = regs->tf_ds;
+	frame.sf_uc.uc_mcontext.sc_eflags = regs->tf_rflags;
+	frame.sf_uc.uc_mcontext.sc_esp_at_signal = regs->tf_rsp;
+	frame.sf_uc.uc_mcontext.sc_ss     = regs->tf_ss;
+	frame.sf_uc.uc_mcontext.sc_err    = regs->tf_err;
+	frame.sf_uc.uc_mcontext.sc_cr2    = (u_int32_t)(uintptr_t)ksi->ksi_addr;
+	frame.sf_uc.uc_mcontext.sc_trapno = bsd_to_linux_trapcode(code);
 
 	if (copyout(&frame, fp, sizeof(frame)) != 0) {
 		/*
diff --git a/sys/i386/linux/linux_genassym.c b/sys/i386/linux/linux_genassym.c
index 1491ce586b09..65757a51a190 100644
--- a/sys/i386/linux/linux_genassym.c
+++ b/sys/i386/linux/linux_genassym.c
@@ -13,7 +13,7 @@ __FBSDID("$FreeBSD$");
 ASSYM(LINUX_SIGF_SC, offsetof(struct l_sigframe, sf_sc));
 ASSYM(LINUX_SC_GS, offsetof(struct l_sigcontext, sc_gs));
 ASSYM(LINUX_SC_EFLAGS, offsetof(struct l_sigcontext, sc_eflags));
-ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_sc));
+ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_uc));
 ASSYM(LINUX_RT_SIGF_SC, offsetof(struct l_ucontext, uc_mcontext));
 ASSYM(LINUX_SC_ESP, offsetof(struct l_sigcontext, sc_esp));
 ASSYM(LINUX_VERSION_CODE, LINUX_VERSION_CODE);
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index c747748e87b5..85625f8fdb89 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -426,41 +426,41 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
 
 	frame.sf_sig = sig;
 	frame.sf_siginfo = PTROUT(&fp->sf_si);
-	frame.sf_ucontext = PTROUT(&fp->sf_sc);
+	frame.sf_ucontext = PTROUT(&fp->sf_uc);
 
 	/* Fill in POSIX parts. */
 	siginfo_to_lsiginfo(&ksi->ksi_info, &frame.sf_si, sig);
 
 	/* Build the signal context to be used by sigreturn. */
-	frame.sf_sc.uc_stack.ss_sp = PTROUT(td->td_sigstk.ss_sp);
-	frame.sf_sc.uc_stack.ss_size = td->td_sigstk.ss_size;
-	frame.sf_sc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK)
+	frame.sf_uc.uc_stack.ss_sp = PTROUT(td->td_sigstk.ss_sp);
+	frame.sf_uc.uc_stack.ss_size = td->td_sigstk.ss_size;
+	frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK)
 	    ? ((oonstack) ? LINUX_SS_ONSTACK : 0) : LINUX_SS_DISABLE;
 	PROC_UNLOCK(p);
 
-	bsd_to_linux_sigset(mask, &frame.sf_sc.uc_sigmask);
-
-	frame.sf_sc.uc_mcontext.sc_mask   = frame.sf_sc.uc_sigmask.__mask;
-	frame.sf_sc.uc_mcontext.sc_gs     = rgs();
-	frame.sf_sc.uc_mcontext.sc_fs     = regs->tf_fs;
-	frame.sf_sc.uc_mcontext.sc_es     = regs->tf_es;
-	frame.sf_sc.uc_mcontext.sc_ds     = regs->tf_ds;
-	frame.sf_sc.uc_mcontext.sc_edi    = regs->tf_edi;
-	frame.sf_sc.uc_mcontext.sc_esi    = regs->tf_esi;
-	frame.sf_sc.uc_mcontext.sc_ebp    = regs->tf_ebp;
-	frame.sf_sc.uc_mcontext.sc_ebx    = regs->tf_ebx;
-	frame.sf_sc.uc_mcontext.sc_esp    = regs->tf_esp;
-	frame.sf_sc.uc_mcontext.sc_edx    = regs->tf_edx;
-	frame.sf_sc.uc_mcontext.sc_ecx    = regs->tf_ecx;
-	frame.sf_sc.uc_mcontext.sc_eax    = regs->tf_eax;
-	frame.sf_sc.uc_mcontext.sc_eip    = regs->tf_eip;
-	frame.sf_sc.uc_mcontext.sc_cs     = regs->tf_cs;
-	frame.sf_sc.uc_mcontext.sc_eflags = regs->tf_eflags;
-	frame.sf_sc.uc_mcontext.sc_esp_at_signal = regs->tf_esp;
-	frame.sf_sc.uc_mcontext.sc_ss     = regs->tf_ss;
-	frame.sf_sc.uc_mcontext.sc_err    = regs->tf_err;
-	frame.sf_sc.uc_mcontext.sc_cr2    = (register_t)ksi->ksi_addr;
-	frame.sf_sc.uc_mcontext.sc_trapno = bsd_to_linux_trapcode(code);
+	bsd_to_linux_sigset(mask, &frame.sf_uc.uc_sigmask);
+
+	frame.sf_uc.uc_mcontext.sc_mask   = frame.sf_uc.uc_sigmask.__mask;
+	frame.sf_uc.uc_mcontext.sc_gs     = rgs();
+	frame.sf_uc.uc_mcontext.sc_fs     = regs->tf_fs;
+	frame.sf_uc.uc_mcontext.sc_es     = regs->tf_es;
+	frame.sf_uc.uc_mcontext.sc_ds     = regs->tf_ds;
+	frame.sf_uc.uc_mcontext.sc_edi    = regs->tf_edi;
+	frame.sf_uc.uc_mcontext.sc_esi    = regs->tf_esi;
+	frame.sf_uc.uc_mcontext.sc_ebp    = regs->tf_ebp;
+	frame.sf_uc.uc_mcontext.sc_ebx    = regs->tf_ebx;
+	frame.sf_uc.uc_mcontext.sc_esp    = regs->tf_esp;
+	frame.sf_uc.uc_mcontext.sc_edx    = regs->tf_edx;
+	frame.sf_uc.uc_mcontext.sc_ecx    = regs->tf_ecx;
+	frame.sf_uc.uc_mcontext.sc_eax    = regs->tf_eax;
+	frame.sf_uc.uc_mcontext.sc_eip    = regs->tf_eip;
+	frame.sf_uc.uc_mcontext.sc_cs     = regs->tf_cs;
+	frame.sf_uc.uc_mcontext.sc_eflags = regs->tf_eflags;
+	frame.sf_uc.uc_mcontext.sc_esp_at_signal = regs->tf_esp;
+	frame.sf_uc.uc_mcontext.sc_ss     = regs->tf_ss;
+	frame.sf_uc.uc_mcontext.sc_err    = regs->tf_err;
+	frame.sf_uc.uc_mcontext.sc_cr2    = (register_t)ksi->ksi_addr;
+	frame.sf_uc.uc_mcontext.sc_trapno = bsd_to_linux_trapcode(code);
 
 	if (copyout(&frame, fp, sizeof(frame)) != 0) {
 		/*
diff --git a/sys/x86/linux/linux_x86_sigframe.h b/sys/x86/linux/linux_x86_sigframe.h
index 13294740eb39..56ff346ea5b7 100644
--- a/sys/x86/linux/linux_x86_sigframe.h
+++ b/sys/x86/linux/linux_x86_sigframe.h
@@ -124,7 +124,7 @@ struct l_rt_sigframe {
 	l_uintptr_t		sf_siginfo;
 	l_uintptr_t		sf_ucontext;
 	l_siginfo_t		sf_si;
-	struct l_ucontext	sf_sc;
+	struct l_ucontext	sf_uc;
 };
 
 #else
@@ -187,7 +187,7 @@ struct l_ucontext {
  * handler, but use the BSD way of calling the handler and sigreturn().
  */
 struct l_rt_sigframe {
-	struct l_ucontext	sf_sc;
+	struct l_ucontext	sf_uc;
 	struct l_siginfo	sf_si;
 };
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202206171940.25HJeaUN026041>