aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-11-13 23:47:37 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-11-28 23:43:41 -0500
commit135c37b83c81b79a888108e3f7c5f64423d8a851 (patch)
treef7d0b5f796ce3f9421abdea1230d591f5ae6e470 /arch
parent3e41f9ba611cf8b87a20eecc54572b348b48bd91 (diff)
bfin: switch to generic vfork, get rid of pointless wrappers
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/blackfin/include/asm/unistd.h1
-rw-r--r--arch/blackfin/kernel/entry.S33
-rw-r--r--arch/blackfin/kernel/process.c21
-rw-r--r--arch/blackfin/kernel/signal.c4
-rw-r--r--arch/blackfin/mach-common/entry.S2
5 files changed, 7 insertions, 54 deletions
diff --git a/arch/blackfin/include/asm/unistd.h b/arch/blackfin/include/asm/unistd.h
index b4ec1bb3d5d4..460514a1a4e1 100644
--- a/arch/blackfin/include/asm/unistd.h
+++ b/arch/blackfin/include/asm/unistd.h
@@ -447,6 +447,7 @@
447#define __ARCH_WANT_SYS_RT_SIGACTION 447#define __ARCH_WANT_SYS_RT_SIGACTION
448#define __ARCH_WANT_SYS_RT_SIGSUSPEND 448#define __ARCH_WANT_SYS_RT_SIGSUSPEND
449#define __ARCH_WANT_SYS_EXECVE 449#define __ARCH_WANT_SYS_EXECVE
450#define __ARCH_WANT_SYS_VFORK
450 451
451/* 452/*
452 * "Conditional" syscalls 453 * "Conditional" syscalls
diff --git a/arch/blackfin/kernel/entry.S b/arch/blackfin/kernel/entry.S
index 78f4f637e155..4071265fc4fe 100644
--- a/arch/blackfin/kernel/entry.S
+++ b/arch/blackfin/kernel/entry.S
@@ -57,36 +57,3 @@ ENTRY(_ret_from_fork)
57 RESTORE_CONTEXT 57 RESTORE_CONTEXT
58 rti; 58 rti;
59ENDPROC(_ret_from_fork) 59ENDPROC(_ret_from_fork)
60
61ENTRY(_sys_vfork)
62 r0 = sp;
63 r0 += 24;
64 [--sp] = rets;
65 SP += -12;
66 pseudo_long_call _bfin_vfork, p2;
67 SP += 12;
68 rets = [sp++];
69 rts;
70ENDPROC(_sys_vfork)
71
72ENTRY(_sys_clone)
73 r0 = sp;
74 r0 += 24;
75 [--sp] = rets;
76 SP += -12;
77 pseudo_long_call _bfin_clone, p2;
78 SP += 12;
79 rets = [sp++];
80 rts;
81ENDPROC(_sys_clone)
82
83ENTRY(_sys_rt_sigreturn)
84 r0 = sp;
85 r0 += 24;
86 [--sp] = rets;
87 SP += -12;
88 pseudo_long_call _do_rt_sigreturn, p2;
89 SP += 12;
90 rets = [sp++];
91 rts;
92ENDPROC(_sys_rt_sigreturn)
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index da8df0e504ac..e5ae8fcab438 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -127,28 +127,13 @@ void flush_thread(void)
127{ 127{
128} 128}
129 129
130asmlinkage int bfin_vfork(struct pt_regs *regs) 130asmlinkage int bfin_clone(unsigned long clone_flags, unsigned long newsp)
131{ 131{
132 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(), regs, 0, NULL,
133 NULL);
134}
135
136asmlinkage int bfin_clone(struct pt_regs *regs)
137{
138 unsigned long clone_flags;
139 unsigned long newsp;
140
141#ifdef __ARCH_SYNC_CORE_DCACHE 132#ifdef __ARCH_SYNC_CORE_DCACHE
142 if (current->nr_cpus_allowed == num_possible_cpus()) 133 if (current->nr_cpus_allowed == num_possible_cpus())
143 set_cpus_allowed_ptr(current, cpumask_of(smp_processor_id())); 134 set_cpus_allowed_ptr(current, cpumask_of(smp_processor_id()));
144#endif 135#endif
145 136 if (newsp)
146 /* syscall2 puts clone_flags in r0 and usp in r1 */
147 clone_flags = regs->r0;
148 newsp = regs->r1;
149 if (!newsp)
150 newsp = rdusp();
151 else
152 newsp -= 12; 137 newsp -= 12;
153 return do_fork(clone_flags, newsp, regs, 0, NULL, NULL); 138 return do_fork(clone_flags, newsp, regs, 0, NULL, NULL);
154} 139}
@@ -174,7 +159,7 @@ copy_thread(unsigned long clone_flags,
174 } else { 159 } else {
175 *childregs = *regs; 160 *childregs = *regs;
176 childregs->r0 = 0; 161 childregs->r0 = 0;
177 p->thread.usp = usp; 162 p->thread.usp = usp ? : rdusp();
178 v[0] = v[1] = 0; 163 v[0] = v[1] = 0;
179 } 164 }
180 165
diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c
index 6ed20a1a4af9..84b4be05840c 100644
--- a/arch/blackfin/kernel/signal.c
+++ b/arch/blackfin/kernel/signal.c
@@ -82,9 +82,9 @@ rt_restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *p
82 return err; 82 return err;
83} 83}
84 84
85asmlinkage int do_rt_sigreturn(unsigned long __unused) 85asmlinkage int sys_rt_sigreturn(void)
86{ 86{
87 struct pt_regs *regs = (struct pt_regs *)__unused; 87 struct pt_regs *regs = current_pt_regs();
88 unsigned long usp = rdusp(); 88 unsigned long usp = rdusp();
89 struct rt_sigframe *frame = (struct rt_sigframe *)(usp); 89 struct rt_sigframe *frame = (struct rt_sigframe *)(usp);
90 sigset_t set; 90 sigset_t set;
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index 4a38c68e2dde..86b5a095c5a1 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -1431,7 +1431,7 @@ ENTRY(_sys_call_table)
1431 .long _sys_ni_syscall /* old sys_ipc */ 1431 .long _sys_ni_syscall /* old sys_ipc */
1432 .long _sys_fsync 1432 .long _sys_fsync
1433 .long _sys_ni_syscall /* old sys_sigreturn */ 1433 .long _sys_ni_syscall /* old sys_sigreturn */
1434 .long _sys_clone /* 120 */ 1434 .long _bfin_clone /* 120 */
1435 .long _sys_setdomainname 1435 .long _sys_setdomainname
1436 .long _sys_newuname 1436 .long _sys_newuname
1437 .long _sys_ni_syscall /* old sys_modify_ldt */ 1437 .long _sys_ni_syscall /* old sys_modify_ldt */