summaryrefslogtreecommitdiff
path: root/arch/unicore32/kernel/process.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-10-23 02:49:03 (GMT)
committerAl Viro <viro@zeniv.linux.org.uk>2012-11-29 04:43:40 (GMT)
commitcb56217362d87159b683175247d8d059df80aefa (patch)
tree1d2889e6b854efb4ddea4b0861cdc14d7b4e8741 /arch/unicore32/kernel/process.c
parenteda96977024c84e677191cad785351abbb945901 (diff)
downloadlinux-cb56217362d87159b683175247d8d059df80aefa.tar.xz
unicore32: switch to generic clone(2)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/unicore32/kernel/process.c')
-rw-r--r--arch/unicore32/kernel/process.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/unicore32/kernel/process.c b/arch/unicore32/kernel/process.c
index a8fe265..79e44e8 100644
--- a/arch/unicore32/kernel/process.c
+++ b/arch/unicore32/kernel/process.c
@@ -262,26 +262,27 @@ asmlinkage void ret_from_kernel_thread(void) __asm__("ret_from_kernel_thread");
int
copy_thread(unsigned long clone_flags, unsigned long stack_start,
- unsigned long stk_sz, struct task_struct *p, struct pt_regs *regs)
+ unsigned long stk_sz, struct task_struct *p, struct pt_regs *unused)
{
struct thread_info *thread = task_thread_info(p);
struct pt_regs *childregs = task_pt_regs(p);
memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save));
thread->cpu_context.sp = (unsigned long)childregs;
- if (unlikely(!regs)) {
+ if (unlikely(p->flags & PF_KTHREAD)) {
thread->cpu_context.pc = (unsigned long)ret_from_kernel_thread;
thread->cpu_context.r4 = stack_start;
thread->cpu_context.r5 = stk_sz;
memset(childregs, 0, sizeof(struct pt_regs));
} else {
thread->cpu_context.pc = (unsigned long)ret_from_fork;
- *childregs = *regs;
+ *childregs = *current_pt_regs();
childregs->UCreg_00 = 0;
- childregs->UCreg_sp = stack_start;
+ if (stack_start)
+ childregs->UCreg_sp = stack_start;
if (clone_flags & CLONE_SETTLS)
- childregs->UCreg_16 = regs->UCreg_03;
+ childregs->UCreg_16 = childregs->UCreg_03;
}
return 0;
}