diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-26 15:15:13 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-28 22:36:46 -0500 |
commit | 27d892fb27f492921cfd6df15ab4153f1badbb46 (patch) | |
tree | a5097f8bfe9614ec86db50a84b538afb8399033d /arch/cris/arch-v10 | |
parent | 584271bcb45b50027c8d87b51634750780c92437 (diff) |
cris: switch to generic fork/vfork/clone
same braindamage as on s390 - the first two arguments of clone(2) in the
wrong order.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/cris/arch-v10')
-rw-r--r-- | arch/cris/arch-v10/kernel/process.c | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c index 1d6458287f38..520547c8b196 100644 --- a/arch/cris/arch-v10/kernel/process.c +++ b/arch/cris/arch-v10/kernel/process.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <arch/svinto.h> | 17 | #include <arch/svinto.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <arch/system.h> | 19 | #include <arch/system.h> |
20 | #include <asm/ptrace.h> | 20 | #include <linux/ptrace.h> |
21 | 21 | ||
22 | #ifdef CONFIG_ETRAX_GPIO | 22 | #ifdef CONFIG_ETRAX_GPIO |
23 | void etrax_gpio_wake_up_check(void); /* drivers/gpio.c */ | 23 | void etrax_gpio_wake_up_check(void); /* drivers/gpio.c */ |
@@ -95,7 +95,7 @@ asmlinkage void ret_from_kernel_thread(void); | |||
95 | 95 | ||
96 | int copy_thread(unsigned long clone_flags, unsigned long usp, | 96 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
97 | unsigned long arg, | 97 | unsigned long arg, |
98 | struct task_struct *p, struct pt_regs *regs) | 98 | struct task_struct *p, struct pt_regs *unused) |
99 | { | 99 | { |
100 | struct pt_regs *childregs = task_pt_regs(p); | 100 | struct pt_regs *childregs = task_pt_regs(p); |
101 | struct switch_stack *swstack = ((struct switch_stack *)childregs) - 1; | 101 | struct switch_stack *swstack = ((struct switch_stack *)childregs) - 1; |
@@ -115,7 +115,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
115 | p->thread.usp = 0; | 115 | p->thread.usp = 0; |
116 | return 0; | 116 | return 0; |
117 | } | 117 | } |
118 | *childregs = *regs; /* struct copy of pt_regs */ | 118 | *childregs = *current_pt_regs(); /* struct copy of pt_regs */ |
119 | 119 | ||
120 | childregs->r10 = 0; /* child returns 0 after a fork/clone */ | 120 | childregs->r10 = 0; /* child returns 0 after a fork/clone */ |
121 | 121 | ||
@@ -129,7 +129,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
129 | 129 | ||
130 | /* fix the user-mode stackpointer */ | 130 | /* fix the user-mode stackpointer */ |
131 | 131 | ||
132 | p->thread.usp = usp; | 132 | p->thread.usp = usp ?: rdusp(); |
133 | 133 | ||
134 | /* and the kernel-mode one */ | 134 | /* and the kernel-mode one */ |
135 | 135 | ||
@@ -143,30 +143,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
143 | return 0; | 143 | return 0; |
144 | } | 144 | } |
145 | 145 | ||
146 | asmlinkage int sys_fork(void) | ||
147 | { | ||
148 | return do_fork(SIGCHLD, rdusp(), current_pt_regs(), 0, NULL, NULL); | ||
149 | } | ||
150 | |||
151 | /* if newusp is 0, we just grab the old usp */ | ||
152 | /* FIXME: Is parent_tid/child_tid really third/fourth argument? Update lib? */ | ||
153 | asmlinkage int sys_clone(unsigned long newusp, unsigned long flags, | ||
154 | int* parent_tid, int* child_tid) | ||
155 | { | ||
156 | if (!newusp) | ||
157 | newusp = rdusp(); | ||
158 | return do_fork(flags, newusp, current_pt_regs(), 0, parent_tid, child_tid); | ||
159 | } | ||
160 | |||
161 | /* vfork is a system call in i386 because of register-pressure - maybe | ||
162 | * we can remove it and handle it in libc but we put it here until then. | ||
163 | */ | ||
164 | |||
165 | asmlinkage int sys_vfork(void) | ||
166 | { | ||
167 | return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(), current_pt_regs(), 0, NULL, NULL); | ||
168 | } | ||
169 | |||
170 | unsigned long get_wchan(struct task_struct *p) | 146 | unsigned long get_wchan(struct task_struct *p) |
171 | { | 147 | { |
172 | #if 0 | 148 | #if 0 |