From 8e1ebd868f23ca8d8419b38b4724308fc209fff0 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 13 Mar 2017 01:58:39 +0000 Subject: [PATCH] ia64, mips, x86_64: remove no longer used parsers of sigreturn syscalls As there is no sigreturn syscall on ia64, mips n32, mips n64, x32, and x86_64, no longer used parsers could be safely removed. * linux/ia64/arch_sigreturn.c: Remove. * Makefile.am (EXTRA_DIST): Remove it. * linux/mips/arch_sigreturn.c (arch_sigreturn): Remove [!LINUX_MIPSO32]. * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Remove. --- Makefile.am | 1 - linux/ia64/arch_sigreturn.c | 12 ------------ linux/mips/arch_sigreturn.c | 15 +++------------ linux/x86_64/arch_sigreturn.c | 32 +------------------------------- 4 files changed, 4 insertions(+), 56 deletions(-) delete mode 100644 linux/ia64/arch_sigreturn.c diff --git a/Makefile.am b/Makefile.am index 61aa7ea0..c77f463f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -462,7 +462,6 @@ EXTRA_DIST = \ linux/ia64/arch_regs.c \ linux/ia64/arch_regs.h \ linux/ia64/arch_rt_sigframe.c \ - linux/ia64/arch_sigreturn.c \ linux/ia64/get_error.c \ linux/ia64/get_scno.c \ linux/ia64/get_syscall_args.c \ diff --git a/linux/ia64/arch_sigreturn.c b/linux/ia64/arch_sigreturn.c deleted file mode 100644 index 32f9bc58..00000000 --- a/linux/ia64/arch_sigreturn.c +++ /dev/null @@ -1,12 +0,0 @@ -static void -arch_sigreturn(struct tcb *tcp) -{ - /* offsetof(struct sigframe, sc) */ -#define OFFSETOF_STRUCT_SIGFRAME_SC 0xA0 - const unsigned long addr = *ia64_frame_ptr + 16 + - OFFSETOF_STRUCT_SIGFRAME_SC + - offsetof(struct sigcontext, sc_mask); - tprints("{mask="); - print_sigset_addr(tcp, addr); - tprints("}"); -} diff --git a/linux/mips/arch_sigreturn.c b/linux/mips/arch_sigreturn.c index 8ce46096..522b7315 100644 --- a/linux/mips/arch_sigreturn.c +++ b/linux/mips/arch_sigreturn.c @@ -1,26 +1,17 @@ static void arch_sigreturn(struct tcb *tcp) { -#if defined LINUX_MIPSO32 + /* 64-bit ABIs do not have old sigreturn. */ +#ifdef LINUX_MIPSO32 /* * offsetof(struct sigframe, sf_mask) == * sizeof(sf_ass) + sizeof(sf_pad) + sizeof(struct sigcontext) */ const kernel_ulong_t addr = mips_REG_SP + 6 * 4 + sizeof(struct sigcontext); -#else - /* - * This decodes rt_sigreturn. - * The 64-bit ABIs do not have sigreturn. - * - * offsetof(struct rt_sigframe, rs_uc) == - * sizeof(sf_ass) + sizeof(sf_pad) + sizeof(struct siginfo) - */ - const kernel_ulong_t addr = mips_REG_SP + 6 * 4 + 128 + - offsetof(struct ucontext, uc_sigmask); -#endif tprints("{mask="); print_sigset_addr(tcp, addr); tprints("}"); +#endif } diff --git a/linux/x86_64/arch_sigreturn.c b/linux/x86_64/arch_sigreturn.c index 16cadc2c..9f4f0d87 100644 --- a/linux/x86_64/arch_sigreturn.c +++ b/linux/x86_64/arch_sigreturn.c @@ -1,32 +1,2 @@ -#define arch_sigreturn i386_arch_sigreturn +/* Only x86 personality has old sigreturn syscall. */ #include "i386/arch_sigreturn.c" -#undef arch_sigreturn - -static void -arch_sigreturn(struct tcb *tcp) -{ - if (current_personality == 1) { - i386_arch_sigreturn(tcp); - return; - } - - typedef struct { - uint32_t flags, link, stack[3], pad; - struct sigcontext mcontext; - } ucontext_x32_header; - -#define X86_64_SIGMASK_OFFSET offsetof(struct ucontext, uc_sigmask) -#define X32_SIGMASK_OFFSET sizeof(ucontext_x32_header) - - const kernel_ulong_t offset = -#ifdef X32 - X32_SIGMASK_OFFSET; -#else - current_personality == 2 ? X32_SIGMASK_OFFSET : - X86_64_SIGMASK_OFFSET; -#endif - const kernel_ulong_t addr = (kernel_ulong_t) *x86_64_rsp_ptr + offset; - tprints("{mask="); - print_sigset_addr(tcp, addr); - tprints("}"); -} -- 2.50.1