bfin: switch to generic vfork, get rid of pointless wrappers
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 14 Nov 2012 04:47:37 +0000 (23:47 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 29 Nov 2012 04:43:41 +0000 (23:43 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/blackfin/include/asm/unistd.h
arch/blackfin/kernel/entry.S
arch/blackfin/kernel/process.c
arch/blackfin/kernel/signal.c
arch/blackfin/mach-common/entry.S

index b4ec1bb3d5d461539704a88eff322b001e9260a1..460514a1a4e1e4235b19fddce5911cc93c321411 100644 (file)
 #define __ARCH_WANT_SYS_RT_SIGACTION
 #define __ARCH_WANT_SYS_RT_SIGSUSPEND
 #define __ARCH_WANT_SYS_EXECVE
+#define __ARCH_WANT_SYS_VFORK
 
 /*
  * "Conditional" syscalls
index 78f4f637e155a50afec8b3134522ce0844f13cee..4071265fc4fe807ee4b572ead9b0136dc01d89c4 100644 (file)
@@ -57,36 +57,3 @@ ENTRY(_ret_from_fork)
        RESTORE_CONTEXT
        rti;
 ENDPROC(_ret_from_fork)
-
-ENTRY(_sys_vfork)
-       r0 = sp;
-       r0 += 24;
-       [--sp] = rets;
-       SP += -12;
-       pseudo_long_call _bfin_vfork, p2;
-       SP += 12;
-       rets = [sp++];
-       rts;
-ENDPROC(_sys_vfork)
-
-ENTRY(_sys_clone)
-       r0 = sp;
-       r0 += 24;
-       [--sp] = rets;
-       SP += -12;
-       pseudo_long_call _bfin_clone, p2;
-       SP += 12;
-       rets = [sp++];
-       rts;
-ENDPROC(_sys_clone)
-
-ENTRY(_sys_rt_sigreturn)
-       r0 = sp;
-       r0 += 24;
-       [--sp] = rets;
-       SP += -12;
-       pseudo_long_call _do_rt_sigreturn, p2;
-       SP += 12;
-       rets = [sp++];
-       rts;
-ENDPROC(_sys_rt_sigreturn)
index da8df0e504ac6ef4e6529f7d128437724d6572af..e5ae8fcab4386adcab79a9c80842bb72e2b71204 100644 (file)
@@ -127,28 +127,13 @@ void flush_thread(void)
 {
 }
 
-asmlinkage int bfin_vfork(struct pt_regs *regs)
+asmlinkage int bfin_clone(unsigned long clone_flags, unsigned long newsp)
 {
-       return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(), regs, 0, NULL,
-                      NULL);
-}
-
-asmlinkage int bfin_clone(struct pt_regs *regs)
-{
-       unsigned long clone_flags;
-       unsigned long newsp;
-
 #ifdef __ARCH_SYNC_CORE_DCACHE
        if (current->nr_cpus_allowed == num_possible_cpus())
                set_cpus_allowed_ptr(current, cpumask_of(smp_processor_id()));
 #endif
-
-       /* syscall2 puts clone_flags in r0 and usp in r1 */
-       clone_flags = regs->r0;
-       newsp = regs->r1;
-       if (!newsp)
-               newsp = rdusp();
-       else
+       if (newsp)
                newsp -= 12;
        return do_fork(clone_flags, newsp, regs, 0, NULL, NULL);
 }
@@ -174,7 +159,7 @@ copy_thread(unsigned long clone_flags,
        } else {
                *childregs = *regs;
                childregs->r0 = 0;
-               p->thread.usp = usp;
+               p->thread.usp = usp ? : rdusp();
                v[0] = v[1] = 0;
        }
 
index 6ed20a1a4af9619951e560f2de692b15b6f850ba..84b4be05840ccc4b971a51637bb4a19e9cb0d5e8 100644 (file)
@@ -82,9 +82,9 @@ rt_restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *p
        return err;
 }
 
-asmlinkage int do_rt_sigreturn(unsigned long __unused)
+asmlinkage int sys_rt_sigreturn(void)
 {
-       struct pt_regs *regs = (struct pt_regs *)__unused;
+       struct pt_regs *regs = current_pt_regs();
        unsigned long usp = rdusp();
        struct rt_sigframe *frame = (struct rt_sigframe *)(usp);
        sigset_t set;
index 4a38c68e2ddee43486160a505a97f28c6dee5d44..86b5a095c5a1c93c2ffc820993a4c6ca576728b4 100644 (file)
@@ -1431,7 +1431,7 @@ ENTRY(_sys_call_table)
        .long _sys_ni_syscall   /* old sys_ipc */
        .long _sys_fsync
        .long _sys_ni_syscall   /* old sys_sigreturn */
-       .long _sys_clone                /* 120 */
+       .long _bfin_clone               /* 120 */
        .long _sys_setdomainname
        .long _sys_newuname
        .long _sys_ni_syscall   /* old sys_modify_ldt */