Author: trasz
Date: Fri Apr 12 14:18:16 2019
New Revision: 346151
URL: https://svnweb.freebsd.org/changeset/base/346151

Log:
  Remove unneeded conditionals for sv_ functions - all the ABIs
  (apart from null_sysvec) define them, so the 'else' branch is
  never taken.
  
  Reviewed by:  kib
  MFC after:    2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:        https://reviews.freebsd.org/D19889

Modified:
  head/sys/kern/kern_exec.c

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c   Fri Apr 12 12:46:25 2019        (r346150)
+++ head/sys/kern/kern_exec.c   Fri Apr 12 14:18:16 2019        (r346151)
@@ -679,23 +679,14 @@ interpret:
                sys_cap_enter(td, NULL);
 
        /*
-        * Copy out strings (args and env) and initialize stack base
+        * Copy out strings (args and env) and initialize stack base.
         */
-       if (p->p_sysent->sv_copyout_strings)
-               stack_base = (*p->p_sysent->sv_copyout_strings)(imgp);
-       else
-               stack_base = exec_copyout_strings(imgp);
+       stack_base = (*p->p_sysent->sv_copyout_strings)(imgp);
 
        /*
-        * If custom stack fixup routine present for this process
-        * let it do the stack setup.
-        * Else stuff argument count as first item on stack
+        * Stack setup.
         */
-       if (p->p_sysent->sv_fixup != NULL)
-               error = (*p->p_sysent->sv_fixup)(&stack_base, imgp);
-       else
-               error = suword(--stack_base, imgp->args->argc) == 0 ?
-                   0 : EFAULT;
+       error = (*p->p_sysent->sv_fixup)(&stack_base, imgp);
        if (error != 0) {
                vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
                goto exec_fail_dealloc;
@@ -880,11 +871,7 @@ interpret:
 #endif
 
        /* Set values passed into the program in registers. */
-       if (p->p_sysent->sv_setregs)
-               (*p->p_sysent->sv_setregs)(td, imgp, 
-                   (u_long)(uintptr_t)stack_base);
-       else
-               exec_setregs(td, imgp, (u_long)(uintptr_t)stack_base);
+       (*p->p_sysent->sv_setregs)(td, imgp, (u_long)(uintptr_t)stack_base);
 
        vfs_mark_atime(imgp->vp, td->td_ucred);
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to