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
This commit is contained in:
parent
af557e649c
commit
6e826d27c3
@ -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));
|
||||
|
@ -639,36 +639,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 &&
|
||||
@ -687,7 +687,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. */
|
||||
|
@ -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));
|
||||
|
@ -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);
|
||||
bsd_to_linux_sigset(mask, &frame.sf_uc.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);
|
||||
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) {
|
||||
/*
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
bsd_to_linux_sigset(mask, &frame.sf_uc.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);
|
||||
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) {
|
||||
/*
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user