Author: dchagin
Date: Sun May 24 17:56:02 2015
New Revision: 283479
URL: https://svnweb.freebsd.org/changeset/base/283479

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:
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/ia32/ia32_signal.c
  head/sys/arm/arm/machdep.c
  head/sys/i386/i386/machdep.c
  head/sys/mips/mips/freebsd32_machdep.c
  head/sys/mips/mips/pm_machdep.c
  head/sys/powerpc/powerpc/exec_machdep.c
  head/sys/sparc64/sparc64/machdep.c

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c      Sun May 24 17:53:48 2015        
(r283478)
+++ head/sys/amd64/amd64/machdep.c      Sun May 24 17:56:02 2015        
(r283479)
@@ -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: head/sys/amd64/ia32/ia32_signal.c
==============================================================================
--- head/sys/amd64/ia32/ia32_signal.c   Sun May 24 17:53:48 2015        
(r283478)
+++ head/sys/amd64/ia32/ia32_signal.c   Sun May 24 17:56:02 2015        
(r283479)
@@ -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: head/sys/arm/arm/machdep.c
==============================================================================
--- head/sys/arm/arm/machdep.c  Sun May 24 17:53:48 2015        (r283478)
+++ head/sys/arm/arm/machdep.c  Sun May 24 17:56:02 2015        (r283479)
@@ -320,10 +320,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: head/sys/i386/i386/machdep.c
==============================================================================
--- head/sys/i386/i386/machdep.c        Sun May 24 17:53:48 2015        
(r283478)
+++ head/sys/i386/i386/machdep.c        Sun May 24 17:56:02 2015        
(r283479)
@@ -383,10 +383,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;
@@ -534,10 +530,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: head/sys/mips/mips/freebsd32_machdep.c
==============================================================================
--- head/sys/mips/mips/freebsd32_machdep.c      Sun May 24 17:53:48 2015        
(r283478)
+++ head/sys/mips/mips/freebsd32_machdep.c      Sun May 24 17:56:02 2015        
(r283479)
@@ -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: head/sys/mips/mips/pm_machdep.c
==============================================================================
--- head/sys/mips/mips/pm_machdep.c     Sun May 24 17:53:48 2015        
(r283478)
+++ head/sys/mips/mips/pm_machdep.c     Sun May 24 17:56:02 2015        
(r283479)
@@ -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: head/sys/powerpc/powerpc/exec_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/exec_machdep.c     Sun May 24 17:53:48 2015        
(r283478)
+++ head/sys/powerpc/powerpc/exec_machdep.c     Sun May 24 17:56:02 2015        
(r283479)
@@ -226,12 +226,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: head/sys/sparc64/sparc64/machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/machdep.c  Sun May 24 17:53:48 2015        
(r283478)
+++ head/sys/sparc64/sparc64/machdep.c  Sun May 24 17:56:02 2015        
(r283479)
@@ -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;
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to