From owner-svn-src-user@FreeBSD.ORG Sun Feb 22 08:03:47 2015 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94A0C7CD; Sun, 22 Feb 2015 08:03:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DFBFC55; Sun, 22 Feb 2015 08:03:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1M83keo085689; Sun, 22 Feb 2015 08:03:46 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1M83iUv085675; Sun, 22 Feb 2015 08:03:44 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201502220803.t1M83iUv085675@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 22 Feb 2015 08:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r279148 - in user/dchagin/lemul/sys: amd64/amd64 amd64/ia32 arm/arm i386/i386 mips/mips powerpc/powerpc sparc64/sparc64 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2015 08:03:47 -0000 Author: dchagin Date: Sun Feb 22 08:03:44 2015 New Revision: 279148 URL: https://svnweb.freebsd.org/changeset/base/279148 Log: The kernel sends signals to the processes via ABI specific sv_sendsig method. Native ABI do not need signal conversion, only emulators may want this. Usually emulators implements its own sv_sendsig method. For now only ibcs2 emulator does not have own sv_sendsig implementation and depends on native sendsig() method. So, remove any extra attempts to convert signal numbers from native sendsig() methods except from i386 where ibsc2 is living. Modified: user/dchagin/lemul/sys/amd64/amd64/machdep.c user/dchagin/lemul/sys/amd64/ia32/ia32_signal.c user/dchagin/lemul/sys/arm/arm/machdep.c user/dchagin/lemul/sys/i386/i386/machdep.c user/dchagin/lemul/sys/mips/mips/freebsd32_machdep.c user/dchagin/lemul/sys/mips/mips/pm_machdep.c user/dchagin/lemul/sys/powerpc/powerpc/exec_machdep.c user/dchagin/lemul/sys/sparc64/sparc64/machdep.c Modified: user/dchagin/lemul/sys/amd64/amd64/machdep.c ============================================================================== --- user/dchagin/lemul/sys/amd64/amd64/machdep.c Sun Feb 22 07:20:04 2015 (r279147) +++ user/dchagin/lemul/sys/amd64/amd64/machdep.c Sun Feb 22 08:03:44 2015 (r279148) @@ -398,10 +398,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* Align to 16 bytes. */ sfp = (struct sigframe *)((unsigned long)sp & ~0xFul); - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - /* Build the argument list for the signal handler. */ regs->tf_rdi = sig; /* arg 1 in %rdi */ regs->tf_rdx = (register_t)&sfp->sf_uc; /* arg 3 in %rdx */ Modified: user/dchagin/lemul/sys/amd64/ia32/ia32_signal.c ============================================================================== --- user/dchagin/lemul/sys/amd64/ia32/ia32_signal.c Sun Feb 22 07:20:04 2015 (r279147) +++ user/dchagin/lemul/sys/amd64/ia32/ia32_signal.c Sun Feb 22 08:03:44 2015 (r279148) @@ -360,10 +360,6 @@ ia32_osendsig(sig_t catcher, ksiginfo_t } else fp = (struct ia32_sigframe3 *)regs->tf_rsp - 1; - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - /* Build the argument list for the signal handler. */ sf.sf_signum = sig; sf.sf_scp = (register_t)&fp->sf_siginfo.si_sc; @@ -498,10 +494,6 @@ freebsd4_ia32_sendsig(sig_t catcher, ksi sfp = (struct ia32_sigframe4 *)regs->tf_rsp - 1; PROC_UNLOCK(p); - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - /* Build the argument list for the signal handler. */ sf.sf_signum = sig; sf.sf_ucontext = (register_t)&sfp->sf_uc; @@ -643,10 +635,6 @@ ia32_sendsig(sig_t catcher, ksiginfo_t * sfp = (struct ia32_sigframe *)((uintptr_t)sp & ~0xF); PROC_UNLOCK(p); - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - /* Build the argument list for the signal handler. */ sf.sf_signum = sig; sf.sf_ucontext = (register_t)&sfp->sf_uc; Modified: user/dchagin/lemul/sys/arm/arm/machdep.c ============================================================================== --- user/dchagin/lemul/sys/arm/arm/machdep.c Sun Feb 22 07:20:04 2015 (r279147) +++ user/dchagin/lemul/sys/arm/arm/machdep.c Sun Feb 22 08:03:44 2015 (r279148) @@ -261,10 +261,6 @@ sendsig(catcher, ksi, mask) sigexit(td, SIGILL); } - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - /* * Build context to run handler in. We invoke the handler * directly, only returning via the trampoline. Note the Modified: user/dchagin/lemul/sys/i386/i386/machdep.c ============================================================================== --- user/dchagin/lemul/sys/i386/i386/machdep.c Sun Feb 22 07:20:04 2015 (r279147) +++ user/dchagin/lemul/sys/i386/i386/machdep.c Sun Feb 22 08:03:44 2015 (r279148) @@ -403,10 +403,6 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, } else fp = (struct osigframe *)regs->tf_esp - 1; - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - /* Build the argument list for the signal handler. */ sf.sf_signum = sig; sf.sf_scp = (register_t)&fp->sf_siginfo.si_sc; @@ -554,10 +550,6 @@ freebsd4_sendsig(sig_t catcher, ksiginfo } else sfp = (struct sigframe4 *)regs->tf_esp - 1; - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - /* Build the argument list for the signal handler. */ sf.sf_signum = sig; sf.sf_ucontext = (register_t)&sfp->sf_uc; Modified: user/dchagin/lemul/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- user/dchagin/lemul/sys/mips/mips/freebsd32_machdep.c Sun Feb 22 07:20:04 2015 (r279147) +++ user/dchagin/lemul/sys/mips/mips/freebsd32_machdep.c Sun Feb 22 08:03:44 2015 (r279148) @@ -419,12 +419,6 @@ freebsd32_sendsig(sig_t catcher, ksiginf sfp = (struct sigframe32 *)((vm_offset_t)(td->td_frame->sp - sizeof(struct sigframe32)) & ~(sizeof(__int64_t) - 1)); - /* Translate the signal if appropriate */ - if (p->p_sysent->sv_sigtbl) { - if (sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - } - /* Build the argument list for the signal handler. */ td->td_frame->a0 = sig; td->td_frame->a2 = (register_t)(intptr_t)&sfp->sf_uc; Modified: user/dchagin/lemul/sys/mips/mips/pm_machdep.c ============================================================================== --- user/dchagin/lemul/sys/mips/mips/pm_machdep.c Sun Feb 22 07:20:04 2015 (r279147) +++ user/dchagin/lemul/sys/mips/mips/pm_machdep.c Sun Feb 22 08:03:44 2015 (r279148) @@ -133,12 +133,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sfp = (struct sigframe *)((vm_offset_t)(regs->sp - sizeof(struct sigframe)) & ~(sizeof(__int64_t) - 1)); - /* Translate the signal if appropriate */ - if (p->p_sysent->sv_sigtbl) { - if (sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - } - /* Build the argument list for the signal handler. */ regs->a0 = sig; regs->a2 = (register_t)(intptr_t)&sfp->sf_uc; Modified: user/dchagin/lemul/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- user/dchagin/lemul/sys/powerpc/powerpc/exec_machdep.c Sun Feb 22 07:20:04 2015 (r279147) +++ user/dchagin/lemul/sys/powerpc/powerpc/exec_machdep.c Sun Feb 22 08:03:44 2015 (r279148) @@ -231,12 +231,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, } /* - * Translate the signal if appropriate (Linux emu ?) - */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - - /* * Save the floating-point state, if necessary, then copy it. */ /* XXX */ Modified: user/dchagin/lemul/sys/sparc64/sparc64/machdep.c ============================================================================== --- user/dchagin/lemul/sys/sparc64/sparc64/machdep.c Sun Feb 22 07:20:04 2015 (r279147) +++ user/dchagin/lemul/sys/sparc64/sparc64/machdep.c Sun Feb 22 08:03:44 2015 (r279148) @@ -654,10 +654,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, fp = (struct frame *)sfp - 1; - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - /* Build the argument list for the signal handler. */ tf->tf_out[0] = sig; tf->tf_out[2] = (register_t)&sfp->sf_uc;